Beispiel #1
0
        public async Task <Result <IReadOnlyList <InterestDTO> > > GetInterests()
        {
            var interests = await _interestRepository.GetAllInterests();

            if (!interests.IsSuccessed)
            {
                return(Result.Fail <IReadOnlyList <InterestDTO> >(interests.GetErrorString()));
            }
            var list = _mapper.Map <IReadOnlyList <InterestDTO> >(interests.Value);

            return(Result.Ok(list));
        }