Click here to Skip to main content
15,886,199 members
Home / Discussions / C#
   

C#

 
SuggestionRe: Create Microsoft Excel in C# Pin
LucasRLS25-Jun-14 1:57
LucasRLS25-Jun-14 1:57 
AnswerRe: Create Microsoft Excel in C# Pin
Nguyen.H.H.Dang25-Jun-14 18:45
professionalNguyen.H.H.Dang25-Jun-14 18:45 
QuestionDbContext recreate with cache clear Pin
Nathan Minier24-Jun-14 3:25
professionalNathan Minier24-Jun-14 3:25 
AnswerRe: DbContext recreate with cache clear Pin
Dave Kreskowiak24-Jun-14 5:04
mveDave Kreskowiak24-Jun-14 5:04 
GeneralRe: DbContext recreate with cache clear Pin
Nathan Minier24-Jun-14 5:52
professionalNathan Minier24-Jun-14 5:52 
GeneralRe: DbContext recreate with cache clear Pin
Dave Kreskowiak24-Jun-14 6:00
mveDave Kreskowiak24-Jun-14 6:00 
GeneralRe: DbContext recreate with cache clear Pin
Nathan Minier24-Jun-14 6:22
professionalNathan Minier24-Jun-14 6:22 
GeneralRe: DbContext recreate with cache clear Pin
Dave Kreskowiak24-Jun-14 6:54
mveDave Kreskowiak24-Jun-14 6:54 
That makes things a bit clearer!

OK, what you're refering to as a "cache" isn't. EF has to generate new models and mapping views of the model (query trees!) for query and updating as well as validate those views to make sure they make sense. This is what you're trying to get EF to regenerate. It's not really a cache but is the data EF uses to maintain the model and database mappings.

EF does maintain caches, such as the first-level object cache, the query plan cache and metadata cache. If you change the model, these caches must also be dumped and rebuilt. And then there's are second-level caching that you provide.

The problem with this is that EF maps strong types to the database using the Conceptual model. Without recompiling the code, you'd have to create/modify new entity classes on-the-fly in .NET to map them to the model. But, even then, once the changes are made, how are you going to maintain those changes if the app restarts??

I think I know what you're trying to do, but I don't know of any way to do it, let alone support it in a production environment. You're trying to out-smart Entity Framework, and frankly, the people that wrote it. I found a post 4 years ago by Julie Lerman that says she doesn't know of a way to do it and she's a developer on the EF code! But, there's also this blog post[^] that describes what might be a possible solution.

The only thing I've found that might do what you want is an old project on CodePlex that hasn't been updated since 2009, EFModelAdapter[^] I have no idea if it works with anything other than EF4. Somehow, I doubt it will.

GeneralRe: DbContext recreate with cache clear Pin
Nathan Minier24-Jun-14 9:49
professionalNathan Minier24-Jun-14 9:49 
QuestionProgramming Visio streams on a local computer and hosted on a remote server using c# Pin
orélle23-Jun-14 22:25
orélle23-Jun-14 22:25 
AnswerRe: Programming Visio streams on a local computer and hosted on a remote server using c# Pin
Kornfeld Eliyahu Peter23-Jun-14 22:38
professionalKornfeld Eliyahu Peter23-Jun-14 22:38 
GeneralRe: Programming Visio streams on a local computer and hosted on a remote server using c# Pin
orélle23-Jun-14 23:20
orélle23-Jun-14 23:20 
AnswerRe: Programming Visio streams on a local computer and hosted on a remote server using c# Pin
Kornfeld Eliyahu Peter23-Jun-14 23:23
professionalKornfeld Eliyahu Peter23-Jun-14 23:23 
GeneralRe: Programming Visio streams on a local computer and hosted on a remote server using c# Pin
orélle24-Jun-14 1:03
orélle24-Jun-14 1:03 
AnswerRe: Programming Visio streams on a local computer and hosted on a remote server using c# Pin
Kornfeld Eliyahu Peter24-Jun-14 1:21
professionalKornfeld Eliyahu Peter24-Jun-14 1:21 
GeneralRe: Programming Visio streams on a local computer and hosted on a remote server using c# Pin
orélle24-Jun-14 2:20
orélle24-Jun-14 2:20 
AnswerRe: Programming Visio streams on a local computer and hosted on a remote server using c# Pin
Kornfeld Eliyahu Peter24-Jun-14 2:29
professionalKornfeld Eliyahu Peter24-Jun-14 2:29 
GeneralRe: Programming Visio streams on a local computer and hosted on a remote server using c# Pin
Dave Kreskowiak24-Jun-14 1:39
mveDave Kreskowiak24-Jun-14 1:39 
SuggestionRe: Programming Visio streams on a local computer and hosted on a remote server using c# Pin
Richard Deeming24-Jun-14 0:38
mveRichard Deeming24-Jun-14 0:38 
GeneralRe: Programming Visio streams on a local computer and hosted on a remote server using c# Pin
OriginalGriff24-Jun-14 1:06
mveOriginalGriff24-Jun-14 1:06 
GeneralRe: Programming Visio streams on a local computer and hosted on a remote server using c# Pin
Mycroft Holmes25-Jun-14 0:39
professionalMycroft Holmes25-Jun-14 0:39 
QuestionHow to convert a text file in unicode format to excel file Pin
botngot8323-Jun-14 20:54
botngot8323-Jun-14 20:54 
SuggestionRe: How to convert a text file in unicode format to excel file Pin
Nathan Minier24-Jun-14 3:12
professionalNathan Minier24-Jun-14 3:12 
QuestionConnect to MySQL using MySQL Connector.NET and SharpSsh Pin
Jassim Rahma23-Jun-14 20:24
Jassim Rahma23-Jun-14 20:24 
QuestionSetting A Global Hot Key On A Second Form Pin
rfresh23-Jun-14 18:55
rfresh23-Jun-14 18:55 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.