public EntityFrameworkCoreDependencyInjectionDecorator(DependencyInjectionTemplate template, IApplication application)
        {
            _template    = template;
            _application = application;
            _template.AddNugetDependency(NugetPackages.EntityFrameworkCoreSqlServer(_template.Project));
            _template.AddNugetDependency(NugetPackages.EntityFrameworkCoreInMemory(_template.Project));
            if (_template.Project.IsNet5App())
            {
                _template.AddNugetDependency("Microsoft.Extensions.Configuration.Binder", "5.0.0");
            }
            if (_template.Project.IsNet6App())
            {
                _template.AddNugetDependency("Microsoft.Extensions.Configuration.Binder", "6.0.0");
            }
            if (_template.ExecutionContext.Settings.GetMultitenancySettings()?.DataIsolation().IsSeparateDatabases() == true)
            {
                _template.AddNugetDependency("Finbuckle.MultiTenant", "6.5.1");
            }

            _template.ExecutionContext.EventDispatcher.Publish(new AppSettingRegistrationRequest(
                                                                   key: "UseInMemoryDatabase",
                                                                   value: "true"));
            _template.ExecutionContext.EventDispatcher.Publish(new ConnectionStringRegistrationRequest(
                                                                   name: "DefaultConnection",
                                                                   connectionString: $"Server=.;Initial Catalog={ _template.OutputTarget.Application.Name };Integrated Security=true;MultipleActiveResultSets=True",
                                                                   providerName: "System.Data.SqlClient"));
        }
 public MediatRDependencyInjectionDecorator(DependencyInjectionTemplate template, IApplication application)
 {
     _template    = template;
     _application = application;
     _template.AddNugetDependency("MediatR.Extensions.Microsoft.DependencyInjection", "10.0.1");
 }
Ejemplo n.º 3
0
 public AutoMapperDependencyInjectionDecorator(DependencyInjectionTemplate template, IApplication application)
 {
     _template    = template;
     _application = application;
     _template.AddNugetDependency("AutoMapper.Extensions.Microsoft.DependencyInjection", "7.0.*");
 }
 public FluentValidationDependencyInjectionDecorator(DependencyInjectionTemplate template, IApplication application)
 {
     _template    = template;
     _application = application;
     _template.AddNugetDependency("FluentValidation.DependencyInjectionExtensions", "9.3.0");
 }