on .net core 2.1, I have loaded the assembly to the application using
services.AddMvcCore().AddApplicationPart([Assembly])
But the assembly contains its DB context , the problem is that I am not able to load the DBContext from the assembly, in a similar way of loading the controllers. Typically we add the DB Context using
services.AddDbContext<[DBCOntextType]>([options]);
I cannot get to pass the type to this function (AddDBContext) using reflection as follow :
System.Reflection.MethodInfo method = services.GetType().GetMethod("AddDbContext",System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Static);
method variable is always null.
Also if the assembly contains a startup.cs file I am not able to run this startup along with the startup of the main app.
Please let me know if there is a solution Thanks