예제 #1
0
        /// <summary>
        /// Gets all beliefs about a given phrase, using phrase.Id
        /// </summary>
        public static async Task <PhraseBeliefList> GetBeliefsAboutPhraseAsync(Guid phraseId)
        {
            var criteria = new Criteria.PhraseIdCriteria(phraseId);
            var result   = await DataPortal.FetchAsync <PhraseBeliefList>(criteria);

            return(result);
        }
예제 #2
0
        public void Child_Fetch(Criteria.PhraseIdCriteria phraseIdCriteria)
        {
            using (var dalManager = DalFactory.GetDalManager())
            {
                var beliefDal = dalManager.GetProvider <IPhraseBeliefDal>();

                var phraseId = phraseIdCriteria.PhraseId;
                Result <ICollection <PhraseBeliefDto> > result = beliefDal.FetchAllRelatedToPhrase(phraseId);
                if (!result.IsSuccess || result.IsError)
                {
                    if (result.Info != null)
                    {
                        var ex = result.GetExceptionFromInfo();
                        if (ex != null)
                        {
                            throw new FetchFailedException(ex.Message);
                        }
                        else
                        {
                            throw new FetchFailedException();
                        }
                    }
                    else
                    {
                        throw new FetchFailedException();
                    }
                }

                //RESULT WAS SUCCESSFUL
                var fetchedPhraseBeliefDtos = result.Obj;
                LoadDtos(fetchedPhraseBeliefDtos);
            }
        }