title: Where does the business logic go in WCF Data service using entity framework?
body: <p>I was looking at how you can create a WCF data service around an entity framework context and you can consume it as an EF context as well.</p>
  
  <p><a href="http://www.hanselman.com/blog/CreatingAnODataAPIForStackOverflowIncludingXMLAndJSONIn30Minutes.aspx" rel="nofollow">Creating an OData API for StackOverflow including XML and JSON in 30 minutes</a></p>
  
  <p>I really just started looking at this, but I was wondering where would the business logic go? As a service I would expect that you couldn't just freely add/delete etc without it having some validation.</p>
  
  <p>If I wrote an MVC app to consume this service, how would I best implement business logic. Not simple property level validation that you could do with attributes, but more complex stuff that needs to check the data store first etc.</p>