Entity Framework ModelStore Cache
| Ağustos 30, 20171 2 3 4 | Nuget PM> Install-Package EntityFramework 6.2 PM> Nuget Install-Package MemoryCache PM> Install-Package EntityFramework.Cache |
1 2 3 4 5 6 7 8 9 10 | public class MyDbConfiguration : DbConfiguration { public MyDbConfiguration() : base() { // App'in Çalıştığı yeri bulur string UIPath = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase).Replace("bin", "Documents\\Cache").Replace("file:\\", ""); // ModelStore Set Eder.. SetModelStore(new DefaultDbModelStore(UIPath)); } } |