- 优化 FluentApi 继承关系可直接 ConfigEntity<BaseEntity> 生效;#1144

This commit is contained in:
2881099
2022-06-03 16:09:20 +08:00
parent 8263379720
commit f842e213eb
7 changed files with 257 additions and 186 deletions

View File

@ -49,7 +49,7 @@ namespace FreeSql.DataAnnotations
public ColumnFluent Property(string proto)
{
if (_properties.TryGetValue(proto, out var tryProto) == false) throw new KeyNotFoundException(CoreStrings.NotFound_PropertyName(proto));
var col = _table._columns.GetOrAdd(tryProto.Name, name => new ColumnAttribute { Name = proto });
var col = _table._columns.GetOrAdd(tryProto.Name, name => new ColumnAttribute { });
return new ColumnFluent(col, tryProto, _entityType);
}
@ -136,7 +136,7 @@ namespace FreeSql.DataAnnotations
public ColumnFluent Property(string proto)
{
if (_properties.TryGetValue(proto, out var tryProto) == false) throw new KeyNotFoundException(CoreStrings.NotFound_PropertyName(proto));
var col = _table._columns.GetOrAdd(tryProto.Name, name => new ColumnAttribute { Name = proto });
var col = _table._columns.GetOrAdd(tryProto.Name, name => new ColumnAttribute { });
return new ColumnFluent(col, tryProto, typeof(T));
}