Exemplo n.º 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;
    }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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;
        }
Exemplo n.º 5
0
 protected abstract PhraseDto UpdateImpl(PhraseDto dto);
Exemplo n.º 6
0
 protected abstract PhraseDto InsertImpl(PhraseDto dto);
Exemplo n.º 7
0
 protected abstract PhraseDto InsertImpl(PhraseDto dto);
Exemplo n.º 8
0
 protected abstract PhraseDto UpdateImpl(PhraseDto dto);