Explicit dependencies vs Serialization parameterless constructor
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.
- ID: 829862b0-b51d-d4dd-d770-f875a588384f
- Version Independent ID: c5bc4d26-8f85-4544-3a4a-131554241eef
- Content: Architectural principles
- Content Source: docs/architecture/modern-web-apps-azure/architectural-principles.md
- Product: dotnet
- Technology: dotnet-ebooks
- GitHub Login: @ardalis
- Microsoft Alias: wiwagn
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?
Closing this issue as stale but feel free to comment, will reopen if needed.