DocSpace-client/common/ASC.Core.Common/EF/Model/AccountLinks.cs

32 lines
845 B
C#
Raw Normal View History

2019-12-04 11:40:42 +00:00
using System;
using System.ComponentModel.DataAnnotations.Schema;
2019-12-17 13:01:59 +00:00
2019-12-04 11:40:42 +00:00
using Microsoft.EntityFrameworkCore;
namespace ASC.Core.Common.EF.Model
{
[Table("account_links")]
2019-12-17 13:01:59 +00:00
public class AccountLinks : BaseEntity
2019-12-04 11:40:42 +00:00
{
public string Id { get; set; }
public string UId { get; set; }
public string Provider { get; set; }
public string Profile { get; set; }
public DateTime Linked { get; set; }
2019-12-17 13:01:59 +00:00
2020-02-21 12:38:04 +00:00
public override object[] GetKeys()
2019-12-17 13:01:59 +00:00
{
return new object[] { Id, UId };
}
2019-12-04 11:40:42 +00:00
}
public static class AccountLinksExtension
{
public static void AddAccountLinks(this ModelBuilder modelBuilder)
{
modelBuilder.Entity<AccountLinks>()
.HasKey(c => new { c.Id, c.UId });
}
}
}