1

As an example, I have a POCO called Person which is used in my presentation layer and my business logic layer.

I don't want to use this POCO in the Entity framework because I don't want that class to contain database specific metadata such as those annotations used by the Entity framework.

Is there a naming convention to use in this case? Ideally, I would like the POCO to remain Person and its corresponding Entity to be called PersonEntity.

  • if you do code first carefully you can avoid the annotations – Ewan Jul 8 '18 at 8:03
1
  1. There is no universal, or widely approved naming convention
  2. Since there are 3 application layers where the abstraction of Person is present, you may simply distinguish them by namespaces, although this appoach may lead to confusion
  3. In my opinion the most verbose approach would be the following:
    • Person - for domain/business logic layer
    • PersonEntity - for data access / entity framework layer
    • PersonViewModel - for presentation layer

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.