// This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { services.ConfigureMRToken(Configuration, "AccessTokenOptions"); services.ConfigurateMRIdentity <AppUser, AppUserRepository, AppUserManager>(Configuration, "DbConnection", null); DI.AddDependencies(services, Configuration); services.AddSwaggerGen(c => { c.SwaggerDoc("v1", new Swashbuckle.AspNetCore.Swagger.Info { Title = "Auto generated Identity Api", Version = "v1", Contact = new Swashbuckle.AspNetCore.Swagger.Contact { Email = "*****@*****.**", Name = "Oleh Tymofieiev", Url = "http://identity_dev.madrat.studio" } }); var xmlFile = $"{Assembly.GetExecutingAssembly().GetName().Name}.XML"; var xmlPath = Path.Combine(AppContext.BaseDirectory, xmlFile); c.IncludeXmlComments(xmlPath); }); services.AddAutoMapper(); services.AddCors(options => options.AddPolicy("AllowAll", p => p.AllowAnyOrigin().AllowAnyMethod().AllowAnyHeader().AllowCredentials())); services.AddMvc(o => { }).AddJsonOptions(options => { options.SerializerSettings.DateFormatString = "yyyy-MM-ddTH:mm:ss.Z"; options.SerializerSettings.DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc; options.SerializerSettings.ContractResolver = new DefaultContractResolver() { NamingStrategy = new SnakeCaseNamingStrategy() }; }); Services.InitServices(services, Configuration); }