コード例 #1
0
 public async Task Delete(DeletePersonInput input)
 {
     _context.People.Remove(new Person()
     {
         Id = input.Id
     });
     await _context.SaveChangesAsync();
 }
コード例 #2
0
        public async Task Delete(DeletePersonInput input)
        {
            var person = await _context.People.FirstOrDefaultAsync(p => p.PhoneNumber == "000000");

            if (person == null)
            {
                return;
            }

            _context.People.Remove(person);
            await _context.SaveChangesAsync();
        }