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