public MainWindow() { InitializeComponent(); englishContext = new EnglishContext(); ShowVerbs.Click += (s, e) => { ShowList_Click(englishContext.Verbs); }; ShowPronouns.Click += (s, e) => { ShowList_Click(englishContext.Pronouns); }; LearnFirstSheme.Click += LearnFirstSheme_Click; LearnVerbs.Click += LearnVerbs_Click; LearnPronouns.Click += LearnPronouns_Click; //Priz(); }
public LearnFirstScheme(EnglishContext englishContext) { InitializeComponent(); this.englishContext = englishContext; SelectAllWordWhatsNotLearned(); Next.Click += (s, e) => { Next_Click(); };; Helped.Click += (s, e) => { Helped_Click(); }; Answer.Click += (s, e) => { Answer_Click(); }; KeyDown += LearnFirstScheme_KeyDown; Fall.Click += (s, e) => { Fall_Click(); }; }
public static void SetupDatabase(EnglishContext db) { db.Database.EnsureCreated(); if (db.Users.Count() == 0) { db.Users.Add(new Users() { Name = "user01" }); } var q = new[] { 1, 2, 3 }; var qaList = new[] { new { Q = "Hello World", A = "Olá Mundo" }, new { Q = "How old are you?", A = "Quantos anos você tem?" }, new { Q = "What is your name?", A = "Qual é o seu nome?" } }; if (db.Phrases.Count() == 0) { foreach (var qa in qaList) { var phrase = new Phrases() { Text = qa.Q }; var translation = new Translations() { Text = qa.A, Phrase = phrase }; db.Translations.Add(translation); db.SaveChanges(); } } db.SaveChanges(); }
public BaseRepository(EnglishContext context) { _context = context; }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory, IAnkiServices anki, EnglishContext db) { SetupDatabase(db); loggerFactory.AddConsole(Configuration.GetSection("Logging")); loggerFactory.AddDebug(); app.UseDefaultFiles(); // Test Environment if (env.IsEnvironment("Test")) { app.UseStaticFiles(new StaticFileOptions() { FileProvider = new PhysicalFileProvider( Path.Combine(Directory.GetCurrentDirectory(), @"wwwroot\tests")), RequestPath = new PathString("") }); } app.UseStaticFiles(); app.UseSwagger(); app.UseSwaggerUI(c => { c.SwaggerEndpoint("/swagger/v1/swagger.json", "EnglishPhrases v1"); }); app.UseMvc(); }
public UserRepository(EnglishContext context) : base(context) { }
public ResetController(EnglishContext db) { this._db = db; }
public DictionaryRepository(EnglishContext context) : base(context) { }
public PhrasesController(EnglishContext db) { this._db = db; }
public SubsectionRepository(EnglishContext context) : base(context) { }
public AnkiServices(EnglishContext db) { this._db = db; }
public SectionRepositoryTests(EnglishContext context) { _context = context; }
public ValuesController(EnglishContext db) { this._db = db; }
public DictionaryWordRepository(EnglishContext context) { _context = context; }
public ExerciseRepository(EnglishContext context) : base(context) { _context = context; }
public AnswerRepository(EnglishContext context) : base(context) { _context = context; }
public WordRepository(EnglishContext context) : base(context) { }
public RepositoryManager(EnglishContext context) { _context = context; }
public EnglishItemsController(EnglishContext context) { _context = context; }