public IngredientFormViewModel(GroceriesContext context) { UnitRepository unitRepo = new UnitRepository(context); UnitsSelectList = new SelectList(unitRepo.GetUnits(), "Id", "PluralDescriptor"); SectionRepository sectionRepo = new SectionRepository(context); SectionsSelectList = new SelectList(sectionRepo.GetSections(), "Id", "Name"); }
public IngredientFormViewModel(GroceriesContext context, Ingredient ingredient) { Id = ingredient.Id; Name = ingredient.Name; UnitId = ingredient.UnitId; Unit = ingredient.Unit; SectionId = ingredient.SectionId; Section = ingredient.Section; UnitRepository unitQueries = new UnitRepository(context); UnitsSelectList = new SelectList(unitQueries.GetUnits(), "Id", "PluralDescriptor", UnitId); SectionRepository sectionQueries = new SectionRepository(context); SectionsSelectList = new SelectList(sectionQueries.GetSections(), "Id", "Name", SectionId); }
public IngredientsController(GroceriesContext context, IIngredientRepository ingredientRepo) { _context = context; _ingredientRepo = ingredientRepo; }
public GroceriesController(ILogger <GroceriesController> logger) { _logger = logger; this.Groceries = new GroceriesContext(); }
public UnitRepository(GroceriesContext context) { _context = context; }
public TestController(GroceriesContext context) { _context = context; }
public IngredientRepository(GroceriesContext context) { this._context = context; }
public SectionRepository(GroceriesContext context) { _context = context; }