예제 #1
0
 public List <PR0200> Reads(Expression <Func <PR0200, bool> > predicate)
 {
     using (var context = new ProductRepresentContext())
     {
         return
             (context.PR0200s.Where(predicate).ToList());
     }
 }
예제 #2
0
 public List <PR0200> Reads()
 {
     using (var context = new ProductRepresentContext())
     {
         return
             (context.PR0200s.ToList());
     }
 }
예제 #3
0
 public PR0200 Read(Expression <Func <PR0200, bool> > predicate)
 {
     using (var context = new ProductRepresentContext())
     {
         return
             (context.PR0200s.FirstOrDefault(predicate));
     }
 }
예제 #4
0
 public bool Exist(Expression <Func <PR0200, bool> > predicate)
 {
     using (var context = new ProductRepresentContext())
     {
         return
             (context.PR0200s.Any(predicate));
     }
 }
예제 #5
0
        public bool Delete(PR0200 entity)
        {
            using (var context = new ProductRepresentContext())
            {
                context.PR0200s.Remove(entity);

                return
                    (context.SaveChanges() == 1);
            }
        }
        public bool Create(PR0100 entity)
        {
            using (var context = new ProductRepresentContext())
            {
                context.PR0100s.Add(entity);

                return
                    (context.SaveChanges() == 1);
            }
        }
예제 #7
0
        public bool Update(Expression <Func <PR0200, bool> > predicate)
        {
            using (var context = new ProductRepresentContext())
            {
                context.PR0200s
                .UpdateRange(context.PR0200s
                             .Where(predicate));

                return
                    (context.SaveChanges() == 1);
            }
        }