Beispiel #1
0
 /// <summary>
 /// Dictionary to parameter
 /// 字典转换为参数
 /// </summary>
 /// <typeparam name="K">Generic key type</typeparam>
 /// <typeparam name="V">Generic value type</typeparam>
 /// <param name="dic">Dictionary</param>
 /// <param name="keyType">Key type</param>
 /// <param name="valueType">Value type</param>
 /// <param name="keyMaxLength">Char/byte key max length</param>
 /// <param name="valueMaxLength">Char/byte value max length</param>
 /// <param name="tvpFunc">TVP building function</param>
 /// <returns>Result</returns>
 public override object DictionaryToParameter <K, V>(Dictionary <K, V> dic, DbType keyType, DbType valueType, long?keyMaxLength = null, long?valueMaxLength = null, Func <SqlDbType, SqlDbType, string>?tvpFunc = null)
     where K : struct
     where V : struct
 {
     return(SqlServerUtils.DictionaryToTVP(dic, keyType, valueType, keyMaxLength, valueMaxLength, tvpFunc));
 }
Beispiel #2
0
 /// <summary>
 /// Guid items to parameters
 /// 转换Guid项目为TVP参数
 /// </summary>
 /// <param name="items">Items</param>
 /// <param name="maxLength">Item max length</param>
 /// <param name="tvpFunc">TVP building function</param>
 /// <returns>Result</returns>
 public override object GuidItemsToParameter(IEnumerable <GuidItem> items, long?maxLength = null, Func <string>?tvpFunc = null)
 {
     return(SqlServerUtils.GuidItemsToParameter(items, maxLength, tvpFunc));
 }
Beispiel #3
0
 /// <summary>
 /// List to parameter
 /// 列表转换为参数
 /// </summary>
 /// <typeparam name="T">Generic item type</typeparam>
 /// <param name="list">List</param>
 /// <param name="type">DbType</param>
 /// <param name="maxLength">Char/byte item max length</param>
 /// <param name="tvpFunc">TVP building function</param>
 /// <returns>Result</returns>
 public override object ListToParameter(IEnumerable list, DbType type, long?maxLength = null, Func <SqlDbType, string>?tvpFunc = null)
 {
     return(SqlServerUtils.ListToTVP(list, type, maxLength, tvpFunc));
 }