public ActionResult Edit()
{
var profile =
RepositoryFactory.ProfileRepository.Queryable.SingleOrDefault(
x => x.User.Identifier == CurrentUser.Identity.Name);
if (profile == null)
{
Message = "You don't yet have a profile, please create one now";
return RedirectToAction("Create");
}
var model = new ProfileEditModel
{
Profile = profile,
Roles = RepositoryFactory.RoleRepository.Queryable.OrderByDescending(x=>x.Name).ToList()
};
return View(model);
}