Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert objects #4

Open
ygoe opened this issue Nov 22, 2018 · 1 comment
Open

Convert objects #4

ygoe opened this issue Nov 22, 2018 · 1 comment

Comments

@ygoe
Copy link
Owner

ygoe commented Nov 22, 2018

DeepConvert should be able to convert data between the following types:

  • Dictionary<string, object> – class { … } (with same dictionary keys and properties/fields)
  • class { … } – class { … } (with same property/field names)

Property/field names should be matched case-insensitively, unless that would be ambiguous. If a property/field is itself of a composite type, the conversion recurses into that property/field.

Only public properties/fields are regarded, but the type itself should not necessarily be public.

Reflection data about the involved types should be cached for better performance. This might be a with compiled expressions or Reflection.Emit.

ygoe added a commit that referenced this issue Aug 22, 2019
@ygoe
Copy link
Owner Author

ygoe commented Aug 22, 2019

Duck typing is now implemented.

These parts are still open:

  • Fields are not regarded, only properties
  • Possibly structs need special care (untested)
  • Property names are always case-insensitive, ambiguities are ignored (untested)
  • All classes and properties have to be public (might be impossible to change)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant