Exemplo n.º 1
0
        public async Task <IActionResult> PutCookingTime(int id, Model.CookingTime cookingTime)
        {
            if (id != cookingTime.Id)
            {
                return(null);
            }

            _context.Entry(cookingTime).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!await CookingTimeExists(id))
                {
                    return(null);
                }
                else
                {
                    throw;
                }
            }

            return(null);
        }
Exemplo n.º 2
0
        public async Task <ActionResult <Model.CookingTime> > PostCookingTime(Model.CookingTime cookingTime)
        {
            _context.CookingTime.Add(cookingTime);
            await _context.SaveChangesAsync();

            return(null);
        }