Exemple #1
0
        public static void Initialize(IServiceProvider serviceProvider)
        {
            using (var context = new KeyContext(serviceProvider.GetRequiredService <DbContextOptions <KeyContext> >())) {
                if (context.Keys.Any())
                {
                    return;
                }

                context.Keys.AddRange(
                    new Key {
                    KeyId = 1,
                    Name  = "C"
                },
                    new Key {
                    KeyId = 2,
                    Name  = "A"
                }
                    );

                context.SaveChanges();
            }
        }
Exemple #2
0
 public void Configure(KeyContext keyContext)
 {
 }