コード例 #1
0
 public List <Brand> GetAll(Expression <Func <Brand, bool> > filter = null)
 {
     using (CarContext context = new CarContext())
     {
         return(filter == null?context.Set <Brand>().ToList() : context.Set <Brand>().Where(filter).ToList());
     }
 }
コード例 #2
0
ファイル: EfBrandDal.cs プロジェクト: mertdnmz7/ReCapProject
 public List <Brand> GetAll(Expression <Func <Brand, bool> > filter = null)
 {
     using (CarContext context = new CarContext())
     {
         //select*from product döndürüyor alttaki kod ve listeye çeviriyor
         return(filter == null?context.Set <Brand>().ToList()
                    : context.Set <Brand>().Where(filter).ToList());
     }
 }
コード例 #3
0
 public List <Car> GetCarsByColorId(Expression <Func <Car, bool> > filter = null)
 {
     using (CarContext context = new CarContext())
     {
         return(filter == null
            ? context.Set <Car>().ToList()
            : context.Set <Car>().Where(filter).ToList());
     }
 }
コード例 #4
0
 public Car Get(Expression <Func <Car, bool> > filter)
 {
     using (CarContext context = new CarContext())
     {
         return(filter == null
             ? context.Set <Car>().ToList()
             : context.Set <Car>().Where(filter).ToList());
     }
 }
コード例 #5
0
ファイル: EfBrandDal.cs プロジェクト: mertdnmz7/ReCapProject
 public Brand Get(Expression <Func <Brand, bool> > filter)
 {
     using (CarContext context = new CarContext())
     {
         return(context.Set <Brand>().SingleOrDefault(filter));
     }
 }
コード例 #6
0
ファイル: EfColorDal.cs プロジェクト: alibhs/ReCapProject
 public Color Get(Expression <Func <Color, bool> > filter)
 {
     using (CarContext context = new CarContext())
     {
         return(context.Set <Color>().SingleOrDefault(filter));
     }
 }