mirror of
				https://github.com/nsnail/FreeSql.git
				synced 2025-11-04 09:15:27 +08:00 
			
		
		
		
	- 增加 实体属性 char 类型的映射#381 #235;
This commit is contained in:
		@@ -44,6 +44,7 @@ namespace FreeSql.PostgreSQL
 | 
			
		||||
            { typeof(ushort).FullName, a => int.Parse(string.Concat(a)) }, { typeof(ushort[]).FullName, a => getParamterArrayValue(typeof(int), a, 0) }, { typeof(ushort?[]).FullName, a => getParamterArrayValue(typeof(int?), a, null) },
 | 
			
		||||
            { typeof(byte).FullName, a => short.Parse(string.Concat(a)) }, { typeof(byte[]).FullName, a => getParamterArrayValue(typeof(short), a, 0) }, { typeof(byte?[]).FullName, a => getParamterArrayValue(typeof(short?), a, null) },
 | 
			
		||||
            { typeof(sbyte).FullName, a => short.Parse(string.Concat(a)) }, { typeof(sbyte[]).FullName, a => getParamterArrayValue(typeof(short), a, 0) }, { typeof(sbyte?[]).FullName, a => getParamterArrayValue(typeof(short?), a, null) },
 | 
			
		||||
            { typeof(char).FullName, a => string.Concat(a).Replace('\0', ' ').ToCharArray().FirstOrDefault() }, 
 | 
			
		||||
 | 
			
		||||
            { typeof(NpgsqlPath).FullName, a => {
 | 
			
		||||
                var path = (NpgsqlPath)a;
 | 
			
		||||
@@ -70,6 +71,7 @@ namespace FreeSql.PostgreSQL
 | 
			
		||||
        static object getParamterValue(Type type, object value, int level = 0)
 | 
			
		||||
        {
 | 
			
		||||
            if (type.FullName == "System.Byte[]") return value;
 | 
			
		||||
            if (type.FullName == "System.Char[]") return value;
 | 
			
		||||
            if (type.IsArray && level == 0)
 | 
			
		||||
            {
 | 
			
		||||
                var elementType = type.GetElementType();
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user