Skip to content

Instantly share code, notes, and snippets.

@divega
Last active May 23, 2017 00:22
Show Gist options
  • Save divega/790d94247f43f4d598961db59c4071de to your computer and use it in GitHub Desktop.
Save divega/790d94247f43f4d598961db59c4071de to your computer and use it in GitHub Desktop.
Pattern to enable cached code first models in EF 6.2
using System.Data.Entity;
using System.Data.Entity.Infrastructure;
namespace MyApplication
{
public class MyDbConfiguration : DbConfiguration
{
public MyDbConfiguration() : base()
{
this.SetModelStore(new DefaultDbModelStore(Directory.GetCurrentDirectory()));
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment