protected void Seed(T context)
        {
            EntityInitializer initializer = InitializerFactory.GetEntityInitializerFor <T>();

            initializer.Seed(context);
            context.SaveChanges();
        }
Beispiel #2
0
 public static void SetEntityInitializer <T>(EntityInitializer entityInitializer) where T : DbContext
 {
     if (_entityInitializers.ContainsKey(typeof(T)))
     {
         _entityInitializers.Remove(typeof(T));
     }
     _entityInitializers.Add(typeof(T), entityInitializer);
 }