mirror of
				https://github.com/nsnail/FreeSql.git
				synced 2025-11-04 09:15:27 +08:00 
			
		
		
		
	- 增加 fsql.Insert(Dictionary<string, object>) 无实体类插入方法;#481
This commit is contained in:
		@@ -31,6 +31,7 @@ namespace FreeSql.Internal.Model
 | 
			
		||||
        /// <returns></returns>
 | 
			
		||||
        public object GetDbValue(object obj)
 | 
			
		||||
        {
 | 
			
		||||
            if (Table.IsDictionaryType) return (obj as Dictionary<string, object>)?.TryGetValue(CsName, out var tryval) == true ? tryval : null;
 | 
			
		||||
            var dbval = Table.GetPropertyValue(obj, CsName);
 | 
			
		||||
            //if (ConversionCsToDb != null) dbval = ConversionCsToDb(dbval);
 | 
			
		||||
            if (Attribute.MapType != CsType) dbval = Utils.GetDataReaderValue(Attribute.MapType, dbval);
 | 
			
		||||
@@ -40,7 +41,11 @@ namespace FreeSql.Internal.Model
 | 
			
		||||
        /// 获取 obj.CsName 属性原始值(不经过 MapType)
 | 
			
		||||
        /// </summary>
 | 
			
		||||
        /// <param name="obj"></param>
 | 
			
		||||
        public object GetValue(object obj) => Table.GetPropertyValue(obj, CsName);
 | 
			
		||||
        public object GetValue(object obj)
 | 
			
		||||
        {
 | 
			
		||||
            if (Table.IsDictionaryType) return (obj as Dictionary<string, object>)?.TryGetValue(CsName, out var tryval) == true ? tryval : null;
 | 
			
		||||
            return Table.GetPropertyValue(obj, CsName);
 | 
			
		||||
        }
 | 
			
		||||
        /// <summary>
 | 
			
		||||
        /// 设置 obj.CsName 属性值
 | 
			
		||||
        /// </summary>
 | 
			
		||||
 
 | 
			
		||||
@@ -25,6 +25,7 @@ namespace FreeSql.Internal.Model
 | 
			
		||||
        public bool DisableSyncStructure { get; set; }
 | 
			
		||||
        public string Comment { get; internal set; }
 | 
			
		||||
        public bool IsRereadSql { get; internal set; }
 | 
			
		||||
        public bool IsDictionaryType { get; internal set; }
 | 
			
		||||
 | 
			
		||||
        public ColumnInfo VersionColumn { get; set; }
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user