mappingService below is actually just Automapper. I have a wrapper around it so that I can inject it.I want to refactor the following code to be cleaner: public class DropDownListService : IDropDownListService{    private readonly IMappingService _mappingService;    private readonly ICompanyRepository _companyRepository;    private readonly IProjectTypeRepository _projectTypeRepository;    private readonly IStatusRepository _statusRepository;    private readonly IProjectManagerRepository _projectManagerRepository;    private readonly IProjectArchitectRepository _projectArchitectRepository;    private readonly IFeeTypeRepository _feeTypeRepository;    private readonly IStateRepository _stateRepository;    private readonly IPersonTypeRepository _personTypeRepository;    public DropDownListService(IMappingService mappingService, ICompanyRepository companyRepository, IProjectTypeRepository projectTypeRepository, IStatusRepository statusRepository, IProjectManagerRepository projectManagerRepository, IProjectArchitectRepository projectArchitectRepository, IFeeTypeRepository feeTypeRepository, IStateRepository stateRepository, IPersonTypeRepository personTypeRepository)    {        _mappingService = mappingService;        _companyRepository = companyRepository;        _projectTypeRepository = projectTypeRepository;        _statusRepository = statusRepository;        _projectManagerRepository = projectManagerRepository;        _projectArchitectRepository = projectArchitectRepository;        _feeTypeRepository = feeTypeRepository;        _stateRepository = stateRepository;        _personTypeRepository = personTypeRepository;    }    public IEnumerable<IDropDownList> RetrieveCompanies()    {        return _mappingService.Map(_companyRepository.GetAll(), new List<Company>());    }    public IEnumerable<IDropDownList> RetrieveJobTypes()    {        return _mappingService.Map(_projectTypeRepository.GetAll(), new List<ProjectType>());    }    public IEnumerable<IDropDownList> RetrieveStatuses()    {        return _mappingService.Map(_statusRepository.GetAll(), new List<Status>());    }    public IEnumerable<IDropDownList> RetrieveProjectManagers()    {        return _mappingService.Map(_projectManagerRepository.GetAll(), new List<ProjectManager>());    }    public IEnumerable<IDropDownList> RetrieveProjectArchitects()    {        return _mappingService.Map(_projectArchitectRepository.GetAll(), new List<ProjectArchitect>());    }    public IEnumerable<IDropDownList> RetrieveFeeTypes()    {        return _mappingService.Map(_feeTypeRepository.GetAll(), new List<FeeType>());    }    public IEnumerable<IDropDownList> RetrievePhases()    {        return _mappingService.Map(_feeTypeRepository.GetAll(), new List<Phase>());    }    public IEnumerable<IDropDownList> RetrieveStates()    {        return _mappingService.Map(_stateRepository.GetAll(), new List<State>());    }    public IEnumerable<IDropDownList> RetrievePeopleTypes()    {        return _mappingService.Map(_personTypeRepository.GetAll(), new List<PersonType>());    }    public IEnumerable<IDropDownList> RetrieveMarkets()    {        return _mappingService.Map(_marketRepostiory.GetAll(), new List<Market>());    }}As you can see I am injecting way too many things into this controller. I am not currently doing a spa application so I cannot do this separately on the presentation layer. What I would really like to do is use generics. The problem is, the DB value that is returned to me looks like this:    public int StateID { get; set; }    public string StateName { get; set; }Each entity has the ID field and the name field only they are named for the table. I am unable to write one map (as far as I know how) with automapper to map them to the correct type.How can I clean this class up?      
Converting a DropDownList retrieval service to generics or delegate methods
c#;generics
I may have gotten your question wrong... Will the following implementation work for you? Can you show how your IMappingService looks like?public interface IRepository<T>{    IEnumerable<T> GetAll();}public interface ICompanyRepository : IRepository<Company> { }public class DropDownListService<T> : IDropDownListService{    private readonly IMappingService _mappingService;    private readonly IRepository<T> _repository;    public DropDownListService(IMappingService mappingService, IRepository<T> repository)    {        _mappingService = mappingService;        _repository = repository;    }    public IEnumerable<IDropDownList> RetrieveDropDownList()    {        return _mappingService.Map(_repository.GetAll(), new List<T>());    }}