public void Add(FoodPantry foodPantry) { _context.Add(foodPantry); _context.SaveChanges(); }
public void Update(FoodPantry foodPantry) { _context.Entry(foodPantry).State = EntityState.Modified; _context.SaveChanges(); }
public IActionResult FoodPantry(FoodPantry foodPantry) { _foodPantryRepository.Add(foodPantry); return(CreatedAtAction("Get", new { id = foodPantry.Id }, foodPantry)); }