Advertisement
Guest User

Untitled

a guest
Jan 22nd, 2017
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. [AllowAnonymous]
  2. [Route("Post/{year:int}/{month:int}/{day:int}/{*title}")]
  3. [HttpGet]
  4. public Task<IActionResult> GetPostByDateTitle(int year, int month, int day, string title)
  5. {
  6. return this.GetPostByDate(year, month, day, 1);
  7. }
  8.  
  9. [AllowAnonymous]
  10. [Route("Post/{year:int}/{month:int}/{day:int}/{dayId:int}/{*title}")]
  11. [HttpGet]
  12. public Task<IActionResult> GetPostByDateTitle(int year, int month, int day, int dayId, string title)
  13. {
  14. return this.GetPostByDate(year, month, day, dayId);
  15. }
  16.  
  17. @if (Model.DayId == 1)
  18. {
  19. <a asp-controller="Post" asp-action="GetPostByDateTitle" asp-route-year="@Model.Year" asp-route-month="@Model.Month" asp-route-day="@Model.Day" asp-route-title="@LinkTitle(Model.Title)">link</a>
  20. }
  21. else
  22. {
  23. <a asp-controller="Post" asp-action="GetPostByDateTitle" asp-route-year="@Model.Year" asp-route-month="@Model.Month" asp-route-day="@Model.Day" asp-route-dayid="@Model.DayId" asp-route-title="@LinkTitle(Model.Title)">link</a>
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement