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