DocSpace-buildtools/common/ASC.Core.Common/EF/Model/User/UserGroup.cs

34 lines
855 B
C#
Raw Normal View History

2019-11-25 09:49:12 +00:00
using System;
using System.ComponentModel.DataAnnotations.Schema;
2019-12-03 15:20:21 +00:00
using Microsoft.EntityFrameworkCore;
2019-11-25 09:49:12 +00:00
namespace ASC.Core.Common.EF
{
[Table("core_usergroup")]
public class UserGroup
{
public int Tenant { get; set; }
public Guid UserId { get; set; }
public Guid GroupId { get; set; }
[Column("ref_type")]
public UserGroupRefType RefType { get; set; }
public bool Removed { get; set; }
[Column("last_modified")]
public DateTime LastModified { get; set; }
}
2019-12-03 15:20:21 +00:00
public static class DbUserGroupExtension
{
public static void AddUserGroup(this ModelBuilder modelBuilder)
{
modelBuilder.Entity<UserGroup>()
.HasKey(c => new { c.Tenant, c.UserId, c.GroupId, c.RefType });
}
}
2019-11-25 09:49:12 +00:00
}