Exemple #1
0
        public static IServiceCollection AddMediatorWithRequests(this IServiceCollection services)
        {
            services.AddMediatR(options =>
            {
                options.AsTransient();
            },
                                ReadAssemblyHelper.Get(),
                                WriteAssemblyHelper.Get());

            return(services);
        }
 public static IServiceCollection AddMediatorWithRequests(this IServiceCollection services)
 {
     services.AddTransient(typeof(IPipelineBehavior <,>), typeof(ValidationBehavior <,>));
     services.AddMediatR(options =>
     {
         options.AsTransient();
     },
                         ReadAssemblyHelper.Get(),
                         WriteAssemblyHelper.Get());
     return(services);
 }
 public static IMvcBuilder AddFluentValidators(this IMvcBuilder builder)
 {
     builder.AddFluentValidation(options =>
     {
         options.RegisterValidatorsFromAssemblies(new List <Assembly>
         {
             ReadAssemblyHelper.Get(),
             WriteAssemblyHelper.Get()
         });
     });
     return(builder);
 }