0

I want set an initializer dynamically that expect a Type as input, but gets an error that says "could not find type or namespeace dbContextType"

var dbContext = DependencyResolver.Current.GetService<DbContext>();

var dbContextType = dbContext.GetType();
Database.SetInitializer<dbContextType>(null);

Is it posible to set a type like this as input without explicit writing the class name?

tereško
  • 58,060
  • 25
  • 98
  • 150
MikeAlike234
  • 759
  • 2
  • 12
  • 29

0 Answers0