Пример #1
0
    public Result<PhraseDto> Update(PhraseDto dtoToUpdate)
    {
      Result<PhraseDto> retResult = Result<PhraseDto>.Undefined(null);
      try
      {
        Common.CommonHelper.CheckAuthentication();

        var updatedDto = UpdateImpl(dtoToUpdate);
        retResult = Result<PhraseDto>.Success(updatedDto);
      }
      catch (Exception ex)
      {
        var wrappedEx = new Exceptions.UpdateFailedException(ex);
        retResult = Result<PhraseDto>.FailureWithInfo(null, wrappedEx);
      }
      return retResult;
    }
Пример #2
0
        public Result <PhraseDto> Update(PhraseDto dtoToUpdate)
        {
            Result <PhraseDto> retResult = Result <PhraseDto> .Undefined(null);

            try
            {
                Common.CommonHelper.CheckAuthentication();

                var updatedDto = UpdateImpl(dtoToUpdate);
                retResult = Result <PhraseDto> .Success(updatedDto);
            }
            catch (Exception ex)
            {
                var wrappedEx = new Exceptions.UpdateFailedException(ex);
                retResult = Result <PhraseDto> .FailureWithInfo(null, wrappedEx);
            }
            return(retResult);
        }
Пример #3
0
        public Result <PhraseDto> Insert(PhraseDto dtoToInsert)
        {
            Result <PhraseDto> retResult = Result <PhraseDto> .Undefined(null);

            try
            {
                Common.CommonHelper.CheckAuthentication();

                var insertedDto = InsertImpl(dtoToInsert);
                retResult = Result <PhraseDto> .Success(insertedDto);
            }
            catch (Exception ex)
            {
                var wrappedEx = new Exceptions.InsertFailedException(ex);
                retResult = Result <PhraseDto> .FailureWithInfo(null, wrappedEx);
            }
            return(retResult);
        }
Пример #4
0
        public Result<PhraseDto> Insert(PhraseDto dtoToInsert)
        {
            Result<PhraseDto> retResult = Result<PhraseDto>.Undefined(null);
              try
              {
            Common.CommonHelper.CheckAuthentication();

            var insertedDto = InsertImpl(dtoToInsert);
            retResult = Result<PhraseDto>.Success(insertedDto);
              }
              catch (Exception ex)
              {
            var wrappedEx = new Exceptions.InsertFailedException(ex);
            retResult = Result<PhraseDto>.FailureWithInfo(null, wrappedEx);
              }
              return retResult;
        }
Пример #5
0
 protected abstract PhraseDto UpdateImpl(PhraseDto dto);
Пример #6
0
 protected abstract PhraseDto InsertImpl(PhraseDto dto);
Пример #7
0
 protected abstract PhraseDto InsertImpl(PhraseDto dto);
Пример #8
0
 protected abstract PhraseDto UpdateImpl(PhraseDto dto);