implements a directory component
This commit is contained in:
parent
f627678abe
commit
b5d48c54b0
4 changed files with 65 additions and 5 deletions
20
Yavsc/ViewComponents/DirectoryViewComponent.cs
Normal file
20
Yavsc/ViewComponents/DirectoryViewComponent.cs
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
using Microsoft.AspNet.Mvc;
|
||||
|
||||
namespace Yavsc.ViewComponents
|
||||
{
|
||||
using System.Threading.Tasks;
|
||||
using Yavsc.ViewModels.UserFiles;
|
||||
|
||||
public class DirectoryViewComponent : ViewComponent
|
||||
{
|
||||
public async Task<IViewComponentResult> InvokeAsync(string dirname)
|
||||
{
|
||||
IViewComponentResult result = null;
|
||||
await Task.Run(() =>
|
||||
{
|
||||
result = View(new UserDirectoryInfo(User.Identity.Name, dirname));
|
||||
});
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue