Exemple #1
0
        public async Task <IActionResult> Get(int?userId = null, [FromQuery(Name = "specializationId[]")] List <SpecializationEnum> courseIds = null, string name = null, bool subscribed = false, bool nonSubscribed = false)
        {
            var specification = new CourseSpecification(userId, courseIds, name, subscribed, nonSubscribed);
            var result        = await _queryBus.ExecuteAsync(new CourseQuery(specification));

            var count = await _queryBus.ExecuteAsync(new CourseTotalQuery(specification));

            return(Ok(new PageableCollection <CourseQueryModel>()
            {
                Results = result, Total = count
            }));
        }
Exemple #2
0
 public CourseQuery(QueryOptions queryOptions, CourseSpecification specification)
 {
     QueryOptions  = queryOptions;
     Specification = specification;
 }
Exemple #3
0
 public CourseQuery(CourseSpecification specification)
 {
     Specification = specification;
 }