I have a project in ASP.NET (no ASP.NET Core, no ASP.NET MVC) based on .NET Framework 4.5 and now upgraded at Entity Framework 6.3.
I noticed that the startup time is over 1 minute.
The project have 400-500 contexts, and it is in Database First with .edmx file.
So I used Model Cache (introduced with EF 6.2)
public class EFConfiguration : DbConfiguration
{
public EFConfiguration() : base()
{
string vPath = Path.GetDirectoryName(this.GetType().Assembly.Location);
this.SetModelStore(new DefaultDbModelStore(vPath));
}
}
[DbConfigurationType(typeof(EntityFrameworkConfiguration.EFConfiguration))]
public partial class EFEntities : DbContext
{
}And in Web.config file
<entityFramework codeConfigurationType="EntityFrameworkConfiguration.EFConfiguration, MyProject">
The startup time remained at 1 minute, in debug with Visual Studio and published on IIS.
Did I do something wrong?