So, I have been using AutoMapper with the IQueryable extensions to select some really simple viewmodels for list views. This allows me to not load up an entire entity framework object, but I have ran into a little bit of a less than ideal situation where I need to pull a simple viewmodel for a single complex object.
userQuery.Where(u => u.Id == id).ProjectTo<SimpleUserViewModel>().FirstOrDefault();
I could do a normal AutoMapper.Map, but this pulls in the whole object and child objects, when I may only need a single property off of the child and I don't want to eat the database retrieval cost.
Is there a better way of approaching this for getting a single entity and emitting a select through entity framework for only grabbing the necessary objects?