Question

I saw a lot of examples of decoupling domain models from Identity models. For my knowledge, currently IIdentity is included in standard .NET library, so is this actual now and should I follow this approach? Thanks in advance!

Was it helpful?

Solution

This has little to do with Identity being part of the basic framework.

Identity is a security and user management API, while your domain model does business logic.

Architecturally speaking, Identity is a cross-cutting concern, while domain models represent your core functionality. So it makes sense to separate them from each other.

Furthermore, Identity is not the only way to manage users, so, looking at it as a component, it can absolutely be switched out, if required. Which is going to be much more difficult, if you tie it to your domain model.

Licensed under: CC-BY-SA with attribution
scroll top