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