/// <summary> /// Wird beim Starten der Anwendung aufgerufen. /// </summary> /// <param name="sender">Wird ignoriert.</param> /// <param name="e">Die Befehlszeilenparameter.</param> private void Application_Startup(object sender, StartupEventArgs e) { // Check settings var version = Assembly.GetExecutingAssembly().GetName().Version.ToString(); if (!version.Equals(RC_Learner.Properties.Settings.Default.Version)) { // Upgrade RC_Learner.Properties.Settings.Default.Upgrade(); RC_Learner.Properties.Settings.Default.Version = version; RC_Learner.Properties.Settings.Default.Save(); } // Apply language UserProfile.ApplyLanguage(); // Check parameters if (e.Args.Length != 1) { Shutdown(); } else { LearnContext = LearnContext.Create(e.Args[0], null); } }
public AccountController( UserManager <ApplicationUser> userManager, SignInManager <ApplicationUser> signInManager, IEmailSender emailSender, ILogger <AccountController> logger, LearnContext db, RoleManager <IdentityRole> roleManager) { _userManager = userManager; _signInManager = signInManager; _emailSender = emailSender; _logger = logger; _db = db; _roleManager = roleManager; }
protected override void Seed(LearnContext context) { // This method will be called after migrating to the latest version. // You can use the DbSet<T>.AddOrUpdate() helper extension method // to avoid creating duplicate seed data. E.g. // // context.People.AddOrUpdate( // p => p.FullName, // new Person { FullName = "Andrew Peters" }, // new Person { FullName = "Brice Lambson" }, // new Person { FullName = "Rowan Miller" } // ); // }
public static void Initializer(LearnContext context) { context.Database.EnsureCreated(); //check for videos if (context.Videos.Any()) { return; //db seeded } var vid = new[] { new Video { VideoName = "Introduction to python.", VideoUrl = "zpOULjyy-n8" } }; foreach (var v in vid) { context.Videos.Add(v); } context.SaveChanges(); }
public HomeController(LearnContext _context) { context = _context; }
public SectionController(LearnContext _context) { context = _context; }
public HomeController(LearnContext context) { _context = context; }
public ImageController(LearnContext learnContext) { context = learnContext; }
public VideoController(LearnContext _context) { context = _context; }
public CourseController(LearnContext _context) { context = _context; }