Skip to content

Commit

Permalink
Extra validation for command and query
Browse files Browse the repository at this point in the history
  • Loading branch information
smbadiwe committed Aug 12, 2016
1 parent 64cefa1 commit 617d736
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions MultiTenancyFramework.Core/Commands/CommandProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ public CommandProcessor(IServiceProvider serviceProvider)
[DebuggerStepThrough]
public void Process(ICommand command)
{
if (command == null) throw new ArgumentNullException("command");

var handlerType =
typeof(ICommandHandler<>).MakeGenericType(command.GetType());

Expand Down
5 changes: 4 additions & 1 deletion MultiTenancyFramework.Core/Data/Queries/DbQueryProcessor.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using System.Diagnostics;

namespace MultiTenancyFramework.Data.Queries
{
Expand All @@ -12,9 +13,11 @@ public DbQueryProcessor(IServiceProvider serviceProvider)

public string InstitutionCode { get; set; }

//[DebuggerStepThrough]
[DebuggerStepThrough]
public TResult Process<TResult>(IDbQuery<TResult> query)
{
if (query == null) throw new ArgumentNullException("query");

var handlerType =
typeof(IDbQueryHandler<,>).MakeGenericType(query.GetType(), typeof(TResult));

Expand Down

0 comments on commit 617d736

Please sign in to comment.