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
Post a Comment