Exemple #1
0
 public List <Car> GetAll(Expression <Func <Car, bool> > filter = null)
 {
     using (ReCapDbContext context = new ReCapDbContext())
     {//filtre vermemişsek 1. adım filtre vermişsek 2. adım yani where şartı ile belirttiğimiz filtre dönecektir.
         return(filter == null?context.Set <Car>().ToList() : context.Set <Car>().Where(filter).ToList());
     }
 }
Exemple #2
0
 public List <Brand> GetAll(Expression <Func <Brand, bool> > filter = null)
 {
     using (ReCapDbContext context = new ReCapDbContext())
     {
         return(filter == null?context.Set <Brand>().ToList() : context.Set <Brand>().Where(filter).ToList());
     }
 }
Exemple #3
0
 public Car Get(Expression <Func <Car, bool> > filter)
 {
     using (ReCapDbContext context = new ReCapDbContext())
     {
         return(context.Set <Car>().SingleOrDefault(filter)); // Tek veri dönecektir.(SingleOrDefault)
     }
 }
Exemple #4
0
 public Brand Get(Expression <Func <Brand, bool> > filter)
 {
     using (ReCapDbContext context = new ReCapDbContext())
     {
         return(context.Set <Brand>().SingleOrDefault(filter));
     }
 }
 public List <Entities.Concrete.Color> GetAll(Expression <Func <Entities.Concrete.Color, bool> > filter = null)
 {
     using (ReCapDbContext context = new ReCapDbContext())
     {
         return(filter == null?context.Set <Entities.Concrete.Color>().ToList() : context.Set <Entities.Concrete.Color>().Where(filter).ToList());
     }
 }
 public Entities.Concrete.Color Get(Expression <Func <Entities.Concrete.Color, bool> > filter)
 {
     using (ReCapDbContext context = new ReCapDbContext())
     {
         return(context.Set <Entities.Concrete.Color>().SingleOrDefault(filter));
     }
 }