Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using ejemplo_crud_MVC_sqlServer;
- using Microsoft.EntityFrameworkCore;
- using System;
- var builder = WebApplication.CreateBuilder(args);
- builder.Services.AddControllersWithViews();
- builder.Services.AddDbContext<ApplicationDbContext>(options =>
- options.UseSqlServer(builder.Configuration.GetConnectionString("DefaultConnection"))
- );
- var app = builder.Build();
- if (!app.Environment.IsDevelopment())
- {
- app.UseExceptionHandler("/Home/Error");
- }
- app.UseStaticFiles();
- app.UseRouting();
- app.UseAuthorization();
- app.MapControllerRoute(
- name: "default",
- pattern: "{controller=Productos}/{action=Index}/{id?}");
- app.Run();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement