You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

38 lines
1.1 KiB

using Microsoft.AspNet.Identity.EntityFramework;
using Sevomin.Models;
using Sevomin.Models.Helpers;
using System.Threading.Tasks;
using System.Web.Mvc;
namespace Sevomin.WebFrontend.Controllers
{
public class HomeController : BaseController
{
public HomeController()
: this(new SevominUserManager(new UserStore<User>(SevominDbContext.Current)))
{
}
public HomeController(SevominUserManager userManager)
{
UserManager = userManager;
}
public SevominUserManager UserManager { get; private set; }
public async Task<ActionResult> Index()
{
if (!Request.IsAuthenticated)
return View("Intro");
else
{
User user = await UserManager.FindByNameAsync(User.Identity.Name);
if (user is Avalin)
return View("AvalinIndex");
else
return View("DovominIndex");
}
}
}
}