Esempio n. 1
0
        public async Task <IActionResult> Put(UserFridgeIngredient userIngredient)
        {
            _context.Entry(userIngredient).State = EntityState.Modified;
            await _context.SaveChangesAsync();

            return(NoContent());
        }
Esempio n. 2
0
        public async Task <IActionResult> Post(UserFridgeIngredient userIngredient)
        {
            _context.Add(userIngredient);
            await _context.SaveChangesAsync();

            return(Ok(userIngredient.Id));
        }
Esempio n. 3
0
        public async Task <IActionResult> Delete(Guid id)
        {
            var userIngredient = new UserFridgeIngredient {
                Id = id
            };

            _context.Remove(userIngredient);
            await _context.SaveChangesAsync();

            return(NoContent());
        }