public void Add(Selectcourse selectcourse) { using (var context = new coursecontrolContext()) { context.Selectcourse.Add(selectcourse); context.SaveChanges(); } }
public Selectcourse Query(int stuid)// { Selectcourse selectcourse = null; using (var context = new coursecontrolContext()) { var test = context.Selectcourse.ToList(); foreach (var item in test) { } //selectcourse = context.Selectcourse.FirstOrDefault(x => x.StudentId == stuid); context.SaveChanges(); } return(selectcourse); }