Open VitaliyMF opened 8 years ago
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); }
This implementation may effectively reuse DbCommand instances and perform POCO-mapping very fast by caching getters/setters.
Not sure about class name, maybe Repository<T> is better?..
Repository<T>
Also I think it is good idea to add List<T> Load(Expression<Func<T,bool>> predicate) for simple filtering by model properties.
List<T> Load(Expression<Func<T,bool>> predicate)
It is possible to add DbDataAdapter for typed CRUD operations with POCO with methods:
This implementation may effectively reuse DbCommand instances and perform POCO-mapping very fast by caching getters/setters.