C# – Implement Business Logic on Entity Framework

business-rulescentity-frameworkentity-framework-4.1

I'm using the ADO.NET Entity Framework as the data access layer in my application, but I'm not sure where I should be putting business logic. Are there any best practices or samples available that illustrate how to integrate business logic with Entity Framework entities?

After Edit:
I want any samples with implement calculation,security,rules and other things in BLL …
Any article and samples..!

Best Answer

You should have a Business Layer (either a separate project that references your Data Access Layer or at least some sort of directory where your business objects reside). These business objects should be the ones talking to your DAL directly. In other words, don't implement business logic on your DAL since it doesn't belong there.

I'm sure you have seen this diagram before:

enter image description here