saritasa-nest / saritasa-dotnet-tools

Development Tools For Company'S .NET Projects.
BSD 2-Clause "Simplified" License
27 stars 13 forks source link

Allow to use queries without QueryHandlers attribute #46

Closed dermeister0 closed 6 years ago

dermeister0 commented 6 years ago

QueryObjectResolverMiddleware crashes if I have 2 interface implementations with QueryHandlers in assembly.

ArgumentException: An item with the same key has already been added. Key: MyProject.Domain.Queries.IMyQueries
System.ThrowHelper.ThrowAddingDuplicateWithKeyArgumentException(object key)
System.Collections.Generic.Dictionary.TryInsert(TKey key, TValue value, InsertionBehavior behavior)
System.Collections.Generic.Dictionary.Add(TKey key, TValue value)
System.Linq.Enumerable.ToDictionary<TSource, TKey, TElement>(IEnumerable<TSource> source, Func<TSource, TKey> keySelector, Func<TSource, TElement> elementSelector, IEqualityComparer<TKey> comparer)
Saritasa.Tools.Messages.Queries.PipelineMiddlewares.QueryObjectResolverMiddleware..ctor(Assembly[] assemblies)

2018-04-26_1745

I would like to register correct implementation in my IoC container. Need to ignore interfaceResolveDict if UseInternalObjectResolver is false.

2018-04-26_1744