displaying blog comments

This commit is contained in:
Paul Schneider 2017-10-05 11:58:51 +02:00
commit 6dcbfbe63e
9 changed files with 53 additions and 10 deletions

View file

@ -1,6 +1,8 @@
using System.Linq;
using Microsoft.AspNet.Mvc;
using Yavsc.Helpers;
using Yavsc.Models;
using Yavsc.ViewModels.Account;
namespace Yavsc.ViewComponents
{
@ -14,7 +16,14 @@ namespace Yavsc.ViewComponents
public IViewComponentResult Invoke ( string userId, string imgFmt )
{
return View ( "Default", dbContext.AvatarUri(userId, imgFmt));
var user = dbContext.Users.Single(u=>u.Id == userId);
return View ( "Default", new ShortUserInfo
{
Avatar = dbContext.AvatarUri(userId, imgFmt),
UserName = user.UserName,
UserId = userId
} );
}
}