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

DbDataAdapter for typed poco #13

Open
VitaliyMF opened this issue Sep 2, 2016 · 1 comment
Open

DbDataAdapter for typed poco #13

VitaliyMF opened this issue Sep 2, 2016 · 1 comment

Comments

@VitaliyMF
Copy link
Contributor

VitaliyMF commented Sep 2, 2016

It is possible to add DbDataAdapter for typed CRUD operations with POCO with methods:

class DbDataAdapter<T> {
 T LoadByKey(params object[] key);
 List<T> Load(QConditionNode condition);  // maybe this method should be protected ?..
 void Insert(T model);
 void Update(T model);
 void Delete(T model);
 void DeleteByKey(params object[] key);    
}
  • async methods

This implementation may effectively reuse DbCommand instances and perform POCO-mapping very fast by caching getters/setters.

@VitaliyMF
Copy link
Contributor Author

Not sure about class name, maybe Repository<T> is better?..

Also I think it is good idea to add List<T> Load(Expression<Func<T,bool>> predicate) for simple filtering by model properties.

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