-
Notifications
You must be signed in to change notification settings - Fork 1
Crud method reference
Adam O'Neil edited this page Jan 29, 2020
·
26 revisions
These are the public methods of abstract class SqlCrudProvider. Platform-specific packages surface these as extension methods of IDbConnection. Use this to get a feel for what Dapper.CX can do as well as quick access to the implementation.
- Task DeleteAsync<TIdentity> (IDbConnection connection, TIdentity id)
- Task<bool> ExistsAsync<TIdentity> (IDbConnection connection, TIdentity id)
- Task<bool> ExistsWhereAsync (IDbConnection connection, object criteria)
- Task<TModel> GetAsync<TIdentity> (IDbConnection connection, TIdentity identity)
- string GetDeleteStatement (Type modelType)
- Task<TModel> GetWhereAsync (IDbConnection connection, object criteria)
- Task<TIdentity> InsertAsync<TModel> (IDbConnection connection, TModel model, Action<TModel, SaveAction> onSave)
- Task<TIdentity> MergeAsync<TModel> (IDbConnection connection, TModel model, IEnumerable<string> keyProperties, ChangeTracker<TModel> changeTracker, Action<TModel, SaveAction> onSave)
- Task<TIdentity> MergeAsync<TModel> (IDbConnection connection, TModel model, ChangeTracker<TModel> changeTracker, Action<TModel, SaveAction> onSave)
- Task<TIdentity> SaveAsync<TModel> (IDbConnection connection, TModel model, ChangeTracker<TModel> changeTracker, Action<TModel, SaveAction> onSave)
- Task UpdateAsync<TModel> (IDbConnection connection, TModel model, ChangeTracker<TModel> changeTracker, Action<TModel, SaveAction> onSave)
- TIdentity GetIdentity<TModel> (TModel model)
- bool IsNew<TModel> (TModel model)
- string GetInsertStatement (Type modelType)
- string GetQuerySingleStatement (Type modelType)
- string GetQuerySingleWhereStatement (Type modelType, object criteria)
- string GetQuerySingleWhereStatement (Type modelType, IEnumerable<string> propertyNames)
- string GetQuerySingleWhereStatement (Type modelType, IEnumerable<PropertyInfo> properties)
- string GetUpdateStatement<TModel> (TModel model, ChangeTracker<TModel> changeTracker)
- ICustomGet Implement this on model classes when you want to override the SQL statement generated by GetQuerySingleStatement and GetQuerySingleWhereStatement. See the test CustomGetStatement and sample model class to see this in use.