asp.net mvc 3 - Common LINQ method using EF -



asp.net mvc 3 - Common LINQ method using EF -

so stupid question, still not sure how entity frameworks objects work. using ef4 in mvc3 app, , have 2 controllers need utilize same linq query against it. best utilize static method takes db entity ref, or should method utilize "using" block own entity (as seen in this question)?

i think using block add together additional overhead, didn't find examples of other method. there proper way create "library" methods ef access?

in mvc application objectcontext should scoped request. di containers can automatically. prefer not using using block within method. instead inject context via constructor or pass method argument.

asp.net-mvc-3 entity-framework-4 linq-to-entities

Comments

Popular posts from this blog

java - How to pass parameters between Request-Scoped Controllers? -

string - what is the difference between "some" == "some\0" and strcmp("some","some\0") in c++? -

actionscript 3 - Flex: moving a point with rotation doesnt change the point XY? -