-
Notifications
You must be signed in to change notification settings - Fork 3
Description
Is your feature request related to a problem? Please describe.
I have some code to convert a type (User) into a more obscure type (PublicUser). The two classes are basically the same, except that PublicUser does not have an email field.
Now, I am adding in some tests and realize that my process may be something that could be moved into TypeManager.
Describe the solution you'd like
Ideally, I could list two types, and the field data from the original object would be applied to the newly created converted representation, which the non-applicable fields removed. I figure this process could also take in an object to populate any new fields.
Describe alternatives you've considered
My current process is pretty simple. I serialize the original object, then deserialize it into the target type via TypeManager. That said, I still have to manually scrub the undesired fields.
Additional context
To be honest, all I really need is a way to get a property list so that I can make my convertType helper automatically scrub the undesired fields. That said, I figured I'd ask about adding convertType into TypeManager.