public LoginForm() { context = new MyContext(); InitializeComponent(); DbSeeder.SeedAll(context); }
private void MainForm_Load(object sender, EventArgs e) { DbSeeder.SeedAll(_context); var filters = GetFilterNameModels(); FillCheckedList(filters); }
public MainForm() { //LoginForm login_dlg = new LoginForm(); //if (login_dlg.ShowDialog() == DialogResult.OK) //{ isAuth = true; _context = new MyContext(); DbSeeder.SeedAll(_context); var info = _context.Sessions .Where(x => x.UserId == 1) .Select(x => new { Name = x.User.LastName + " " + x.User.FirstName, Begin = x.Begin, End = x.End, Mark = x.Marks, Quesions = x.Results.Select(y => new { Text = y.Answer.Question.Text, isTrue = y.Answer.IsTrue }) }).ToList(); //} InitializeComponent(); }
private void MainForm_Load(object sender, EventArgs e) { this._context = new EFContext(); DbSeeder.SeedAll(_context); var elements = this._context.Categories.Where(x => x.IsCore); List <CategoryNodeModel> models = RecursAddTree(elements.ToList()); foreach (var item in ShowAllInTreeView(models)) { this.tvMain.Nodes.Add(item); } }
public static void Main(string[] args) { IWebHost host = BuildWebHost(args); using (IServiceScope scope = host.Services.CreateScope()) { IServiceProvider services = scope.ServiceProvider; try { AppDbContext context = services.GetRequiredService <AppDbContext>(); DbSeeder.SeedAll(context); } catch (Exception ex) { ILogger <Program> logger = services.GetRequiredService <ILogger <Program> >(); logger.LogError(ex, "An error occurred while seeding the database"); } } host.Run(); }
private void MainForm_Load(object sender, EventArgs e) { DbSeeder.SeedAll(this._context); FillParentsTreeView(); }
private void Window_Loaded(object sender, RoutedEventArgs e) { DbSeeder.SeedAll(_context); ReloadProject(); }