Example #1
0
        // 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();
        }
Example #2
0
 public AuthRepository()
 {
     _ctx         = new WebApiContext();
     _userManager = new UserManager <IdentityUser>(new UserStore <IdentityUser>(_ctx));
 }