コード例 #1
0
        private WordschatzContext CreateContext()
        {
            var options = new DbContextOptionsBuilder <WordschatzContext>()
                          .UseInMemoryDatabase(databaseName: "WordschatzDatabase")
                          .Options;

            WordschatzContext context = new WordschatzContext(options);

            return(context);
        }
コード例 #2
0
 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();
 }
コード例 #3
0
 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();
 }
コード例 #4
0
 public AddMarkToDictionaryCommandHandler(WordschatzContext dbContext, IValidator <AddMarkToDictionaryCommand> validator) : base(dbContext, validator)
 {
 }
コード例 #5
0
 public GetMarkByIdQueryHandler(WordschatzContext dbContext, IValidator <GetMarkByIdQuery> validator) : base(dbContext, validator)
 {
 }
コード例 #6
0
 public ThemeGetByIdQueryHandler(WordschatzContext dbContext, IValidator <ThemeGetByIdQuery> validator) : base(dbContext, validator)
 {
 }
コード例 #7
0
 public DeleteMarkCommandHandler(WordschatzContext dbContext, IValidator <DeleteMarkCommand> validator) : base(dbContext, validator)
 {
 }
コード例 #8
0
 public EditDictionaryCommandHandler(WordschatzContext dbContext, IValidator <EditDictionaryCommand> validator) : base(dbContext, validator)
 {
 }
コード例 #9
0
 public CreateThemeCommandHandler(WordschatzContext dbContext, IValidator <CreateThemeCommand> validator) : base(dbContext, validator)
 {
 }
コード例 #10
0
 public ChangeWordCommandHandler(WordschatzContext dbContext, IValidator <ChangeWordCommand> validator) : base(dbContext, validator)
 {
 }
コード例 #11
0
 public QueryHandler(WordschatzContext dbContext, IValidator <TQuery> validator)
 {
     _dbContext = dbContext;
     _validator = validator;
 }
コード例 #12
0
 public DictionaryGetManyQueryHandler(WordschatzContext dbContext, IValidator <DictionaryGetManyQuery> validator) : base(dbContext, validator)
 {
 }
コード例 #13
0
 public RemoveMarkFromDictionaryCommandHandler(WordschatzContext dbContext, IValidator <RemoveMarkFromDictionaryCommand> validator) : base(dbContext, validator)
 {
 }
コード例 #14
0
 public CommandHandler(WordschatzContext dbContext, IValidator <T> validator)
 {
     _dbContext = dbContext;
     _validator = validator;
 }
コード例 #15
0
 public EditThemeCommandHandler(WordschatzContext dbContext, IValidator <EditThemeCommand> validator) : base(dbContext, validator)
 {
 }