/// <summary> /// Sets the handler for specified command or query. /// </summary> /// <typeparam name="THandler">The type of the handler.</typeparam> public void SetHandler <THandler>() { _mappings.AddOrUpdate(typeof(T), () => TypeFactory.ActivatorFactory(typeof(THandler)), (_, __) => () => TypeFactory.ActivatorFactory(typeof(THandler))); }
public void SetHandler <THandler>() { _mappings.GetOrAdd(typeof(T), () => TypeFactory.ActivatorFactory(typeof(THandler))); }