using System; using System.Collections.Generic; namespace EFCoreTest { public class Entity { public Guid Id { get; set; } public DateTime Created { get; set; } public DateTime LastChanged { get; set; } public string RowVersion { get; set; } public Entity() { this.Id = Guid.NewGuid(); } public override string ToString() { return this.Id.ToString(); } } public class User : Entity { public string UserName { get; set; } public List UserRoles { get; set; } = new List(); } public class Role : Entity { public string Name { get; set; } public List UserRoles { get; set; } = new List(); } public class UserRole : Entity { public Guid UserId { get; set; } public Guid RoleId { get; set; } public User User { get; set; } public Role Role { get; set; } } }