protected override void OnModelCreating(DbModelBuilder db) { var types = typeof(IConvention).Assembly.GetTypes() .Where(x => x.IsClass && !x.IsAbstract && typeof(IConvention).IsAssignableFrom(x)) .ToList(); var remove = typeof(ConventionsConfiguration).GetMethod("Remove"); types.ForEach(x => remove.MakeGenericMethod(x).Invoke(db.Conventions, null)); }
Немає коментарів:
Дописати коментар