public IEnumerable <CustomerModel> GetCustomers() { MyContext context = new MyContext(); return(projector.ProjectTo <CustomerModel>(context.Customers)); }
//I renamed this SelectTo instead of ProjectTo so you don't have any conflict if you use AutoMapper //Change it to to ProjectTo if you want public static IQueryable <TDestination> SelectTo <TDestination>(this IQueryable source, params Expression <Func <TDestination, object> >[] membersToExpand) { return(projector.ProjectTo <TDestination>(source)); }