public async Task <IActionResult> Update(string id, NutrientsType updatedNutrientsType) { var queriedNutrientsType = await _nutrientsTypeService.GetByIdAsync(id); if (queriedNutrientsType == null) { return(NotFound()); } await _nutrientsTypeService.UpdateAsync(id, updatedNutrientsType); return(NoContent()); }
public async Task UpdateAsync(string id, NutrientsType NutrientsType) { await _nutrients.ReplaceOneAsync(s => s.Id == id, NutrientsType); }
public async Task <IActionResult> Create(NutrientsType nutrientsType) { await _nutrientsTypeService.CreateAsync(nutrientsType); return(Ok(nutrientsType)); }
public async Task <NutrientsType> CreateAsync(NutrientsType NutrientsType) { await _nutrients.InsertOneAsync(NutrientsType); return(NutrientsType); }