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 annotationsEwan– Ewan2018年07月08日 08:03:59 +00:00Commented Jul 8, 2018 at 8:03
1 Answer 1
- There is no universal, or widely approved naming convention
- 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
- 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