diff --git a/Yavsc/Models/Access/BlackList.cs b/Yavsc/Models/Access/BlackList.cs index 8784eb5c..5bbb3b42 100644 --- a/Yavsc/Models/Access/BlackList.cs +++ b/Yavsc/Models/Access/BlackList.cs @@ -1,4 +1,3 @@ -using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; @@ -9,29 +8,10 @@ namespace Yavsc.Models.Access [Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)] public long Id { get; set; } public string UserId { get; set; } - public long ListId { get; set; } + public long OwnerId { get; set; } - [ForeignKey("ListId")] - public virtual BlackList BlackList { get; set; } - } - public class BlackList - { - public BlackList(long id, string target) - { - this.Id = id; - this.Target = target; - - } - - [Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)] - public long Id { get; set; } - - public string Target { get; set; } - - [InverseProperty("BlackList")] - public virtual List Items - { - get; set; - } + [ForeignKey("OwnerId")] + public virtual ApplicationUser Owner { get; set; } } + } diff --git a/Yavsc/Models/Identity/ApplicationUser.cs b/Yavsc/Models/Identity/ApplicationUser.cs index 263c50bb..2d8fb602 100644 --- a/Yavsc/Models/Identity/ApplicationUser.cs +++ b/Yavsc/Models/Identity/ApplicationUser.cs @@ -6,6 +6,7 @@ using System.ComponentModel.DataAnnotations.Schema; using Yavsc.Models.Identity; using Yavsc.Model.Chat; using Yavsc.Model.Bank; +using Yavsc.Models.Access; namespace Yavsc.Models { @@ -87,5 +88,7 @@ namespace Yavsc.Models public long DiskQuota { get; set; } = 512*1024*1024; public long DiskUsage { get; set; } = 0; + + public virtual List BlackList { get; set; } } }