public Result<ICollection<PhraseDto>> Fetch(ICollection<Guid> ids)
        {
            Result<ICollection<PhraseDto>> retResult = Result<ICollection<PhraseDto>>.Undefined(null);
              try
              {
            Common.CommonHelper.CheckAuthentication();

            var dtos = FetchImpl(ids);
            retResult = Result<ICollection<PhraseDto>>.Success(dtos);
              }
              catch (Exception ex)
              {
            var wrappedEx = new Exceptions.FetchFailedException(ex);
            retResult = Result<ICollection<PhraseDto>>.FailureWithInfo(null, wrappedEx);
              }
              return retResult;
        }
        public Result<LanguageDto> Fetch(string languageText)
        {
            Result<LanguageDto> retResult = Result<LanguageDto>.Undefined(null);
              try
              {
            Common.CommonHelper.CheckAuthentication();

            var dto = FetchImpl(languageText);
            retResult = Result<LanguageDto>.Success(dto);
              }
              catch (Exception ex)
              {
            var wrappedEx = new Exceptions.FetchFailedException(ex);
            retResult = Result<LanguageDto>.FailureWithInfo(null, wrappedEx);
              }
              return retResult;
        }
        //public Result<StudyDataDto> Fetch(Guid id)
        //{
        //  Result<StudyDataDto> retResult = Result<StudyDataDto>.Undefined(null);
        //  try
        //  {
        //    Common.CommonHelper.CheckAuthentication();
        //    var dto = FetchImpl(id);
        //    retResult = Result<StudyDataDto>.Success(dto);
        //  }
        //  catch (Exception ex)
        //  {
        //    var wrappedEx = new Exceptions.FetchFailedException(ex);
        //    retResult = Result<StudyDataDto>.FailureWithInfo(null, wrappedEx);
        //  }
        //  return retResult;
        ////}
        //public Result<ICollection<StudyDataDto>> Fetch(ICollection<Guid> ids)
        //{
        //  Result<ICollection<StudyDataDto>> retResult = Result<ICollection<StudyDataDto>>.Undefined(null);
        //  try
        //  {
        //    Common.CommonHelper.CheckAuthentication();
        //    var dtos = FetchImpl(ids);
        //    retResult = Result<ICollection<StudyDataDto>>.Success(dtos);
        //  }
        //  catch (Exception ex)
        //  {
        //    var wrappedEx = new Exceptions.FetchFailedException(ex);
        //    retResult = Result<ICollection<StudyDataDto>>.FailureWithInfo(null, wrappedEx);
        //  }
        //  return retResult;
        //}
        public Result<StudyDataDto> FetchForCurrentUser()
        {
            Result<StudyDataDto> retResult = Result<StudyDataDto>.Undefined(null);
              try
              {
            Common.CommonHelper.CheckAuthentication();

            var dto = FetchForCurrentUserImpl();
            retResult = Result<StudyDataDto>.Success(dto);
              }
              catch (Exception ex)
              {
            var wrappedEx = new Exceptions.FetchFailedException(ex);
            retResult = Result<StudyDataDto>.FailureWithInfo(null, wrappedEx);
              }
              return retResult;
        }
        public Result<TranslationDto> Fetch(Guid id)
        {
            Result<TranslationDto> retResult = Result<TranslationDto>.Undefined(null);
              try
              {
            Common.CommonHelper.CheckAuthentication();

            var dto = FetchImpl(id);
            retResult = Result<TranslationDto>.Success(dto);
              }
              catch (Exception ex)
              {
            var wrappedEx = new Exceptions.FetchFailedException(ex);
            retResult = Result<TranslationDto>.FailureWithInfo(null, wrappedEx);
              }
              return retResult;
        }
Example #5
0
        /// <summary>
        /// Returns all multiLineTexts that contains the lineId.
        /// </summary>
        /// <param name="lineDto"></param>
        /// <returns></returns>
        public Result <ICollection <MultiLineTextDto> > FetchByLineId(Guid lineId)
        {
            Result <ICollection <MultiLineTextDto> > retResult = Result <ICollection <MultiLineTextDto> > .Undefined(null);

            try
            {
                Common.CommonHelper.CheckAuthentication();

                var dtos = FetchByIdImpl(lineId);
                retResult = Result <ICollection <MultiLineTextDto> > .Success(dtos);
            }
            catch (Exception ex)
            {
                var wrappedEx = new Exceptions.FetchFailedException(ex);
                retResult = Result <ICollection <MultiLineTextDto> > .FailureWithInfo(null, wrappedEx);
            }
            return(retResult);
        }
Example #6
0
        public Result <MultiLineTextDto> Fetch(Guid id)
        {
            Result <MultiLineTextDto> retResult = Result <MultiLineTextDto> .Undefined(null);

            try
            {
                Common.CommonHelper.CheckAuthentication();

                var dto = FetchImpl(id);
                retResult = Result <MultiLineTextDto> .Success(dto);
            }
            catch (Exception ex)
            {
                var wrappedEx = new Exceptions.FetchFailedException(ex);
                retResult = Result <MultiLineTextDto> .FailureWithInfo(null, wrappedEx);
            }
            return(retResult);
        }
        public Result <bool> StudyDataExistsForCurrentUser()
        {
            Result <bool> retResult = Result <bool> .Undefined(false);

            try
            {
                Common.CommonHelper.CheckAuthentication();

                var dto = StudyDataExistsForCurrentUserImpl();
                retResult = Result <bool> .Success(dto);
            }
            catch (Exception ex)
            {
                var wrappedEx = new Exceptions.FetchFailedException(ex);
                retResult = Result <bool> .FailureWithInfo(false, wrappedEx);
            }
            return(retResult);
        }
        //public Result<StudyDataDto> Fetch(Guid id)
        //{
        //  Result<StudyDataDto> retResult = Result<StudyDataDto>.Undefined(null);
        //  try
        //  {
        //    Common.CommonHelper.CheckAuthentication();

        //    var dto = FetchImpl(id);
        //    retResult = Result<StudyDataDto>.Success(dto);
        //  }
        //  catch (Exception ex)
        //  {
        //    var wrappedEx = new Exceptions.FetchFailedException(ex);
        //    retResult = Result<StudyDataDto>.FailureWithInfo(null, wrappedEx);
        //  }
        //  return retResult;
        ////}
        //public Result<ICollection<StudyDataDto>> Fetch(ICollection<Guid> ids)
        //{
        //  Result<ICollection<StudyDataDto>> retResult = Result<ICollection<StudyDataDto>>.Undefined(null);
        //  try
        //  {
        //    Common.CommonHelper.CheckAuthentication();

        //    var dtos = FetchImpl(ids);
        //    retResult = Result<ICollection<StudyDataDto>>.Success(dtos);
        //  }
        //  catch (Exception ex)
        //  {
        //    var wrappedEx = new Exceptions.FetchFailedException(ex);
        //    retResult = Result<ICollection<StudyDataDto>>.FailureWithInfo(null, wrappedEx);
        //  }
        //  return retResult;
        //}
        public Result <StudyDataDto> FetchForCurrentUser()
        {
            Result <StudyDataDto> retResult = Result <StudyDataDto> .Undefined(null);

            try
            {
                Common.CommonHelper.CheckAuthentication();

                var dto = FetchForCurrentUserImpl();
                retResult = Result <StudyDataDto> .Success(dto);
            }
            catch (Exception ex)
            {
                var wrappedEx = new Exceptions.FetchFailedException(ex);
                retResult = Result <StudyDataDto> .FailureWithInfo(null, wrappedEx);
            }
            return(retResult);
        }
Example #9
0
        public Result <ICollection <LineDto> > Fetch(ICollection <Guid> ids)
        {
            Result <ICollection <LineDto> > retResult = Result <ICollection <LineDto> > .Undefined(null);

            try
            {
                Common.CommonHelper.CheckAuthentication();

                var dtos = FetchImpl(ids);
                retResult = Result <ICollection <LineDto> > .Success(dtos);
            }
            catch (Exception ex)
            {
                var wrappedEx = new Exceptions.FetchFailedException(ex);
                retResult = Result <ICollection <LineDto> > .FailureWithInfo(null, wrappedEx);
            }
            return(retResult);
        }
        /// <summary>
        /// Fetches all beliefs related to the phrase identified by the given phraseId.
        /// </summary>
        /// <param name="phraseId"></param>
        /// <param name="signatureDummy"></param>
        /// <returns></returns>
        public Result<ICollection<PhraseBeliefDto>> FetchAllRelatedToPhrase(Guid phraseId)
        {
            Result<ICollection<PhraseBeliefDto>> retResult =
            Result<ICollection<PhraseBeliefDto>>.Undefined(null);
              try
              {
            Common.CommonHelper.CheckAuthentication();

            var beliefDtosRelatedToPhrase = FetchAllRelatedToPhraseImpl(phraseId);
            retResult = Result<ICollection<PhraseBeliefDto>>.Success(beliefDtosRelatedToPhrase);
              }
              catch (Exception ex)
              {
            var wrappedEx = new Exceptions.FetchFailedException(ex);
            retResult = Result<ICollection<PhraseBeliefDto>>.FailureWithInfo(null, wrappedEx);
              }
              return retResult;
        }
Example #11
0
        /// <summary>
        /// Fetches all beliefs related to the phrase identified by the given phraseId.
        /// </summary>
        /// <param name="phraseId"></param>
        /// <param name="signatureDummy"></param>
        /// <returns></returns>
        public Result <ICollection <PhraseBeliefDto> > FetchAllRelatedToPhrase(Guid phraseId)
        {
            Result <ICollection <PhraseBeliefDto> > retResult =
                Result <ICollection <PhraseBeliefDto> > .Undefined(null);

            try
            {
                Common.CommonHelper.CheckAuthentication();

                var beliefDtosRelatedToPhrase = FetchAllRelatedToPhraseImpl(phraseId);
                retResult = Result <ICollection <PhraseBeliefDto> > .Success(beliefDtosRelatedToPhrase);
            }
            catch (Exception ex)
            {
                var wrappedEx = new Exceptions.FetchFailedException(ex);
                retResult = Result <ICollection <PhraseBeliefDto> > .FailureWithInfo(null, wrappedEx);
            }
            return(retResult);
        }
        public Result<bool> StudyDataExistsForCurrentUser()
        {
            Result<bool> retResult = Result<bool>.Undefined(false);
              try
              {
            Common.CommonHelper.CheckAuthentication();

            var dto = StudyDataExistsForCurrentUserImpl();
            retResult = Result<bool>.Success(dto);
              }
              catch (Exception ex)
              {
            var wrappedEx = new Exceptions.FetchFailedException(ex);
            retResult = Result<bool>.FailureWithInfo(false, wrappedEx);
              }
              return retResult;
        }