Reputation: 21280
I am using DTOs in my code to transfer data between layers. I have several extension methods to map them to my BL.
Now I want to use those DTOs as a result of my WCF APIs.
Is that a good approach I am not sure will those extension methods would be also exposed with the DTO classes or not , if yes how I can avoid it?
Upvotes: 0
Views: 443
Reputation: 3182
They may be exposed on the client side, if you put your extensions in the same namespace as your DTOs; this could happen, say, when creating your ViewModels from your DTOs for example.
Upvotes: 0
Reputation: 15901
Your extension methods will not be exposed as a part of your wcf service contract. If your DTOs contain "normal" methods they also will not be exposed. Only DataContract of those DTOs will be shown in your service contract.
Upvotes: 2