当前位置: 首页>>代码示例>>C#>>正文


C# EntityQuery.ExecuteLocally方法代码示例

本文整理汇总了C#中EntityQuery.ExecuteLocally方法的典型用法代码示例。如果您正苦于以下问题:C# EntityQuery.ExecuteLocally方法的具体用法?C# EntityQuery.ExecuteLocally怎么用?C# EntityQuery.ExecuteLocally使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在EntityQuery的用法示例。


在下文中一共展示了EntityQuery.ExecuteLocally方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: WithOnlyExpand

 public async Task WithOnlyExpand() {
   var em1 = await TestFns.NewEm(_serviceName);
   var q = new EntityQuery<Customer>().Take(3);
   var r0 = await em1.ExecuteQuery(q);
   var q1 = new EntityQuery<Customer>().Expand("Orders");
   var r1 = q1.ExecuteLocally(em1);
   Assert.IsTrue(r0.Count() == r1.Count());
   
 }
开发者ID:Cosmin-Parvulescu,项目名称:Breeze,代码行数:9,代码来源:LocalQueryTests.cs

示例2: WithOnlyExpand

 public async Task WithOnlyExpand() {
   await _emTask;
   var q = new EntityQuery<Customer>().Take(3);
   var r0 = await _em1.ExecuteQuery(q);
   var q1 = new EntityQuery<Customer>().Expand("Orders");
   var r1 = q1.ExecuteLocally(_em1);
   Assert.IsTrue(r0.Count() == r1.Count());
   
 }
开发者ID:nbogale,项目名称:Breeze,代码行数:9,代码来源:LocalQueryTests.cs

示例3: SimpleQuery

    public async Task SimpleQuery() {
      var em1 = await TestFns.NewEm(_serviceName);
      var q = new EntityQuery<Customer>();

      var r0 = await em1.ExecuteQuery(q);

      Assert.IsTrue(r0.Cast<Object>().Count() > 0);
      var r1 = q.ExecuteLocally(em1);
      Assert.IsTrue(r0.Count() == r1.Count());
    }
开发者ID:Cosmin-Parvulescu,项目名称:Breeze,代码行数:10,代码来源:LocalQueryTests.cs

示例4: SimpleQuery

    public async Task SimpleQuery() {
      await _emTask;
      var q = new EntityQuery<Customer>();

      var r0 = await _em1.ExecuteQuery(q);

      Assert.IsTrue(r0.Cast<Object>().Count() > 0);
      var r1 = q.ExecuteLocally(_em1);
      Assert.IsTrue(r0.Count() == r1.Count());
    }
开发者ID:nbogale,项目名称:Breeze,代码行数:10,代码来源:LocalQueryTests.cs

示例5: GuidQuery2

    public async Task GuidQuery2() {
      var em1 = await TestFns.NewEm(_serviceName);

      var q = new EntityQuery<Customer>().Take(3);
      var r = await em1.ExecuteQuery(q);
      Assert.IsTrue(r.Count() == 3, "should be no results");
      
      var q1 = new EntityQuery<Order>().Where(o => o.CustomerID == Guid.NewGuid()); // && true);
      var r1 = q1.ExecuteLocally(em1);
      Assert.IsTrue(r1.Count() == 0);

    }
开发者ID:Cosmin-Parvulescu,项目名称:Breeze,代码行数:12,代码来源:LocalQueryTests.cs

示例6: AnonSelectEntity

    public async Task AnonSelectEntity() {
      var em1 = await TestFns.NewEm(_serviceName);
      var q = new EntityQuery<Order>().Take(5);
      var r0 = await q.Execute(em1);
      Assert.IsTrue(r0.Count() == 5);
      var q1 = new EntityQuery<Order>().Select(o => new { o.Customer }).Take(5);
      var r1 = await q1.Execute(em1);
      Assert.IsTrue(r1.Count() == 5);
      var ok = r1.All(r => r.Customer.GetType() == typeof(Customer));
      Assert.IsTrue(ok);

      // This only works because we insure that the order exists in cache before the query
      var r1Local = q1.ExecuteLocally(em1);
      
      Assert.IsTrue(r1Local.Count() == r1.Count());
      ok = r1Local.All(r => r.Customer.Orders.Count == 1);
      Assert.IsTrue(ok, "Order's per customer should be only one for now because that's all we cached");
      ok = r1Local.All(r => r.Customer.GetType() == typeof(Customer));
      Assert.IsTrue(ok );

    }
开发者ID:Cosmin-Parvulescu,项目名称:Breeze,代码行数:21,代码来源:LocalQueryTests.cs

示例7: GuidQuery

    public async Task GuidQuery() {
      await _emTask;

      var q = new EntityQuery<Customer>().Take(3);
      var r = await _em1.ExecuteQuery(q);
      Assert.IsTrue(r.Count() == 3, "should be no results");
      var q1 = new EntityQuery<Customer>().Where(c => c.CustomerID.Equals(Guid.NewGuid())); 
      var r1 = q1.ExecuteLocally(_em1);
      Assert.IsTrue(r1.Count() == 0);

    }
开发者ID:nbogale,项目名称:Breeze,代码行数:11,代码来源:LocalQueryTests.cs

示例8: WhereFnAdd

    public async Task WhereFnAdd() {
      var em1 = await TestFns.NewEm(_serviceName);

      var q0 = new EntityQuery<Employee>().Where(e => e.EmployeeID + e.ReportsToEmployeeID.Value > 3);
      var r0 = await q0.Execute(em1);
      Assert.IsTrue(r0.Count() > 0);
      Assert.IsTrue(r0.All(e => e.EmployeeID + e.ReportsToEmployeeID > 3));
      var r1 = q0.ExecuteLocally(em1);
      Assert.IsTrue(r1.Count() == r0.Count());
    }
开发者ID:novice3030,项目名称:breeze.sharp,代码行数:10,代码来源:QueryTests.cs

示例9: WhereFnMonth

    public async Task WhereFnMonth() {
      var em1 = await TestFns.NewEm(_serviceName);

      var q0 = new EntityQuery<Employee>().Where(e => e.HireDate.Value.Month > 6 && e.HireDate.Value.Month < 11);
      var r0 = await q0.Execute(em1);
      Assert.IsTrue(r0.Count() > 0);
      Assert.IsTrue(r0.All(e => e.HireDate.Value.Month > 6 && e.HireDate.Value.Month < 11));
      var r1 = q0.ExecuteLocally(em1);
      Assert.IsTrue(r1.Count() == r0.Count());
    }
开发者ID:novice3030,项目名称:breeze.sharp,代码行数:10,代码来源:QueryTests.cs

示例10: SimpleSelect

    public async Task SimpleSelect() {
      await _emTask;
      var q = new EntityQuery<Order>().Take(5);
      var r = await q.Execute(_em1);
      Assert.IsTrue(r.Count() == 5);
      var q1 = new EntityQuery<Order>().Select(o => o.Customer).Take(5);
      var r1 = await q1.Execute(_em1);
      Assert.IsTrue(r1.Count() == 5);
      var ok = r1.All(c => c.GetType() == typeof(Customer));
      Assert.IsTrue(ok);
      
      var r1Local = q1.ExecuteLocally(_em1);
      Assert.IsTrue(r1Local.Count() == r1.Count());
      ok = r1Local.All(c => c.GetType() == typeof(Customer));
      Assert.IsTrue(ok );

    }
开发者ID:BKlemm,项目名称:mean-seed,代码行数:17,代码来源:LocalQueryTests.cs

示例11: QueryWithAddFn

    public async Task QueryWithAddFn() {
      await _emTask;

      var q0 = new EntityQuery<Employee>().Where(e => e.EmployeeID + e.ReportsToEmployeeID.Value > 3);
      var r0 = await q0.Execute(_em1);
      Assert.IsTrue(r0.Count() > 0);
      Assert.IsTrue(r0.All(e => e.EmployeeID + e.ReportsToEmployeeID > 3));
      var r1 = q0.ExecuteLocally(_em1);
      Assert.IsTrue(r1.Count() == r0.Count());
    }
开发者ID:CodeLancer,项目名称:Breeze,代码行数:10,代码来源:QueryTests.cs

示例12: QueryWithMonthFn

    public async Task QueryWithMonthFn() {
      await _emTask;

      var q0 = new EntityQuery<Employee>().Where(e => e.HireDate.Value.Month > 6 && e.HireDate.Value.Month < 11);
      var r0 = await q0.Execute(_em1);
      Assert.IsTrue(r0.Count() > 0);
      Assert.IsTrue(r0.All(e => e.HireDate.Value.Month > 6 && e.HireDate.Value.Month < 11));
      var r1 = q0.ExecuteLocally(_em1);
      Assert.IsTrue(r1.Count() == r0.Count());
    }
开发者ID:CodeLancer,项目名称:Breeze,代码行数:10,代码来源:QueryTests.cs

示例13: QueryWithYearFn

    public async Task QueryWithYearFn() {
      await _emTask;

      var q0 = new EntityQuery<Employee>().Where(e => e.HireDate.Value.Year > 1993);
      var r0 = await q0.Execute(_em1);
      Assert.IsTrue(r0.Count() > 0);
      Assert.IsTrue(r0.All(r => r.HireDate.Value.Year > 1993));
      var r1 = q0.ExecuteLocally(_em1);
      Assert.IsTrue(r1.Count() == r0.Count());
    }
开发者ID:CodeLancer,项目名称:Breeze,代码行数:10,代码来源:QueryTests.cs


注:本文中的EntityQuery.ExecuteLocally方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。