Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Startup
- {
- public void ConfigureServices(IServiceCollection services)
- {
- services.AddDbContext<TodoContext>(opt => opt.UseSqlServer("Server=se00217210\\sqlexpress;Database=WebAPIDB;Trusted_Connection=True;"));
- services.AddMvc();
- }
- public void Configure(IApplicationBuilder app, TodoContext context)
- {
- context.Database.EnsureCreated(); //This should create the database automatically
- app.UseMvc();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement