예제 #1
0
        /// <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);
            }
        }
예제 #2
0
 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;
 }
예제 #3
0
        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" }
            //    );
            //
        }
예제 #4
0
        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();
        }
예제 #5
0
 public HomeController(LearnContext _context)
 {
     context = _context;
 }
예제 #6
0
 public SectionController(LearnContext _context)
 {
     context = _context;
 }
예제 #7
0
 public HomeController(LearnContext context)
 {
     _context = context;
 }
예제 #8
0
 public ImageController(LearnContext learnContext)
 {
     context = learnContext;
 }
예제 #9
0
 public VideoController(LearnContext _context)
 {
     context = _context;
 }
예제 #10
0
 public CourseController(LearnContext _context)
 {
     context = _context;
 }