I'd like to create a wrapper API for active directory which has a member function which accepts a structure as a parameter and outputs the structure as the return value.

The structure would be customized by the developer who is using the API to include only data members which the developer requires. I'd like the member function to determine what data members the structure contains and, thus, which data to pull from the active directory. (I figure this will speed processing time as the developer using the API will only have to make one trip to the member function and get all the required data at once.)

I figure that the member function will accept a parameter of type object to represent the structure and use reflection to determine what data members it contains.

Has anyone done anything like this