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 })); }
public Task <IEnumerable <MoodDTO> > Handle(GetMoodsQuery query, CancellationToken cancellationToken) { return(_sqlConnection.QueryAsync <MoodDTO>("[Workout].[sp_Mood_GetAll]", commandType: CommandType.StoredProcedure)); }