public static IEnumerable <D> GetAll(ReadOnlyRepository <S> repo) { var items = repo.GetAll().ToList(); if (items.Any()) { var model = Mapper.Map <List <S>, List <D> >(items); return(model); } return(null); }