mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-06-18 20:08:15 +08:00
修正命名 NaviteTuple 为 NativeTuple
This commit is contained in:
@ -78,19 +78,19 @@ namespace FreeSql
|
||||
protected virtual void OnModelCreating(ICodeFirst codefirst) { }
|
||||
|
||||
#region Set
|
||||
static ConcurrentDictionary<Type, NaviteTuple<PropertyInfo[], bool>> _dicGetDbSetProps = new ConcurrentDictionary<Type, NaviteTuple<PropertyInfo[], bool>>();
|
||||
static ConcurrentDictionary<Type, NativeTuple<PropertyInfo[], bool>> _dicGetDbSetProps = new ConcurrentDictionary<Type, NativeTuple<PropertyInfo[], bool>>();
|
||||
internal void InitPropSets()
|
||||
{
|
||||
var thisType = this.GetType();
|
||||
var dicval = _dicGetDbSetProps.GetOrAdd(thisType, tp =>
|
||||
NaviteTuple.Create(
|
||||
NativeTuple.Create(
|
||||
tp.GetProperties(BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.Public)
|
||||
.Where(a => a.PropertyType.IsGenericType &&
|
||||
a.PropertyType == typeof(DbSet<>).MakeGenericType(a.PropertyType.GetGenericArguments()[0])).ToArray(),
|
||||
false));
|
||||
if (dicval.Item2 == false)
|
||||
{
|
||||
if (_dicGetDbSetProps.TryUpdate(thisType, NaviteTuple.Create(dicval.Item1, true), dicval))
|
||||
if (_dicGetDbSetProps.TryUpdate(thisType, NativeTuple.Create(dicval.Item1, true), dicval))
|
||||
OnModelCreating(OrmOriginal.CodeFirst);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user