You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
iot/labs/EFCoreTest/Entities.cs

42 lines
1014 B

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<UserRole> UserRoles { get; set; } = new List<UserRole>();
}
public class Role : Entity
{
public string Name { get; set; }
public List<UserRole> UserRoles { get; set; } = new List<UserRole>();
}
public class UserRole : Entity
{
public Guid UserId { get; set; }
public Guid RoleId { get; set; }
public User User { get; set; }
public Role Role { get; set; }
}
}