Exemplo n.º 1
0
 public List<CustomerInfo> GetCustomers()
 {
     using (var context = new TestApp_DbEntities())
     {
         var customers = context.Customers.Select(c => c).ToList().Select(c => new CustomerInfo(c.Id, c.Name, c.Address)).ToList();
         return customers;
     }
 }
Exemplo n.º 2
0
 public List<OrderInfo> GetCustomerOrders(string name)
 {
     using (var context = new TestApp_DbEntities())
     {
         var orders = context.Orders.Where(o => o.Customer.Name == name).Select(o => o).ToList().Select(o => new OrderInfo(o.Id, o.Date, o.Amount, o.Description)).ToList();
         return orders;
     }
 }