Beispiel #1
0
        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());
        }
Beispiel #2
0
 public async Task UpdateAsync(string id, NutrientsType NutrientsType)
 {
     await _nutrients.ReplaceOneAsync(s => s.Id == id, NutrientsType);
 }
Beispiel #3
0
        public async Task <IActionResult> Create(NutrientsType nutrientsType)
        {
            await _nutrientsTypeService.CreateAsync(nutrientsType);

            return(Ok(nutrientsType));
        }
Beispiel #4
0
        public async Task <NutrientsType> CreateAsync(NutrientsType NutrientsType)
        {
            await _nutrients.InsertOneAsync(NutrientsType);

            return(NutrientsType);
        }