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

Support data annotations for POCO mapping #17

Closed
VitaliyMF opened this issue Sep 17, 2016 · 2 comments
Closed

Support data annotations for POCO mapping #17

VitaliyMF opened this issue Sep 17, 2016 · 2 comments

Comments

@VitaliyMF
Copy link
Contributor

DbDataAdapter Select/Insert/Update methods: handle System.ComponentModel.DataAnnotations.Schema.ColumnAttribute (NotMappedAttribute, DatabaseGenerated)

I think DbDataAdapter.Select(Query, IDictionary<string,string> fldMap) should be removed: custom mapping will be covered by DbDataAdapter for typed POCO in #13 .

Lets add RecordSet.FromList(IList list) method that will automatically infer RecordSet schema from poco. It should handle KeyAttribute, ColumnAttribute, NotMappedAttribute, DatabaseGeneratedAttribute.

@VitaliyMF VitaliyMF added this to the 1.0-alpha6 milestone Sep 17, 2016
VitaliyMF added a commit that referenced this issue Sep 17, 2016
… performs mapping + fix issue with SelectQuery.Single/ToList for types without default constructor (like string)
@VitaliyMF
Copy link
Contributor Author

Progress:

  • refactored code that performs POCO mapping (DataMapper class).
  • increased mapping performance (getters / setters are cached)
  • removed overloads that accept IDicitonary<string,string> map for field (data annotations should be used instead)

Still TODO:

  • Change DbDataAdapter Insert / Update signatures (incompatible API changes, but for alpha this is ok). They should use TableAttribute for poco object, if specified.
  • RecordSet.FromList(IList list)

@VitaliyMF
Copy link
Contributor Author

Done

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

No branches or pull requests

1 participant