示例#1
0
 public bool Update(Topic entity)
 {
     try
     {
         var topic = db.Topics.Find(entity.ID);
         topic.Name = entity.Name;
         db.SaveChanges();
         return(true);
     }
     catch (Exception ex)
     {
         return(false);
     }
 }
示例#2
0
 public long Insert(Role entity)
 {
     db.Roles.Add(entity);
     db.SaveChanges();
     return(entity.ID);
 }
示例#3
0
 public long Insert(CourseCategory entity)
 {
     db.CourseCategories.Add(entity);
     db.SaveChanges();
     return(entity.ID);
 }
示例#4
0
 public long Insert(Enrollment entity)
 {
     db.Enrollments.Add(entity);
     db.SaveChanges();
     return(entity.ID);
 }
示例#5
0
 public long Insert(User entity)
 {
     db.Users.Add(entity);
     db.SaveChanges();
     return(entity.ID);
 }