Fixed bug where multiple activity registrations of the same type would cause duplicate key exception (#128)

* Fixed issue in ActivityResolver where multiple registrations of the same workflow type would cause dup key exception

* Updated Sample12 to remove AddUserTaskActivities() call, as this is now done in AddElsa()
This commit is contained in:
James Doran 2019-11-05 10:49:20 +10:30 committed by Sipke Schoorstra
parent 6e352ebed3
commit 7d4d0f919e
2 changed files with 2 additions and 3 deletions

View file

@ -18,7 +18,7 @@ namespace Elsa.Services
() =>
{
var activities = activitiesFunc();
return activities.Select(x => x.GetType()).ToDictionary(x => x.Name);
return activities.Select(x => x.GetType()).Distinct().ToDictionary(x => x.Name);
});
}

View file

@ -1,4 +1,4 @@
using System;
using System;
using System.Linq;
using System.Threading.Tasks;
using Elsa.Activities.Console.Extensions;
@ -48,7 +48,6 @@ namespace Sample12
return new ServiceCollection()
.AddElsa()
.AddConsoleActivities()
.AddUserTaskActivities()
.AddWorkflow<UserTaskWorkflow>()
.BuildServiceProvider();
}