Example:
[Authorize]
public ActionResult Index()
{
var person = _userPersonalizationService.GetPersonForUser(User.Identity.Name);
var campaigns = _campaignRepository.GetCampaignsByCompanyId(person.Company.CompanyId);
return View(campaigns);
}
Basically every user is tied to a person model, and in this instance, I want the retrieve the campaigns of a user's associated company.
How would you wrap this retrieval mechanism so that I don't have to call the database every time and have a UserPersonalizationService in the controllers? Create a base UberController from which every controller is derived? Should I save the authorized user's Person data in the session container?