2017-02-01 19:53:10 +01:00
|
|
|
using Microsoft.AspNet.Mvc;
|
|
|
|
|
using Yavsc.Helpers;
|
|
|
|
|
using Yavsc.Models;
|
|
|
|
|
|
|
|
|
|
namespace Yavsc.ViewComponents
|
|
|
|
|
{
|
|
|
|
|
public class AvatarViewComponent : ViewComponent
|
|
|
|
|
{
|
|
|
|
|
ApplicationDbContext dbContext;
|
|
|
|
|
public AvatarViewComponent(ApplicationDbContext dbContext)
|
|
|
|
|
{
|
|
|
|
|
this.dbContext = dbContext;
|
|
|
|
|
}
|
|
|
|
|
|
2017-02-02 13:49:47 +01:00
|
|
|
public IViewComponentResult Invoke ( string userId, string imgFmt )
|
2017-02-01 19:53:10 +01:00
|
|
|
{
|
|
|
|
|
return View ( "Default", dbContext.AvatarUri(userId, imgFmt));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|