예제 #1
0
 public T Get(int ID)
 {
     using (_context = new FinalExameDbContext())
     {
         return(_context.Set <T>().Find(ID));
     }
 }
예제 #2
0
        public void Update(params T[] items)
        {
            using (_context = new FinalExameDbContext())
            {
                foreach (var item in items)
                {
                    _context.Entry <T>(item).State = EntityState.Modified;
                }

                _context.SaveChanges();
            }
        }