Fixes ACL backend support
This commit is contained in:
parent
0034a311f2
commit
e62adedc17
14 changed files with 205 additions and 56 deletions
|
|
@ -85,7 +85,7 @@ namespace Yavsc.Models.Blog
|
|||
|
||||
public string[] GetTags()
|
||||
{
|
||||
return Tags.Select(t => t.Tag.Name).ToArray();
|
||||
return Tags?.Select(t => t.Tag.Name).ToArray() ?? Array.Empty<string>();
|
||||
}
|
||||
|
||||
[InverseProperty("Post")]
|
||||
|
|
@ -106,6 +106,7 @@ namespace Yavsc.Models.Blog
|
|||
[NotMapped]
|
||||
public bool IsPublished { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
/// <summary>
|
||||
/// Explicit interface implementation of
|
||||
/// <see cref="IBlogPost.Author"/>. The underlying
|
||||
|
|
|
|||
|
|
@ -1,14 +1,17 @@
|
|||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Text.Json.Serialization;
|
||||
using Yavsc.Models.Relationship;
|
||||
|
||||
namespace Yavsc.Models.Blog
|
||||
{
|
||||
public partial class BlogTag
|
||||
{
|
||||
[JsonIgnore]
|
||||
[ForeignKey("PostId")]
|
||||
public virtual BlogPost Post { get; set; }
|
||||
public long PostId { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
[ForeignKey("TagId")]
|
||||
public virtual Tag Tag{ get; set; }
|
||||
public long TagId { get; set; }
|
||||
|
|
|
|||
|
|
@ -13,15 +13,17 @@ namespace Yavsc.Models.Blog
|
|||
|
||||
[YaStringLength(1024)]
|
||||
public string Article { get; set; }
|
||||
|
||||
[ForeignKeyAttribute(nameof(ReceiverId))][JsonIgnore]
|
||||
|
||||
[JsonIgnore]
|
||||
[ForeignKeyAttribute(nameof(ReceiverId))]
|
||||
public virtual BlogPost Post { get; set; }
|
||||
|
||||
[Required]
|
||||
public long ReceiverId { get; set; }
|
||||
public bool Visible { get; set; }
|
||||
|
||||
[ForeignKeyAttribute("AuthorId")][JsonIgnore]
|
||||
[ForeignKeyAttribute("AuthorId")]
|
||||
[JsonIgnore]
|
||||
public virtual ApplicationUser Author {
|
||||
get; set;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue