@if ((await AuthorizationService.AuthorizeAsync(User, post, new ReadPermission())).Succeeded)
{
-
Details
+
Details
}
else
{
diff --git a/src/Yavsc.Org/Yavsc.Org.csproj b/src/Yavsc.Org/Yavsc.Org.csproj
index 6dbceb4a..aeb94a8e 100644
--- a/src/Yavsc.Org/Yavsc.Org.csproj
+++ b/src/Yavsc.Org/Yavsc.Org.csproj
@@ -9,7 +9,7 @@
https://github.com/pazof/yavsc
1.1.0.0
1.1.0.0
-
1.1.0-beta.1+148.Branch.release-1.0.8-rc4.Sha.6b161b0fb509fec0ce467aa94f1a450b202af2f0
+
1.1.0-beta.1+49.Branch.release-1.0.8-rc3.Sha.5274d7bdf5d14406748a2063b5ae15191aac4359
1.1.0-beta.1
@@ -54,4 +54,4 @@
-
\ No newline at end of file
+
diff --git a/src/Yavsc.Server/Helpers/PayloadHelpers.cs b/src/Yavsc.Server/Helpers/PayloadHelpers.cs
deleted file mode 100644
index cd359bb4..00000000
--- a/src/Yavsc.Server/Helpers/PayloadHelpers.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-using Yavsc.Models.Blog;
-
-public static class PayloadHelpers
-{
- public static object GetPayload(this BlogPost post)
- {
- return new
- {
- post.Id,
- post.Title,
- post.Article,
- post.DateCreated,
- post.UserCreated,
- post.DateModified,
- post.UserModified,
- post.AuthorId,
- ACL = post.GetACL(),
- Tags = post.GetTags(),
- post.IsPublished
- };
- }
-}
diff --git a/src/Yavsc.Server/Models/Blog/BlogPost.cs b/src/Yavsc.Server/Models/Blog/BlogPost.cs
index e5fd615d..5a2dc58d 100644
--- a/src/Yavsc.Server/Models/Blog/BlogPost.cs
+++ b/src/Yavsc.Server/Models/Blog/BlogPost.cs
@@ -85,7 +85,7 @@ namespace Yavsc.Models.Blog
public string[] GetTags()
{
- return Tags?.Select(t => t.Tag.Name).ToArray() ?? Array.Empty();
+ return Tags.Select(t => t.Tag.Name).ToArray();
}
[InverseProperty("Post")]
@@ -106,7 +106,6 @@ namespace Yavsc.Models.Blog
[NotMapped]
public bool IsPublished { get; set; }
- [JsonIgnore]
///
/// Explicit interface implementation of
/// . The underlying
diff --git a/src/Yavsc.Server/Models/Blog/BlogTag.cs b/src/Yavsc.Server/Models/Blog/BlogTag.cs
index 1f15a081..69d428de 100644
--- a/src/Yavsc.Server/Models/Blog/BlogTag.cs
+++ b/src/Yavsc.Server/Models/Blog/BlogTag.cs
@@ -1,17 +1,14 @@
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; }
diff --git a/src/Yavsc.Server/Models/Blog/Comment.cs b/src/Yavsc.Server/Models/Blog/Comment.cs
index 4d39d0c2..acb5e003 100644
--- a/src/Yavsc.Server/Models/Blog/Comment.cs
+++ b/src/Yavsc.Server/Models/Blog/Comment.cs
@@ -13,17 +13,15 @@ namespace Yavsc.Models.Blog
[YaStringLength(1024)]
public string Article { get; set; }
-
- [JsonIgnore]
- [ForeignKeyAttribute(nameof(ReceiverId))]
+
+ [ForeignKeyAttribute(nameof(ReceiverId))][JsonIgnore]
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;
}
diff --git a/src/Yavsc.Server/Yavsc.Server.csproj b/src/Yavsc.Server/Yavsc.Server.csproj
index 839e476a..7adb3a78 100644
--- a/src/Yavsc.Server/Yavsc.Server.csproj
+++ b/src/Yavsc.Server/Yavsc.Server.csproj
@@ -9,7 +9,7 @@
true
1.1.0.0
1.1.0.0
- 1.1.0-beta.1+148.Branch.release-1.0.8-rc4.Sha.6b161b0fb509fec0ce467aa94f1a450b202af2f0
+ 1.1.0-beta.1+49.Branch.release-1.0.8-rc3.Sha.5274d7bdf5d14406748a2063b5ae15191aac4359
1.1.0-beta.1
@@ -43,4 +43,4 @@
-
\ No newline at end of file
+
diff --git a/src/Yavsc.Tests.Shared/BlogHelpers.cs b/src/Yavsc.Tests.Shared/BlogHelpers.cs
deleted file mode 100644
index ef5a7688..00000000
--- a/src/Yavsc.Tests.Shared/BlogHelpers.cs
+++ /dev/null
@@ -1,31 +0,0 @@
-
-namespace Yavsc.Blogs.Tests.Fixtures;
-using static Yavsc.Constants;
-
-public static class BlogHelpers
-{
- public static string ApiUrl(this IBackendFixture fixture, string apiSubPath)
- {
- var secured = fixture.Addresses.FirstOrDefault(a => a.StartsWith("https://"));
- if (secured is null)
- {
- var unsecured = fixture.Addresses.FirstOrDefault(a => a.StartsWith("http://"));
- if (unsecured is null)
- {
- throw new InvalidOperationException("No backend address found");
- }
- return $"{unsecured}/{APIPrefix}/{apiSubPath}";
- }
- return $"{secured}/{APIPrefix}/{apiSubPath}";
- }
-
- public static string BlogAclUrl(this IBackendFixture fixture)
- => fixture.ApiUrl(BlogAclPath);
-
- public static string BlogSpotUrl(this IBackendFixture fixture)
- => fixture.ApiUrl(BlogSpotPath);
-
- public static string PublishUrl(this IBackendFixture fixture, long id)
- => fixture.ApiUrl(BlogSpotPath) +"/" + id + "/publish";
-
-}
diff --git a/src/Yavsc.Tests.Shared/IBackendFixture.cs b/src/Yavsc.Tests.Shared/IBackendFixture.cs
deleted file mode 100644
index 4e2f009d..00000000
--- a/src/Yavsc.Tests.Shared/IBackendFixture.cs
+++ /dev/null
@@ -1,13 +0,0 @@
-
-public interface IBackendFixture
-{
- ///
- /// The addresses the fixture bound to.
- ///
- IReadOnlyList Addresses { get; }
-
- ///
- /// The service provider for the fixture host.
- ///
- IServiceProvider Services { get; }
-}
diff --git a/src/Yavsc.Tests.Shared/WebHostFixture.cs b/src/Yavsc.Tests.Shared/WebHostFixture.cs
index 95b23082..417d29d8 100644
--- a/src/Yavsc.Tests.Shared/WebHostFixture.cs
+++ b/src/Yavsc.Tests.Shared/WebHostFixture.cs
@@ -30,7 +30,7 @@ namespace Yavsc.Tests.Shared;
/// mapping are the responsibility of the subclass, through
/// .
///
-public abstract class WebHostFixture : IDisposable, IBackendFixture
+public abstract class WebHostFixture : IDisposable
{
private static readonly Lazy _selfSignedCertificate =
new Lazy(CreateSelfSignedCertificate);
diff --git a/src/Yavsc.Tests.Shared/Yavsc.Tests.Shared.csproj b/src/Yavsc.Tests.Shared/Yavsc.Tests.Shared.csproj
index 6e7a4c5a..7f2f382a 100644
--- a/src/Yavsc.Tests.Shared/Yavsc.Tests.Shared.csproj
+++ b/src/Yavsc.Tests.Shared/Yavsc.Tests.Shared.csproj
@@ -14,7 +14,7 @@
-->
1.1.0.0
1.1.0.0
- 1.1.0-beta.1+148.Branch.release-1.0.8-rc4.Sha.6b161b0fb509fec0ce467aa94f1a450b202af2f0
+ 1.1.0-beta.1+49.Branch.release-1.0.8-rc3.Sha.5274d7bdf5d14406748a2063b5ae15191aac4359
1.1.0-beta.1
@@ -23,7 +23,4 @@
-
-
-
diff --git a/src/cli/cli.csproj b/src/cli/cli.csproj
index 49aa64b1..237ccdd8 100644
--- a/src/cli/cli.csproj
+++ b/src/cli/cli.csproj
@@ -7,7 +7,7 @@
true
1.1.0.0
1.1.0.0
- 1.1.0-beta.1+148.Branch.release-1.0.8-rc4.Sha.6b161b0fb509fec0ce467aa94f1a450b202af2f0
+ 1.1.0-beta.1+49.Branch.release-1.0.8-rc3.Sha.5274d7bdf5d14406748a2063b5ae15191aac4359
1.1.0-beta.1