public StatusReportController(IStatusReportRepository repository, ITopicRepository topicRepository, IProjectRepository projectRepository, IResourceRepository resourceRepository, IStatusReportManager statusReportManager, ITagRepository tagRepository) { _repository = repository; _topicRepository = topicRepository; _projectRepository = projectRepository; _resourceRepository = resourceRepository; _tagRepository = tagRepository; _statusReportManager = statusReportManager; Mapper.CreateMap<StatusReport, StatusReportViewModel>() .ForMember(m => m.NumberOfStatusItems, opt => opt.ResolveUsing<NumberOfStatusItemsFormatter>()); Mapper.CreateMap<StatusItem, StatusReportItemViewModel>() .ForMember(m => m.TagsString, opt => { opt.MapFrom(src => String.Join(",", (from tag in src.Tags select tag.Name))); opt.NullSubstitute(String.Empty); } ); Mapper.CreateMap<StatusReportItemViewModel, StatusItem>(); Mapper.CreateMap<Project, ProjectViewModel>(); Mapper.CreateMap<Tag, TagViewModel>(); //.ForMember(m => m.StatusReportId, opt => opt.M); //.ForMember(dest => dest.ProjectLeadFullName, opt => opt.MapFrom(src => src.Project.Lead.FullName)) //.ForMember(dest => dest.ProjectTeamLeadFullName, opt => opt.MapFrom(src => src.Project.Team.Lead.FullName)); }
public ResourceAllocationController(IStatusReportRepository repository, ITopicRepository topicRepository, IProjectRepository projectRepository, IResourceRepository resourceRepository, IStatusReportManager statusReportManager, ITeamRepository teamRepository, ITagRepository tagRepository, IResourceAllocationRepository resourceAllocationRepository) { _repository = repository; _topicRepository = topicRepository; _projectRepository = projectRepository; _resourceRepository = resourceRepository; _tagRepository = tagRepository; _teamRepository = teamRepository; _statusReportManager = statusReportManager; _resourceAllocationRepository = resourceAllocationRepository; Mapper.CreateMap<Project, StatusMvc.Models.ResourceAllocationViewModel.TeamAllocationRAVM.ProjectRAVM>(); Mapper.CreateMap<Team, StatusMvc.Models.ResourceAllocationViewModel.TeamAllocationRAVM>() .ForMember(t => t.Members, opt => opt.Ignore()); Mapper.CreateMap<ResourceAllocation, ResourceAllocationViewModel.TeamAllocationRAVM.MonthRAVM>(); Mapper.CreateMap<Employee, StatusMvc.Models.ResourceAllocationViewModel.TeamAllocationRAVM.UserRAVM>(); }