예제 #1
0
파일: Startup.cs 프로젝트: L30D3V/MQI
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            var config = new ServerConfig();

            Configuration.Bind(config);

            var todoContext = new WebApiContext(config.MongoDB);
            var repo        = new WebApiRepository(todoContext);
            var rept        = new FuncionarioRepository(todoContext);

            services.AddSingleton <IWebApiRepository>(repo);
            services.AddSingleton <IFuncionarioRepository>(rept);

            // Add framework services.
            services.AddMvc();
        }
예제 #2
0
 public AuthRepository()
 {
     _ctx         = new WebApiContext();
     _userManager = new UserManager <IdentityUser>(new UserStore <IdentityUser>(_ctx));
 }