private static MasterModel CreateModel(MasterModel model, MasterModel masterModel) { Mapper.CreateMap<MasterModel, MasterModel>(); return Mapper.Map(masterModel, model); }
private MasterModel GetMasterModel() { MasterModel viewData = new MasterModel() { RecentProjects = _projectRepo.GetProjects(), HasCurrentProject = CurrentProject != null ? true : false, CurrentProject = CurrentProject, CurrentUser = Auth.CurrentUser, IsUserLoggedIn = Auth.IsUserLoggedIn(), NumTicketsAssignedToCurrentUser = 0 }; if (CurrentProject != null) { viewData.Tickets = _ticketRepo.GetNewestTicketsByProject(CurrentProject, 0, 5).Items; } else { viewData.Tickets = new List<Ticket>(); } if (viewData.CurrentUser != null) { viewData.NumTicketsAssignedToCurrentUser = _ticketRepo.TotalTicketsByAssignedToUser(Auth.CurrentUser); } return viewData; }
protected ActionResult View(MasterModel model) { Mapper.CreateMap<MasterModel, MasterModel>(); return base.View(Mapper.Map(GetMasterModel(), model)); }