修正命名 NaviteTuple 为 NativeTuple

This commit is contained in:
28810
2020-08-02 13:38:23 +08:00
parent 688f754036
commit 552926dd96
41 changed files with 407 additions and 336 deletions

View File

@ -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);
}