Пример #1
0
        public bool Create(Info info)
        {
            try
            {
                context = new StudentDBEntities();
                context.Infoes.Add(info);
                context.SaveChanges();
                return true;
            }
            catch (Exception)
            {

                return false;
            }
        }
Пример #2
0
 public bool Update(Info info)
 {
     context = new StudentDBEntities();
     try
     {
         Info change = context.Infoes.Where(c => c.Name == info.Name).ToList().FirstOrDefault();
         if (change != null)
             change = info;
         context.SaveChanges();
         return true;
     }
     catch (Exception)
     {
         return false;       
     }
 }
Пример #3
0
 public List<Info> Retrieve()
 {
     context = new StudentDBEntities();
     return context.Infoes.ToList();
 }