Ejemplo n.º 1
0
 public Customer GetById(Guid id)
 {
     using (var context = new RepositoryContext())
     {
         IQueryable<Customer> query = context.Set<Customer>().Include("Transactions");
         return query.First(x => x.CustomerID == id);
     }
 }
Ejemplo n.º 2
0
 public Customer GetByName(string name, string surname)
 {
     using (var context = new RepositoryContext())
     {
         IQueryable<Customer> query = context.Set<Customer>().Include("Transactions");
         return query.First(x => x.Name == name && x.Surmame==surname);
     }
 }
Ejemplo n.º 3
0
 public IEnumerable<Customer> GetAll()
 {
     using (var context = new RepositoryContext())
     {
         IQueryable<Customer> query= context.Set<Customer>().Include("Transactions");
         return query.ToList();
     }
 }