I have a class User.
I have created a generic CSV exporter that works on any type IEnumerable. It checks the class and exports all of its properties.
In the class User i dont want some of the properties to export (like password etc).
I know there is a mapper of some kind that allows to create a temp class and define the properties from the original class… i cant seem to find any exaple.
regards !
If you want to project an
IEnumerable<User>(let’s call ituserList) to a newIEnumerablewith only some of the properties:Now
querywill be anIEnumerable<'a>(anonymous type) which only contains theName,AddressandPhoneproperties from yourUserobjects.