Skip to content

Commit e4f3656

Browse files
committed
disallow duplicate method name
1 parent 51b2629 commit e4f3656

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/MicroBatchFramework/BatchEngineHostBuilderExtensions.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,10 @@ static List<Type> GetBatchTypes()
217217
{
218218
if (cmdattr.CommandNames.Any(x => arg0.Equals(x, StringComparison.OrdinalIgnoreCase)))
219219
{
220+
if(foundType != null && foundMethod != null)
221+
{
222+
throw new InvalidOperationException($"Duplicate BatchBase Command name is not allowed, {foundType.FullName}.{foundMethod.Name} and {baseType.FullName}.{method.Name}");
223+
}
220224
foundType = baseType;
221225
foundMethod = method;
222226
isFound = true;

0 commit comments

Comments
 (0)