示例#1
0
 public virtual SpecificationBase <T> AddInclude(string includeString)
 {
     if (IncludeStrings == null)
     {
         IncludeStrings = new List <string>();
     }
     IncludeStrings.Add(includeString);
     return(this);
 }
示例#2
0
        public AndSpecification(ISpecification <T> left, ISpecification <T> right)
        {
            _right = right;
            _left  = left;
            foreach (var inc in _right.Includes)
            {
                Includes.Add(inc);
            }
            foreach (var inc in _left.Includes)
            {
                Includes.Add(inc);
            }
            foreach (var incStr in _right.IncludeStrings)
            {
                IncludeStrings.Add(incStr);
            }
            foreach (var incStr in _left.IncludeStrings)
            {
                IncludeStrings.Add(incStr);
            }
            if (left.Sort != null)
            {
                if (right.Sort != null)
                {
                    Sort = items => right.Sort(left.Sort(items));
                }
                else
                {
                    Sort = items => left.Sort(items);
                }
            }
            else if (right.Sort != null)
            {
                Sort = items => right.Sort(items);
            }

            if (left.PostProcess != null)
            {
                if (right.PostProcess != null)
                {
                    PostProcess = items => right.PostProcess(left.PostProcess(items));
                }
                else
                {
                    PostProcess = items => left.PostProcess(items);
                }
            }
            else if (right.PostProcess != null)
            {
                PostProcess = items => right.PostProcess(items);
            }

            Criteria = ToExpression();
        }
示例#3
0
 protected virtual void AddInclude(string includeString)
 {
     IncludeStrings.Add(includeString);
 }
示例#4
0
 /// <summary>
 /// Thêm dữ liệu lấy ra dựa vào tree string
 /// </summary>
 /// <param name="includeString">Chuỗi string cần include</param>
 public virtual void AddInclude(string includeString)
 {
     IncludeStrings.Add(includeString);
 }
示例#5
0
 public Specification <T> AddInclude(string includeString)
 {
     IncludeStrings.Add(includeString);
     return(this);
 }
示例#6
0
 public void AddInclude(string spec)
 {
     IncludeStrings ??= new List <string>();
     IncludeStrings.Add(spec);
 }
示例#7
0
 // string-based includes allow for including children of children, e.g. Basket.Items.Product
 protected virtual void AddInclude(params string[] includeString)
 {
     IncludeStrings.Add(string.Join(".", includeString));
 }