public IActionResult Update(string id, GroceryPurchasedModel groceryPurchasedModelIn) { var groceryPurchasedModel = _groceryPurchasedService.Get(id); if (groceryPurchasedModel == null) { return(NotFound()); } _groceryPurchasedService.Update(id, groceryPurchasedModelIn); return(NoContent()); }
public ActionResult <GroceryPurchasedModel> Create(GroceryPurchasedModel groceryPurchasedModel) { _groceryPurchasedService.Create(groceryPurchasedModel); return(CreatedAtRoute("GetGroceryPurchasedItem", new { id = groceryPurchasedModel.id.ToString() }, groceryPurchasedModel)); }
public void Update(string id, GroceryPurchasedModel groceryPurchasedModelIn) => _groceryPurchasedModels.ReplaceOne(groceryPurchasedModel => groceryPurchasedModel.id == id, groceryPurchasedModelIn);
public void Remove(GroceryPurchasedModel groceryPurchasedModelIn) => _groceryPurchasedModels.DeleteOne(groceryPurchasedModel => groceryPurchasedModel.id == groceryPurchasedModelIn.id);
public GroceryPurchasedModel Create(GroceryPurchasedModel groceryPurchasedModel) { _groceryPurchasedModels.InsertOne(groceryPurchasedModel); return(groceryPurchasedModel); }