Example #1
0
        /// <summary>
        /// Add command sender and handlers
        /// </summary>
        /// <param name="handlersAssemblies">commands handlers assemblies</param>
        /// <typeparam name="TMsgResult"></typeparam>
        /// <returns></returns>
        public IServiceCollection AddCqrsSimpleCommands <TMsgResult>(Assembly[] handlersAssemblies)
            where TMsgResult : class, IMessageResult
        {
            var builder = new SimpleCommandModuleBuilder <TMsgResult>(_collection, handlersAssemblies);

            return(builder.AddServices());
        }
Example #2
0
        /// <summary>
        /// Add command sender and handlers
        /// </summary>
        /// <param name="services"></param>
        /// <returns></returns>
        public static IServiceCollection AddCqrsSimpleCommands(this IServiceCollection services)
        {
            var builder = new SimpleCommandModuleBuilder <SimpleMessageResult>(services, typeof(ChangeBalanceHandler).Assembly);

            return(builder.AddServices());
        }