// This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { services.AddControllersWithViews(); // In production, the Angular files will be served from this directory services.AddSpaStaticFiles(configuration => { configuration.RootPath = "ClientApp/dist"; }); services.AddHttpContextAccessor(); DataDependencies.Initialize(services); CommonDependencies.Initialize(services); ServiceDependencies.Initialize(services); var config = new AutoMapper.MapperConfiguration(cfg => { cfg.AddProfile(new ModelEntityMapperProfile()); cfg.AddProfile(new ModelViewModelMapperProfile()); }); var mapper = config.CreateMapper(); services.AddSingleton(mapper); }
/// <summary> /// Registers all the dependencies from the /// different parts of the application. /// </summary> private static void RegisterCoreDependencies() { AuthenticationDependencies.Register(); CourseDependencies.Register(); DataDependencies.Register(); SharedDependencies.Register(); UtilityDependencies.Register(); }
public static void RegistDataDependencies(this IServiceCollection services) { var dataDependencies = new DataDependencies(); dataDependencies.RegisterServices(services); }