public QueryController(IFilterQuery query, IAppUser user, ICourseQuery courseQuery, IMapper mapper, IUnitOfWork <CPDbContext> unitOfWork, IPermission pm) : base(user, mapper) { _query = query; _courseQuery = courseQuery; _unitOfWrok = unitOfWork; _pm = pm; }
private void AddFilterToFilterRules(IFilterQuery query) { ULSQuery ulsQuery = (ULSQuery)query; CheckExistingFilter(ulsQuery.FilterName); _filterRules.Add(ulsQuery.FilterName, new TemplateFilter(query)); }
public void GetStream_AnonymousData_ExceptionPropagated( [Frozen] Mock<IListener> listner, IFilterQuery query, Streaming sut) { //Arrange listner.Setup(a => a.Listen(It.IsAny<Func<HttpRequestMessage>>(), It.IsAny<Action<string>>())) .Throws<WebException>(); Exception propagatedException = null; //Act var observable = sut.GetStream(query); observable.Subscribe(a => { }, ex => propagatedException = ex); //Assert propagatedException.Should().NotBeNull(); propagatedException.Should().BeOfType<WebException>(); }
public void GetStream_AnonymousData_CorrectObservable( [Frozen] Mock<IListener> listner, IFilterQuery query, Streaming sut, HttpRequestMessage request, List<string> data) { listner.Setup(a => a.Listen(It.IsAny<Func<HttpRequestMessage>>(), It.IsAny<Action<string>>())) .Returns((Func<HttpRequestMessage> requestProvider, Action<string> processRequest) => { data.ForEach(processRequest); return new Task(() => { }); }); var observable = sut.GetStream(query); var resultData = new List<string>(); observable.Subscribe(a => resultData.Add(a)); resultData.ShouldAllBeEquivalentTo(data); }
public FilterStreamQueryBuilder(IFilterQuery filterQuery) { if (filterQuery == null) throw new ArgumentNullException("filterQuery"); _filterQuery = filterQuery; }
/// <summary> /// Create new instance of <see cref="FilterAndPageQuery"/> /// </summary> /// <param name="filterQuery">Filter query.</param> /// <param name="pageQuery">Page query.</param> public FilterAndPageQuery(IFilterQuery filterQuery, IPageQuery pageQuery) : base(new IQuery[] { filterQuery, pageQuery }) { }
public TemplateFilter(IFilterQuery query) { SetQueryObject(query); }
public FilterRepository(IFilterCommand filterCommand, IFilterQuery filterQuery) { _filterCommand = filterCommand; _filterQuery = filterQuery; }
public void SetQueryObject(IFilterQuery query) { Query = query; }
public static IQueryable <T> Where <T>(this IQueryable <T> query, IFilterQuery <T> args) { query = (args.Predicate != null) ? query.Where(args.Predicate) : query; return(query); }