public async Task <IEnumerable <PendingCoursesDto> > GetNewCourses([FromQuery] CoursesRequest model
                                                                           , CancellationToken token)
        {
            var query = new CoursesQuery(model.Language, model.State.GetValueOrDefault(ItemState.Pending),
                                         User.GetCountryClaim(),
                                         model.Filter);
            var retVal = await _queryBus.QueryAsync(query, token);

            return(retVal);
        }
Example #2
0
        public async Task AdminCoursesQuery_Ok(string language, ItemState state, string country, string filter)
        {
            var query  = new CoursesQuery(language, state, country, filter);
            var result = await _fixture.QueryBus.QueryAsync(query, default);


            //check distinct
            var v = from c in result
                    group c by c.Name
                    into grp
                    where grp.Count() > 1
                    select grp.Key;

            v.Should().BeEmpty();
        }