示例#1
0
        public void Samples(ICritterClient client)
        {
            // TODO: It's probably best to use a single domain model across the entire documentation.
            var weapons =
// SAMPLE: client-linq-simple-query-structure
                client.Weapons
                .Query()
                .Where(x => x.Price > 100.0m /* any number of where expressions */)
                .Select(x => x.Model /* any number of select expressions */)
                .Where(x => x.Name.StartsWith("NERF") /* where and select expressions can be mixed */)
                .OrderBy(x => x.Name /* ordering must come after where and select */)
                .Skip(50 /* skip after order by */)
                .Take(50 /* take after skip */)
                .ToList();

// ENDSAMPLE
// SAMPLE: client-linq-aggregate-query-structure
            client.Weapons
            .Query()
            .Where(x => x.Price > 100.0m /* any number of where expressions */)
            .GroupBy(x => x.Model.Name /* group by after where */)
            .Select(x => new { modelName = x.Key, totalPrice = x.Sum(y => y.Price) })
            .OrderBy(x => x.totalPrice)
            .ToList();
// ENDSAMPLE
        }
示例#2
0
        public void Samples(ICritterClient client)
        {
            // TODO: It's probably best to use a single domain model across the entire documentation.
            var weapons =
// SAMPLE: client-linq-simple-query-structure
client.Weapons
      .Query()
      .Where(x => x.Price > 100.0m /* any number of where expressions */)
      .Select(x => x.Model /* any number of select expressions */)
      .Where(x => x.Name.StartsWith("NERF") /* where and select expressions can be mixed */)
      .OrderBy(x => x.Name /* ordering must come after where and select */)
      .Skip(50 /* skip after order by */)
      .Take(50 /* take after skip */)
      .ToList();
// ENDSAMPLE
// SAMPLE: client-linq-aggregate-query-structure
client.Weapons
        .Query()
        .Where(x => x.Price > 100.0m /* any number of where expressions */)
        .GroupBy(x => x.Model.Name /* group by after where */)
        .Select(x => new { modelName = x.Key, totalPrice = x.Sum(y => y.Price) })
        .OrderBy(x => x.totalPrice)
        .ToList();
// ENDSAMPLE
        }
示例#3
0
 public void SetUp()
 {
     this.testClient = TestableClientGenerator.CreateClient<ICritterClient>();
     this.mockControl = (TestableClientProxyBase)this.testClient;
 }
示例#4
0
 public void SetUp()
 {
     this.testClient  = TestableClientGenerator.CreateClient <ICritterClient>();
     this.mockControl = (TestableClientProxyBase)this.testClient;
 }