public static void RegisterDependencies(IServiceCollection services) { CommonConfiguration.RegisterDependencies(services); DataConfiguration.RegisterDependencies(services); services.AddTransient <IUserService, UserService>(); services.AddTransient <IPatientService, PatientService>(); services.AddTransient <IAppointmentService, AppointmentService>(); services.AddTransient <ITreatmentService, TreatmentService>(); }
// This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { services.AddCors(options => { options.AddPolicy(_myCorsOrigins, builder => { builder.WithOrigins("http://localhost:3000") .AllowAnyHeader() .AllowAnyMethod() .AllowCredentials(); }); }); // services.AddControllers(); services.AddMvc(); ServicesConfiguration.RegisterDependencies(services); CommonConfiguration.RegisterDependencies(services); // services.AddSwaggerGen(c => // { // c.SwaggerDoc("v1", new OpenApiInfo { Title = "Bancassurance API", Version = "v1" }); // }); }
public static void RegisterDependencies(IServiceCollection services) { CommonConfiguration.RegisterDependencies(services); services.AddTransient <IUnitOfWork, UnitOfWork>(); }