I am new at domain driven design, and want to learn some about aggregates. For example I have a User
and Role
entities.
public class User {
public string Id {get; set;}
public string Username {get; set;}
public IEnumerable<Role> Roles {get; set;}
}
public class Role {
public string Id{get; set;}
public string Name {get; set;}
}
In this stuation, User is an aggregate root. Roles are part of user. But If I want to use Many-to-many relations with Role and User, how changes the aggregation? In this stuation which is the aggregate root?