public Result <TranslationDto> Update(TranslationDto dtoToUpdate) { Result <TranslationDto> retResult = Result <TranslationDto> .Undefined(null); try { Common.CommonHelper.CheckAuthentication(); var updatedDto = UpdateImpl(dtoToUpdate); retResult = Result <TranslationDto> .Success(updatedDto); } catch (Exception ex) { var wrappedEx = new Exceptions.UpdateFailedException(ex); retResult = Result <TranslationDto> .FailureWithInfo(null, wrappedEx); } return(retResult); }
public Result <TranslationDto> Insert(TranslationDto dtoToInsert) { Result <TranslationDto> retResult = Result <TranslationDto> .Undefined(null); try { Common.CommonHelper.CheckAuthentication(); var insertedDto = InsertImpl(dtoToInsert); retResult = Result <TranslationDto> .Success(insertedDto); } catch (Exception ex) { var wrappedEx = new Exceptions.InsertFailedException(ex); retResult = Result <TranslationDto> .FailureWithInfo(null, wrappedEx); } return(retResult); }
protected abstract TranslationDto InsertImpl(TranslationDto dto);
protected abstract TranslationDto UpdateImpl(TranslationDto dto);
public Result<TranslationDto> Update(TranslationDto dtoToUpdate) { Result<TranslationDto> retResult = Result<TranslationDto>.Undefined(null); try { Common.CommonHelper.CheckAuthentication(); var updatedDto = UpdateImpl(dtoToUpdate); retResult = Result<TranslationDto>.Success(updatedDto); } catch (Exception ex) { var wrappedEx = new Exceptions.UpdateFailedException(ex); retResult = Result<TranslationDto>.FailureWithInfo(null, wrappedEx); } return retResult; }
public Result<TranslationDto> Insert(TranslationDto dtoToInsert) { Result<TranslationDto> retResult = Result<TranslationDto>.Undefined(null); try { Common.CommonHelper.CheckAuthentication(); var insertedDto = InsertImpl(dtoToInsert); retResult = Result<TranslationDto>.Success(insertedDto); } catch (Exception ex) { var wrappedEx = new Exceptions.InsertFailedException(ex); retResult = Result<TranslationDto>.FailureWithInfo(null, wrappedEx); } return retResult; }