I'm creating an application which is split into a Data Layer (using repository pattern & EF 4.0), a Business layer (POCO's with additional logic) and a Service Layer (which is exposed to the client using WCF).
When I'm saving a record to the database I need to check and see if I'm updating an existing record or inserting a new one. Where should that responsibility lie - in the Service Layer so that the lifetime of an object is explicitly managed, or in the Data Layer so that saving a record will implicitly determine what action to take.
All comments welcome - I can't decide myself!