public Customer GetById(int id)
 {
     using (var db = new WebContextDb())
     {
         return(db.Customer.FirstOrDefault(p => p.Id == id));
     }
 }
Exemple #2
0
 public List <T> GetList()
 {
     using (var db = new WebContextDb())
     {
         return(db.Set <T>().ToList());
     }
 }
 public Customer GetCompletePersonById(int id)
 {
     using (var db = new WebContextDb())
     {
         return(db.Customer
                .Include(p => p.Id)
                .FirstOrDefault(p => p.Id == id));
     }
 }
 public List <Customer> GetListBySize(int size)
 {
     using (var db = new WebContextDb())
     {
         return(db.Customer
                .OrderByDescending(p => p.Order)
                .Take(size).ToList());
     }
 }
Exemple #5
0
 public BaseRepositorio(WebContextDb @object)
 {
     this.@object = @object;
 }
Exemple #6
0
 public BaseRepositorio()
 {
     db = new Repositorio.WebContextDb();
 }