Skip to content

Commit 617d736

Browse files
committed
Extra validation for command and query
1 parent 64cefa1 commit 617d736

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

MultiTenancyFramework.Core/Commands/CommandProcessor.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ public CommandProcessor(IServiceProvider serviceProvider)
1414
[DebuggerStepThrough]
1515
public void Process(ICommand command)
1616
{
17+
if (command == null) throw new ArgumentNullException("command");
18+
1719
var handlerType =
1820
typeof(ICommandHandler<>).MakeGenericType(command.GetType());
1921

MultiTenancyFramework.Core/Data/Queries/DbQueryProcessor.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System;
2+
using System.Diagnostics;
23

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

1314
public string InstitutionCode { get; set; }
1415

15-
//[DebuggerStepThrough]
16+
[DebuggerStepThrough]
1617
public TResult Process<TResult>(IDbQuery<TResult> query)
1718
{
19+
if (query == null) throw new ArgumentNullException("query");
20+
1821
var handlerType =
1922
typeof(IDbQueryHandler<,>).MakeGenericType(query.GetType(), typeof(TResult));
2023

0 commit comments

Comments
 (0)