EF Business Classes in ASP.NET Apps - Don't pass that query around!

Posted by: Julia Lerman Blog - Dont Be Iffy..., on 31 Aug 2008 | View original | Bookmarked: 0 time(s)

Here's a little sidebar from my book that I think is pretty important. Return Results, not Queries from the Business classes While you can get away with binding a query when working directly in the code behind of an ASP.NET page, remember that the querys job is to be executed and return results. Query execution requires an ObjectContext. If you returned the query itself from a business class, it will be detached from the context as soon as the business object is disposed (the business object,...

Advertisement
Free Agile Project Management Tool from Telerik
TeamPulse Community Edition helps your team effectively capture requirements, manage project plans, assign and track work, and most importantly, be continually connected with each other.
Category: ASP.NET | Other Posts: View all posts by this blogger | Report as irrelevant | View bloggers stats | Views: 588 | Hits: 38

Similar Posts

  • Introducing Versatile DataSources more
  • Generic Types and Inheritance more
  • EF4: Model-Defined Functions Level 1 & 2 more
  • Multi-Value Key for a Dictionary more
  • Querying with LINQ to Entities vs ObjectQuery in EF more
  • EDM QueryViews vs Defining Queries (and read-only views) more
  • CS Dev Guide: Search with APIs more
  • .NET vNext what it means to your architecture? more
  • Community Server 2.1 Blog Recent Feedbacks Control more
  • Re: Taking sides with clemens more

News Categories

.NET | Agile | Ajax | Architecture | ASP.NET | BizTalk | C# | Certification | Data | DataGrid | DataSet | Debugger | DotNetNuke | Events | GridView | IIS | Indigo | JavaScript | Mobile | Mono | Patterns and Practices | Performance | Podcast | Refactor | Regex | Security | Sharepoint | Silverlight | Smart Client Applications | Software | SQL | VB.NET | Visual Studio | W3 | WCF | WinFx | WPF | WSE | XAML | XLinq | XML | XSD