// This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { services.AddDbContext <DB_EcommerseContext>(builder => { var connection = Configuration.GetConnectionString("Conexion"); var dbOptions = new DbContextOptionsBuilder <DB_EcommerseContext>() .UseSqlServer(connection).Options; using var db = new DB_EcommerseContext(dbOptions); db.Database.EnsureCreated(); }); services.AddControllers(); services.AddSwaggerGen(c => { c.SwaggerDoc("v1", new OpenApiInfo { Title = "Ecommerse", Version = "v1" }); }); }
public ReviewController(DB_EcommerseContext context) { dbContext = context; }
public CategoriaController(DB_EcommerseContext context) { dbContext = context; }
public UsuarioController(DB_EcommerseContext context) { dbContext = context; }
public CarritoControler(DB_EcommerseContext context) { dbContext = context; }
public ProductosController(DB_EcommerseContext context) { dbContext = context; }