mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-04-22 02:32:50 +08:00
- 增加 TableInfo.SetAsTable 自动分表的设置;
This commit is contained in:
parent
0de393169d
commit
5659e527ed
@ -584,6 +584,11 @@ namespace base_entity
|
|||||||
.OrderBy((a,b) => a.createtime)
|
.OrderBy((a,b) => a.createtime)
|
||||||
.ToSql();
|
.ToSql();
|
||||||
|
|
||||||
|
|
||||||
|
var table = fsql.CodeFirst.GetTableByEntity(typeof(AsTableLog));
|
||||||
|
//table.SetAsTable(null, table.ColumnsByCs[nameof(AsTableLog.createtime)]);
|
||||||
|
|
||||||
|
|
||||||
var testitems = new[]
|
var testitems = new[]
|
||||||
{
|
{
|
||||||
new AsTableLog{ msg = "msg01", createtime = DateTime.Parse("2022-1-1 13:00:11"), click = 1 },
|
new AsTableLog{ msg = "msg01", createtime = DateTime.Parse("2022-1-1 13:00:11"), click = 1 },
|
||||||
|
@ -32,6 +32,12 @@ namespace FreeSql.Internal.Model
|
|||||||
public ColumnInfo AsTableColumn { get; internal set; }
|
public ColumnInfo AsTableColumn { get; internal set; }
|
||||||
public ColumnInfo VersionColumn { get; set; }
|
public ColumnInfo VersionColumn { get; set; }
|
||||||
|
|
||||||
|
public void SetAsTable(IAsTable astable, ColumnInfo column)
|
||||||
|
{
|
||||||
|
AsTableImpl = astable;
|
||||||
|
AsTableColumn = column;
|
||||||
|
}
|
||||||
|
|
||||||
ConcurrentDictionary<string, TableRef> _refs { get; } = new ConcurrentDictionary<string, TableRef>(StringComparer.CurrentCultureIgnoreCase);
|
ConcurrentDictionary<string, TableRef> _refs { get; } = new ConcurrentDictionary<string, TableRef>(StringComparer.CurrentCultureIgnoreCase);
|
||||||
|
|
||||||
internal void AddOrUpdateTableRef(string propertyName, TableRef tbref)
|
internal void AddOrUpdateTableRef(string propertyName, TableRef tbref)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user