Exemplo n.º 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());
     }
 }
Exemplo n.º 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());
     }
 }
Exemplo n.º 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)
     }
 }
Exemplo n.º 4
0
 public Brand Get(Expression <Func <Brand, bool> > filter)
 {
     using (ReCapDbContext context = new ReCapDbContext())
     {
         return(context.Set <Brand>().SingleOrDefault(filter));
     }
 }
Exemplo n.º 5
0
 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());
     }
 }
Exemplo n.º 6
0
 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));
     }
 }