Beispiel #1
0
        public void ConfigureServices(IServiceCollection services)
        {
            var config = new MongoDBConfig();

            Configuration.Bind(config);
            var appUsersContext = new AppUserContext(config);
            var repo            = new AppUserRepository(appUsersContext);

            services.AddSingleton <AppUserRepository>(repo);
            var planContext = new ServicePlanContext(config);
            var planrepo    = new ServicePlanRepository(planContext);

            services.AddSingleton <ServicePlanRepository>(planrepo);

            services.AddControllers();

            services.AddCors(options =>
            {
                options.AddPolicy(MyAllowSpecificOrigins,
                                  builder =>
                {
                    builder.WithOrigins("http://localhost:4200")
                    .AllowAnyHeader()
                    .AllowAnyMethod();
                });
            });
        }
Beispiel #2
0
 public AppUserController(AppUserRepository repo)
 {
     _repo = repo;
 }