Пример #1
0
        public async Task <int> DeleteAsync(Person person)
        {
            _context.Remove(person);
            var rowsAffected = await _context.SaveChangesAsync();

            return(rowsAffected);
        }
Пример #2
0
        public async Task <IActionResult> Create([FromBody] Bunny bunny)
        {
            context.Bunny.Add(bunny);
            await context.SaveChangesAsync();

            var bunnyUri = Url.Link("GetBunny", new { id = bunny.Id });

            return(Created(bunnyUri, bunny));
        }