mirror of https://github.com/EasyAbp/EShop.git
18 changed files with 80 additions and 7 deletions
@ -1,12 +1,32 @@ |
|||||
|
using System; |
||||
using System.Threading.Tasks; |
using System.Threading.Tasks; |
||||
|
using EasyAbp.EShop.Products.Categories; |
||||
|
using Microsoft.AspNetCore.Mvc; |
||||
|
|
||||
namespace EasyAbp.EShop.Products.Web.Pages.EShop.Products.Categories.Category |
namespace EasyAbp.EShop.Products.Web.Pages.EShop.Products.Categories.Category |
||||
{ |
{ |
||||
public class IndexModel : ProductsPageModel |
public class IndexModel : ProductsPageModel |
||||
{ |
{ |
||||
|
private readonly ICategoryAppService _categoryAppService; |
||||
|
|
||||
|
[BindProperty(SupportsGet = true)] |
||||
|
public Guid? ParentId { get; set; } |
||||
|
|
||||
|
public string ParentDisplayName { get; set; } |
||||
|
|
||||
|
public IndexModel(ICategoryAppService categoryAppService) |
||||
|
{ |
||||
|
_categoryAppService = categoryAppService; |
||||
|
} |
||||
|
|
||||
public async Task OnGetAsync() |
public async Task OnGetAsync() |
||||
{ |
{ |
||||
await Task.CompletedTask; |
if (!ParentId.HasValue) |
||||
|
{ |
||||
|
return; |
||||
|
} |
||||
|
|
||||
|
ParentDisplayName = (await _categoryAppService.GetAsync(ParentId.Value)).DisplayName; |
||||
} |
} |
||||
} |
} |
||||
} |
} |
||||
|
|||||
Loading…
Reference in new issue