Ejemplo n.º 1
0
        protected List <FilterDefinition <Entities.Permit> > BuildFilters(Models.Permit.Condition condition)
        {
            var list = new List <FilterDefinition <Entities.Permit> >();

            if (condition == null)
            {
                return(list);
            }
            if (!String.IsNullOrWhiteSpace(condition.Name))
            {
                list.Add(Builders <Entities.Permit> .Filter.Regex(nameof(Entities.Permit.Name), Helper.FormatQueryString(condition.Name)));
            }
            if (!String.IsNullOrWhiteSpace(condition.ID))
            {
                list.Add(Builders <Entities.Permit> .Filter.Regex(nameof(Entities.Permit.ID), Helper.FormatQueryString(condition.ID)));
            }
            return(list);
        }
Ejemplo n.º 2
0
 protected FilterDefinition <Entities.Permit> BuildFilter(Models.Permit.Condition condition)
 {
     return(this.BuildFilter(this.BuildFilters(condition)));
 }