## v0.12.5

This commit is contained in:
28810
2019-11-25 22:33:44 +08:00
parent 20e06ef3a2
commit bfed0cd124
17 changed files with 21 additions and 27 deletions

View File

@ -107,8 +107,9 @@ namespace FreeSql
internal ConcurrentDictionary<string, EntityState> _statesInternal => _states;
TableInfo _tablePriv;
protected TableInfo _table => _tablePriv ?? (_tablePriv = _db.Orm.CodeFirst.GetTableByEntity(_entityType));
ColumnInfo[] _tableIdentitysPriv;
ColumnInfo[] _tableIdentitysPriv, _tableServerTimesPriv;
protected ColumnInfo[] _tableIdentitys => _tableIdentitysPriv ?? (_tableIdentitysPriv = _table.Primarys.Where(a => a.Attribute.IsIdentity).ToArray());
protected ColumnInfo[] _tableServerTimes => _tableServerTimesPriv ?? (_tableServerTimesPriv = _table.Primarys.Where(a => a.Attribute.ServerTime != DateTimeKind.Unspecified).ToArray());
protected Type _entityType = typeof(TEntity);
public Type EntityType => _entityType;
@ -125,6 +126,7 @@ namespace FreeSql
_entityType = entityType;
_tablePriv = newtb ?? throw new Exception("DbSet.AsType 参数错误,请传入正确的实体类型");
_tableIdentitysPriv = null;
_tableServerTimesPriv = null;
return this;
}