Cleanest Way To Map Entity To DTO With Linq Select?
Just use AutoMapper. Example: Mapper.CreateMap<Address, AddressDTO>(); Mapper.CreateMap<Person, PersonDTO>(); Your query will execute when the mapping is performed but if there are fields in the entity that you’re not interested use Project().To<> which is available both for NHibernate and EntityFramework. It will effectively do a select on the fields specified in the mapping configurations.