示例#1
0
        public async Task <bool> UpdateAsync(PersonDTO person)
        {
            var entity = PersonDTO.FromDto(person);

            _context.Entry(entity).State = EntityState.Modified;
            return(await SaveChangesAsync());
        }
示例#2
0
        public async Task <bool> CreateAsync(PersonDTO person)
        {
            var entity = PersonDTO.FromDto(person);

            _context.Persons.Add(entity);
            return(await SaveChangesAsync());
        }