docs icon indicating copy to clipboard operation
docs copied to clipboard

Explicit dependencies vs Serialization parameterless constructor

Open ewmccarty opened this issue 7 years ago • 2 comments

I've noticed that when I exercise the Explicit dependencies there seems to be a problem when serializing because a parameterless constructor is also needed; which enables a bypass to requiring the use of Explicit dependencies. What are your thoughts?


Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

ewmccarty avatar Mar 06 '19 20:03 ewmccarty

Things that you serialize shouldn’t generally have dependencies. Entities, value objects, and DTOs might be serialized. Controllers, services, repositories, event handlers shouldn’t be, and may have dependencies. Does that help?

ardalis avatar Mar 06 '19 23:03 ardalis

Closing this issue as stale but feel free to comment, will reopen if needed.

mvelosop avatar Aug 08 '19 19:08 mvelosop