Exemplo n.º 1
0
 public List <Product> GetByName(string name)
 {
     using (var dbContext = new AdventureWorks2012Entities1())
     {
         return(dbContext.Products.Where(p => p.Name.Contains(name)).ToList());
     }
 }
Exemplo n.º 2
0
 public Product Get(int id)
 {
     using (var dbContext = new AdventureWorks2012Entities1())
     {
         return(dbContext.Products.Find(id));
     }
 }
 public IList <BindableRecord> Get()
 {
     using (AdventureWorks2012Entities1 ctx = new AdventureWorks2012Entities1())
     {
         return((from c in ctx.Customers
                 join o in ctx.Orders on c.Order equals o
                 join ct in ctx.CustomerTypes on c.CustomerType equals ct
                 select new BindableRecord()
         {
             CustomerObject = c, CustomerTypeObject = ct, OrderObject = o
         }).ToList());
     }
 }