mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-06-18 20:08:15 +08:00
- 修复 InsertValueSql 在仓储插入后不返回最新值;
This commit is contained in:
@ -6,6 +6,7 @@ using FreeSql.Internal.Model;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System;
|
||||
using System.Collections.Concurrent;
|
||||
using System.Collections.Generic;
|
||||
using System.Data.Odbc;
|
||||
using System.Data.SqlClient;
|
||||
@ -230,6 +231,31 @@ namespace base_entity
|
||||
CouponIds = a.CouponIds
|
||||
});
|
||||
|
||||
int LocalConcurrentDictionaryIsTypeKey(Type dictType, int level = 1)
|
||||
{
|
||||
if (dictType.IsGenericType == false) return 0;
|
||||
if (dictType.GetGenericTypeDefinition() != typeof(ConcurrentDictionary<,>)) return 0;
|
||||
var typeargs = dictType.GetGenericArguments();
|
||||
if (typeargs[0] == typeof(Type) || typeargs[0] == typeof(ColumnInfo) || typeargs[0] == typeof(TableInfo)) return level;
|
||||
if (level > 2) return 0;
|
||||
return LocalConcurrentDictionaryIsTypeKey(typeargs[1], level + 1);
|
||||
}
|
||||
|
||||
var fds = typeof(FreeSql.Internal.Utils).GetFields(BindingFlags.Static | BindingFlags.NonPublic | BindingFlags.Public)
|
||||
.Where(a => LocalConcurrentDictionaryIsTypeKey(a.FieldType) > 0).ToArray();
|
||||
var ttypes1 = typeof(IFreeSql).Assembly.GetTypes().Select(a => new
|
||||
{
|
||||
Type = a,
|
||||
ConcurrentDictionarys = a.GetFields(BindingFlags.Static | BindingFlags.NonPublic | BindingFlags.Public)
|
||||
.Where(b => LocalConcurrentDictionaryIsTypeKey(b.FieldType) > 0).ToArray()
|
||||
}).Where(a => a.ConcurrentDictionarys.Length > 0).ToArray();
|
||||
var ttypes2 = typeof(IBaseRepository).Assembly.GetTypes().Select(a => new
|
||||
{
|
||||
Type = a,
|
||||
ConcurrentDictionarys = a.GetFields(BindingFlags.Static | BindingFlags.NonPublic | BindingFlags.Public)
|
||||
.Where(b => LocalConcurrentDictionaryIsTypeKey(b.FieldType) > 0).ToArray()
|
||||
}).Where(a => a.ConcurrentDictionarys.Length > 0).ToArray();
|
||||
|
||||
#region pgsql poco
|
||||
// fsql.Aop.ParseExpression += (_, e) =>
|
||||
// {
|
||||
|
Reference in New Issue
Block a user