Rop.Dapper.ContribEx9 1.0.10

There is a newer version of this package available.
See the version list below for details.
dotnet add package Rop.Dapper.ContribEx9 --version 1.0.10                
NuGet\Install-Package Rop.Dapper.ContribEx9 -Version 1.0.10                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Rop.Dapper.ContribEx9" Version="1.0.10" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Rop.Dapper.ContribEx9 --version 1.0.10                
#r "nuget: Rop.Dapper.ContribEx9, 1.0.10"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Rop.Dapper.ContribEx9 as a Cake Addin
#addin nuget:?package=Rop.Dapper.ContribEx9&version=1.0.10

// Install Rop.Dapper.ContribEx9 as a Cake Tool
#tool nuget:?package=Rop.Dapper.ContribEx9&version=1.0.10                

Rop.Dapper.ContribEx9

Features

Rop.Dapper.ContribEx9 includes a DapperHelperExtend class to access to hidden information about classes and their attributes.

Rop.Dapper.ContribEx9 adds more helper methods for inserting, getting, updating and deleting records.

DapperHelperExtend

The full list of helpers for hidden information are:

List<PropertyInfo> ExplicitKeyPropertiesCache(Type type);
List<PropertyInfo> KeyPropertiesCache(Type type);
List<PropertyInfo> TypePropertiesCache(Type type);
List<PropertyInfo> ComputedPropertiesCache(Type type);
ISqlAdapter GetFormatter(IDbConnection connection);
IEnumerable<string> GetColumnNames(IEnumerable<PropertyInfo> props);
string GetTableName(Type type);
string GetForeignDatabaseName(Type type);
string SelectGetCache(Type type);
string SelectGetAllCache(Type type);
string SelectGetSlimCache(Type type);
string SelectGetAllSlimCache(Type type);
string DeleteByKeyCache(Type type);

The full list of helpers for class/table/key information are:

(PropertyInfo propkey, bool isautokey) GetSingleKey(Type t);
KeyDescription GetKeyDescription(Type t);
KeyDescription GetKeyDescription<T>();
object GetKeyValue<T>(T item);
SetKeyValue<T>(T item, object value);
(KeyDescription keydescription, object value) GetKeyDescriptionAndValue<T>(T item);

The full list of helpers to format list of keys are:

string GetIdList(IEnumerable<int> ids);
string GetIdList(IEnumerable<string> ids);
string GetIdListDyn(IEnumerable ids);

Miscellaneous helpers:

string GetMemberName<T>(this Expression<T> expression);

ConnectionHelper

The full list of extension methods in ConnectionHelper are:

Delete methods

 bool DeleteByKey<T>(this IDbConnection conn, dynamic id, IDbTransaction tr = null, int? commandTimeout = null);
 bool Delete<T>(this IDbConnection conn, IDbTransaction tr, dynamic key, int? commandTimeout = null);
 Task<bool> DeleteByKeyAsync<T>(this IDbConnection conn, dynamic id, IDbTransaction tr = null, int? commandTimeout = null);
 Task<bool> DeleteAsync<T>(this IDbConnection conn, IDbTransaction tr, dynamic key,int? commandTimeout=null);

GetSlim methods

T GetSlim<T>(this IDbConnection connection, dynamic id, IDbTransaction transaction = null, int? commandTimeout = null);
IEnumerable<T> GetAllSlim<T>(this IDbConnection connection, IDbTransaction transaction = null, int? commandTimeout = null);
List<T> GetSomeSlim<T>(this IDbConnection conn, IEnumerable ids, IDbTransaction tr = null);
List<T> GetWhereSlim<T>(this IDbConnection conn, string where, object param=null, IDbTransaction tr = null);
Task<T> GetSlimAsync<T>(this IDbConnection connection, dynamic id, IDbTransaction transaction = null, int? commandTimeout = null);
Task<IEnumerable<T>> GetAllSlimAsync<T>(this IDbConnection connection, IDbTransaction transaction = null, int? commandTimeout = null);

GetSome methods

List<T> GetSome<T>(this IDbConnection conn, IEnumerable ids, IDbTransaction tr = null, int? commandTimeout = null);
List<T> GetWhere<T>(this IDbConnection conn, string where, object param=null, IDbTransaction tr = null, int? commandTimeout = null);
IEnumerable<(dynamic id, T value)> QueryIdValue<TA, T>(this IDbConnection conn, string field, string where, object param=null, IDbTransaction tr = null, int? commandTimeout = null);
IEnumerable<(dynamic id, A valueA, B valueB)> QueryIdValue<TA, A, B>(this IDbConnection conn, string fieldA, string fieldB, string where, object param=null, IDbTransaction tr = null, int? commandTimeout = null);
IEnumerable<(dynamic id, T value)> GetIdValues<TA, T>(this IDbConnection conn, IEnumerable ids, string field, IDbTransaction tr = null,int? commandtimeout=null);
IEnumerable<(dynamic id, A valueA, B valueB)> GetIdValues<TA, A, B>(this IDbConnection conn, IEnumerable ids, string fieldA, string fieldB, IDbTransaction tr = null,int? commandtimeout=null);
Task<List<T>> GetSomeAsync<T>(this IDbConnection conn, IEnumerable ids, IDbTransaction tr = null,int? timeout=null);
Task<List<T>> GetWhereAsync<T>(this IDbConnection conn, string where, object param=null, IDbTransaction tr = null,int? timeout=null);
Task<IEnumerable<(dynamic id, T value)>> QueryIdValueAsync<TA, T>(this IDbConnection conn, string field, string where, object param=null, IDbTransaction tr = null,int? timeout=null);
Task<IEnumerable<(dynamic id, A valueA, B valueB)>> QueryIdValueAsync<TA, A, B>(this IDbConnection conn, string fieldA, string fieldB, string where, object param=null, IDbTransaction tr = null,int? timeout=null);
Task<List<(dynamic id, T value)>> GetIdValuesAsync<TA, T>(this IDbConnection conn, IEnumerable ids, string field, IDbTransaction tr = null,int? timeout=null);
Task<List<(dynamic id, A valueA, B valueB)>> GetIdValuesAsync<TA, A, B>(this IDbConnection conn, IEnumerable ids, string fieldA, string fieldB, IDbTransaction tr = null,int? timeout=null);      

Insert or Update methods

int InsertOrUpdate<T>(this IDbConnection conn, T item, IDbTransaction tr = null,int? timeout=null);
bool UpdateIdValue<TA, T>(this IDbConnection conn, (dynamic id, T value) value, string field, IDbTransaction tr = null, int? timeout = null);
bool UpdateIdValue<TA, T>(this IDbConnection conn, dynamic id, T value, string field, IDbTransaction tr = null, int? timeout = null);
Task<int> InsertOrUpdateAsync<T>(this IDbConnection conn, T item, IDbTransaction tr = null,int? timeout=null);
Task<bool> UpdateIdValueAsync<TA, T>(this IDbConnection conn, (dynamic id, T value) value, string field, IDbTransaction tr = null,int? timeout=null);
Task<bool> UpdateIdValueAsync<TA, T>(this IDbConnection conn, dynamic id, T value, string field, IDbTransaction tr = null, int? timeout = null);

Complex methods

 List<T> QueryJoin<T, M>(this IDbConnection conn, string query, object param, Action<T, M> join, IDbTransaction tr = null);

PartialKey methods

bool DeletePartialKey<T>(this IDbConnection conn, T item, IDbTransaction tr = null, int? commandTimeout = null);
IEnumerable<T> GetPartial<T>(this IDbConnection connection, dynamic id, IDbTransaction? transaction = null, int? commandTimeout = null);
(T,M1[]) GetLeftJoin<T,M1>(this IDbConnection connection,dynamic id, IDbTransaction? transaction = null, int? commandTimeout = null);
(T,M1[],M2[]) GetLeftJoin<T,M1,M2>(this IDbConnection connection,dynamic id, IDbTransaction? transaction = null, int? commandTimeout = null);
(T,M1[],M2[],M3[]) GetLeftJoin<T,M1,M2,M3>(this IDbConnection connection,dynamic id, IDbTransaction? transaction = null, int? commandTimeout = null);

(C)2022 Ramón Ordiales Plaza

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.21 43 2/7/2025
1.0.20 37 2/7/2025
1.0.19 40 2/7/2025
1.0.18 34 2/7/2025
1.0.17 38 1/14/2025
1.0.16 36 1/14/2025
1.0.15 44 1/13/2025
1.0.14 43 1/13/2025
1.0.13 42 1/13/2025
1.0.12 47 1/13/2025
1.0.10 45 1/13/2025
1.0.9 42 1/13/2025
1.0.8 51 1/12/2025
1.0.7 53 1/12/2025
1.0.6 53 1/12/2025
1.0.5 39 1/9/2025
1.0.4 39 1/9/2025
1.0.3 33 1/9/2025
1.0.2 32 1/9/2025