diff options
author | crupest <crupest@outlook.com> | 2020-02-04 16:13:53 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2020-02-04 16:13:53 +0800 |
commit | 7cf188134086c5d878cd3230345e89fc10b7e2ca (patch) | |
tree | 2e14a75e8eb6d90325ca3fd114cbfc6478d34258 /Timeline/Models/Http/TimelineCommon.cs | |
parent | 97010e98a11ad6fd6c075cee414c30174001fe5d (diff) | |
download | timeline-7cf188134086c5d878cd3230345e89fc10b7e2ca.tar.gz timeline-7cf188134086c5d878cd3230345e89fc10b7e2ca.tar.bz2 timeline-7cf188134086c5d878cd3230345e89fc10b7e2ca.zip |
Add self link in entities.
Diffstat (limited to 'Timeline/Models/Http/TimelineCommon.cs')
-rw-r--r-- | Timeline/Models/Http/TimelineCommon.cs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Timeline/Models/Http/TimelineCommon.cs b/Timeline/Models/Http/TimelineCommon.cs index 1cb47dac..6b857862 100644 --- a/Timeline/Models/Http/TimelineCommon.cs +++ b/Timeline/Models/Http/TimelineCommon.cs @@ -47,6 +47,7 @@ namespace Timeline.Models.Http public class TimelineInfoLinks
{
+ public string Self { get; set; } = default!;
public string Posts { get; set; } = default!;
}
@@ -61,6 +62,7 @@ namespace Timeline.Models.Http info._links = new TimelineInfoLinks
{
+ Self = urlHelper.ActionLink(nameof(PersonalTimelineController.TimelineGet), nameof(PersonalTimelineController)[0..^nameof(Controller).Length], new { info.Owner.Username }),
Posts = urlHelper.ActionLink(nameof(PersonalTimelineController.PostListGet), nameof(PersonalTimelineController)[0..^nameof(Controller).Length], new { info.Owner.Username })
};
@@ -76,6 +78,7 @@ namespace Timeline.Models.Http info._links = new TimelineInfoLinks
{
+ Self = urlHelper.ActionLink(nameof(TimelineController.TimelineGet), nameof(TimelineController)[0..^nameof(Controller).Length], new { info.Name }),
Posts = urlHelper.ActionLink(nameof(TimelineController.PostListGet), nameof(TimelineController)[0..^nameof(Controller).Length], new { info.Name })
};
|