private WordschatzContext CreateContext() { var options = new DbContextOptionsBuilder <WordschatzContext>() .UseInMemoryDatabase(databaseName: "WordschatzDatabase") .Options; WordschatzContext context = new WordschatzContext(options); return(context); }
private void SeedDictionary(WordschatzContext context) { Dictionary[] dicts = new[] { new DictionaryBuilder().SetName("German") .SetDescription("German-English Dictionary") .Build(), new DictionaryBuilder().SetName("French") .SetDescription("French-English Dictionary") .Build(), new DictionaryBuilder().SetName("Russian") .SetDescription("Russian-English Dictionary") .Build(), new DictionaryBuilder().SetName("Polski") .SetDescription("Słownik języka polskiego") .Build() }; context.Dictionaries.AddRange(dicts); context.SaveChanges(); }
private void SeedTheme(WordschatzContext context) { Theme[] themes = new[] { new ThemeBuilder().SetName("Die Natur") .SetDictionary(context.Dictionaries.Find((ulong)1)) .SetParent(null) .Build(), new ThemeBuilder().SetName("Die Einkäufe") .SetDictionary(context.Dictionaries.Find((ulong)1)) .SetParent(null) .Build(), new ThemeBuilder().SetName("Aendern mich!") .SetDictionary(context.Dictionaries.Find((ulong)1)) .SetParent(null) .Build(), new ThemeBuilder().SetName("Die Tiere") .SetDictionary(context.Dictionaries.Find((ulong)1)) .SetParent(context.Themes.FirstOrDefault(t => t.Name.Value == "Die Natur")) .Build() }; context.Themes.AddRange(themes); context.SaveChanges(); }
public AddMarkToDictionaryCommandHandler(WordschatzContext dbContext, IValidator <AddMarkToDictionaryCommand> validator) : base(dbContext, validator) { }
public GetMarkByIdQueryHandler(WordschatzContext dbContext, IValidator <GetMarkByIdQuery> validator) : base(dbContext, validator) { }
public ThemeGetByIdQueryHandler(WordschatzContext dbContext, IValidator <ThemeGetByIdQuery> validator) : base(dbContext, validator) { }
public DeleteMarkCommandHandler(WordschatzContext dbContext, IValidator <DeleteMarkCommand> validator) : base(dbContext, validator) { }
public EditDictionaryCommandHandler(WordschatzContext dbContext, IValidator <EditDictionaryCommand> validator) : base(dbContext, validator) { }
public CreateThemeCommandHandler(WordschatzContext dbContext, IValidator <CreateThemeCommand> validator) : base(dbContext, validator) { }
public ChangeWordCommandHandler(WordschatzContext dbContext, IValidator <ChangeWordCommand> validator) : base(dbContext, validator) { }
public QueryHandler(WordschatzContext dbContext, IValidator <TQuery> validator) { _dbContext = dbContext; _validator = validator; }
public DictionaryGetManyQueryHandler(WordschatzContext dbContext, IValidator <DictionaryGetManyQuery> validator) : base(dbContext, validator) { }
public RemoveMarkFromDictionaryCommandHandler(WordschatzContext dbContext, IValidator <RemoveMarkFromDictionaryCommand> validator) : base(dbContext, validator) { }
public CommandHandler(WordschatzContext dbContext, IValidator <T> validator) { _dbContext = dbContext; _validator = validator; }
public EditThemeCommandHandler(WordschatzContext dbContext, IValidator <EditThemeCommand> validator) : base(dbContext, validator) { }