Example #1
0
 public HV_Course Delete(HV_Course course)
 {
     using (var u = GetDb())
     {
         u.HV_Course.Attach(course);
         u.HV_Course.Remove(course);
         u.SaveChanges();
         return course;
     }
 }
Example #2
0
 public HV_Course Create(string name,int uniID)
 {
     using (var u = GetDb())
     {
         var course = new HV_Course() { Course_Name = name, Uni_Id = uniID };
         u.HV_Course.Add(course);
         u.SaveChanges();
         return course;
     }
 }