private void Accept() { using (var context = new BestDbContext()) { var x = context.Contests.Where(d => d.Id == Contest.Id).FirstOrDefault(); x.GradeId = Contest.GradeId; context.Contests.Update(x); context.SaveChanges(); } applicationsViewModel.IsOpen = false; }
private CompetitionViewModel() { context = new BestDbContext(); Competition = new Competition() { BreakTimes = new ObservableCollection <BreakTime>() }; SaveCommand = new RelayCommand(Save); BackCommand = new RelayCommand(Back); }
public GradeDialogViewModel(Contest contest, ApplicationsViewModel applicationsViewModel) { this.applicationsViewModel = applicationsViewModel; Contest = contest; using (var context = new BestDbContext()) { Grades = context.Grades.ToList(); } AcceptCommand = new RelayCommand(Accept); }
public DefaultController(BestDbContext context) { this.context = context; }