Exemplo n.º 1
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddCors();

            services.AddMvc();

            services.AddDbContext <NORTHWNDContext>(options => options.UseSqlServer(HelperAppSettings.ConnectionString, b => b.MigrationsAssembly("WebApi.Core")));

            services.AddIdentity <User, Roles>(Options => WebApiUserManager.CreateOptions(Options))
            .AddEntityFrameworkStores <NORTHWNDContext>();

            RegisterIoC(services);

            //services.Configure<AppSettings>(Configuration);
        }