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