public async Task <ActualResult> UpdateAsync(GrandChildrenDTO item) { try { _context.Entry(_mapperService.Mapper.Map <DAL.Entities.GrandChildren>(item)).State = EntityState.Modified; await _context.SaveChangesAsync(); return(new ActualResult()); } catch (Exception exception) { return(new ActualResult(DescriptionExceptionHelper.GetDescriptionError(exception))); } }
public async Task <ActualResult <string> > CreateAsync(GrandChildrenDTO item) { try { var grandChildren = _mapper.Map <DAL.Entities.GrandChildren>(item); await _context.GrandChildren.AddAsync(grandChildren); await _context.SaveChangesAsync(); var hashId = HashHelper.EncryptLong(grandChildren.Id); return(new ActualResult <string> { Result = hashId }); } catch (Exception exception) { return(new ActualResult <string>(DescriptionExceptionHelper.GetDescriptionError(exception))); } }