public void ConfigureServices(IServiceCollection services) { var connectionString = Configuration.GetConnectionString("DefaultConnection"); services.AddScoped <IDocumentTypeServices, DocumentTypeServices>(); services.AddScoped <IBetTypeServices, BetTypeServices>(); services.AddScoped <IRouletteServices, RouletteServices>(); services.AddScoped <IRouletteTransactions, RouletteTransactions>(); services.AddScoped <IRouletteConfigurationServices, RouletteConfigurationServices>(); services.AddScoped <IBetTransactions, BetTransactions>(); services.AddSingleton(Configuration); StartupServices.ConfigureServices(services, connectionString); StartupTransactions.ConfigureServices(services, connectionString); services.AddControllers(); services.AddSwaggerGen(c => { c.SwaggerDoc("v1", new OpenApiInfo { Title = "ROULETTE API", Version = "v1" }); var xmlFile = $"{Assembly.GetExecutingAssembly().GetName().Name}.xml"; var xmlPath = Path.Combine(AppContext.BaseDirectory, xmlFile); c.IncludeXmlComments(xmlPath); c.CustomSchemaIds(type => type.ToString()); }); }
// This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { var connectionString = Configuration.GetConnectionString("DefaultConnection"); services.AddScoped <IAirplanesTypesServices, AirplanesTypesServices>(); services.AddControllers(); services.AddSwaggerGen(options => { options.SwaggerDoc("v1", new Microsoft.OpenApi.Models.OpenApiInfo { Title = "Airport Service API", Description = "API for airport controller", Version = "v1" }); var fileName = $"{Assembly.GetExecutingAssembly().GetName().Name}.xml"; var filePath = Path.Combine(AppContext.BaseDirectory, fileName); options.IncludeXmlComments(filePath); }); StartupServices.ConfigureServices(services, connectionString); }
public static void ConfigureServices(IServiceCollection services, string connectionString) { services.AddScoped <IRouletteServices, RouletteServices>(); services.AddScoped <IRouletteConfigurationServices, RouletteConfigurationServices>(); services.AddScoped <IPlayerServices, PlayerServices>(); services.AddScoped <IBetTypeServices, BetTypeServices>(); services.AddScoped <IBetServices, BetServices>(); StartupServices.ConfigureServices(services, connectionString); }
// This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { #region Automapper services.AddAutoMapper(typeof(Startup)); services.AddControllersWithViews(); #endregion Automapper var connectionString = Configuration.GetConnectionString("DefaultConnection"); services.AddScoped <IDocumentTypeServices, DocumentTypeServices>(); services.AddScoped <IPersonServices, PersonServices>(); services.AddScoped <ICorrespondenceServices, CorrespondenceServices>(); services.AddScoped <ICorrespondenceFilesServices, CorrespondenceFilesServices>(); StartupServices.ConfigureServices(services, connectionString); services.AddControllers(); #region Swagger services.AddSwaggerGen(options => { var groupName = "v1"; options.SwaggerDoc(groupName, new OpenApiInfo { Title = $"AlphaTIC {groupName}", Version = groupName, Description = "AlphaTIC API", Contact = new OpenApiContact { Name = "Xerbeth", Email = "*****@*****.**", Url = new Uri("https://github.com/Xerbeth/ALPHA_TIC"), } }); }); #endregion Swagger }