In our application we are upgrading the existing DAL from EF 4.0 to EF 5.0.
Currently a generic repository pattern is already implemented and we are using POCO objects as business entities.
These objects are decorated with WCF attributes, since they are passed in web services interfaces and are extended with partial classes in order to add further business and validation methods. Moreover each POCO entity inherits from a base class "BusinessEntity" and interface "IBusinessEntity" in order to use generics repository methods easily.
We are planning to decouple the business entities from POCOs objects in order to make the latter as plain classes with only properties and no logic.
However after reading about the topic, it seems the current state of art is to adopt Code First approach and persist domain entities directly (even if of course it is not possible to generalize for all cases).
Related answer 1, related answer 2.
In our case, would it make sense to keep POCO objects with business logic in them and apply just the changes related to EF 5.0 (DbContext)? Or rather we should introduce a mapping layer inside the repository? In this way the application would work on the business entities and the repository layer would hide the POCOs object from outside. However the downside is the introduction of complexity, expecially when dealing with generic repository.
Thanks in advance.