Esempio n. 1
0
        public async Task <IActionResult> PutTodoItem(long id, MyGTP item)
        {
            if (id != item.Id)
            {
                return(BadRequest());
            }

            _context.Entry(item).State = EntityState.Modified;
            await _context.SaveChangesAsync();

            return(NoContent());
        }
Esempio n. 2
0
        public async Task <ActionResult> PutTodoItem(string id, MyGTP item)
        {
            if (id != item.Id)
            {
                return(BadRequest());
            }
            item.SetLength();
            _context.Entry(item).State = EntityState.Modified;
            await _context.SaveChangesAsync();

            using (StreamWriter fs = System.IO.File.CreateText(outjson))
            {
                await fs.WriteAsync(JsonConvert.SerializeObject(_context.GTPs));
            }

            return(NoContent());
        }