My question is about working with the Entity Framework. Lets say I am having an Entity data model and I am having a dbconext instance what is the difference between dbcontext.EntityName.ExtensionMethodName(lambda expression) and dbcontext.EntityName.**Local**.ExtensionMethodName(lambda expression)

Edited 1 Year Ago by AmrMohammed

Yeah it works fine

dbcontext.EntityName.Local.ExtensionMethodName(lambda expression)

If you meant the double Asterisks before and after the word Local I was just trying to bold the word so that it become apparent that it is all.

Ok I see.

I have never seen this before to be honest but have looked into it.

Consider the code below if I put a breakpoint on line 35. In there localContacts contains 1 item and the liveContacts contains several hundred.

So Local is all of the items which have not yet been committed to the database.

To quote MS - Gets an ObservableCollection<T> that represents a local view of all Added, Unchanged, and Modified entities in this set.


Thanks for help. I want to know something else please. When I work with Entity Framework and build my application. Is all the data in the database, which I used to build my data model, loaded into memory once the program is run?

This article has been dead for over six months. Start a new discussion instead.