Skip to content

Commit

Permalink
disallow duplicate method name
Browse files Browse the repository at this point in the history
  • Loading branch information
itn3000 committed Jul 14, 2019
1 parent 51b2629 commit e4f3656
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/MicroBatchFramework/BatchEngineHostBuilderExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,10 @@ static List<Type> GetBatchTypes()
{
if (cmdattr.CommandNames.Any(x => arg0.Equals(x, StringComparison.OrdinalIgnoreCase)))
{
if(foundType != null && foundMethod != null)
{
throw new InvalidOperationException($"Duplicate BatchBase Command name is not allowed, {foundType.FullName}.{foundMethod.Name} and {baseType.FullName}.{method.Name}");
}
foundType = baseType;
foundMethod = method;
isFound = true;
Expand Down

0 comments on commit e4f3656

Please sign in to comment.