Esempio n. 1
0
        public async Task <IEnumerable <MoodDTO> > Handle(GetMoodsQuery request, CancellationToken cancellationToken)
        {
            var moods = await _moodRepository.GetAllAsync();

            return(moods.Select(x => new MoodDTO {
                Id = x.Id,
                Name = x.Name
            }));
        }
Esempio n. 2
0
 public Task <IEnumerable <MoodDTO> > Handle(GetMoodsQuery query, CancellationToken cancellationToken)
 {
     return(_sqlConnection.QueryAsync <MoodDTO>("[Workout].[sp_Mood_GetAll]", commandType: CommandType.StoredProcedure));
 }