Ejemplo n.º 1
0
        public void Test()
        {
            var q = new Includer <Order>();

            q.Include(o => o.Customer).ThenInclude(c => c.Region)
            .Include(o => o.Customer.Region).ThenInclude(r => r.Name)     //无效
            .Include(o => o.Customer.Level)
            .Include(o => o.Customer).ThenInclude(c => c.Region.Name)
            .Include(o => o.Details).ThenInclude(d => d.Product)
            .Include(o => o.Details[0].Product)     //无效
            .Include(o => o.Details).ThenInclude(d => d.Product.Name)
            .Include(o => o.Details).ThenInclude(d => d.Product.Category.Name)
            ;
        }
Ejemplo n.º 2
0
 // select is prior to include
 private static void processIncluder(Includer includer)
 {
     if (strUtil.IsNullOrEmpty(includer.SelectedProperty))
     {
         return;
     }
     if (includer.SelectedProperty.Equals("*"))
     {
         includer.IncludeAll();
     }
     else
     {
         includer.Include(SqlBuilder.GetIncludeProperty(includer.SelectedProperty));
     }
 }
Ejemplo n.º 3
0
 // select is prior to include
 private static void processIncluder( Includer includer )
 {
     if (strUtil.IsNullOrEmpty( includer.SelectedProperty )) return;
     if (includer.SelectedProperty.Equals( "*" ))
         includer.IncludeAll();
     else
         includer.Include( SqlBuilder.GetIncludeProperty( includer.SelectedProperty ) );
 }