Search code examples
c#.netenumsdomain-driven-designdto

Enum type naming conventions in DTO's


I'm creating an application facade in front of my domain model and using dto's for the exchanges between the consumer and the facade.

In order to avoid having to fully qualify my namespaces where I'm mapping between dto's and the domain model, I've suffixed all my dto's with Dto. Ie. CustomerDto, AddressDto etc.

I need to define an enum type as part of my dto's as well and am struggling with whether I should use the Dto suffix on my enum type.

I'm curious what others have done with enum types that reside in their dto's. Any feedback is appreciated.

Thank You


Solution

  • Assuming you're talking about an enum type when you say "enumeration," I wouldn't suffix it with Dto, since that's not really what it is. For example, I wouldn't say CustomerTypeDto since it's not a DTO representing a customer type. However, it is an enum representing the type for a CustomerDto, so maybe CustomerDtoType would be appropriate.