- 优化 AsTable 自动分表,提供超始小时的设置;

This commit is contained in:
2881099
2023-03-01 15:44:04 +08:00
parent 27290ffa2e
commit e4d343937e
3 changed files with 209 additions and 12 deletions

View File

@ -113,7 +113,7 @@ namespace base_entity
public B B { get; set; }
}
[Table(Name = "as_table_log_{yyyyMM}", AsTable = "createtime=2022-1-1(1 month)")]
[Table(Name = "as_table_log_{yyyyMM}", AsTable = "createtime=2022-1-1 11(1 month)")]
class AsTableLog
{
public Guid id { get; set; }
@ -572,6 +572,11 @@ namespace base_entity
#endregion
fsql.UseJsonMap();
var atimpl = fsql.CodeFirst.GetTableByEntity(typeof(AsTableLog))
.AsTableImpl;
atimpl.GetTableNameByColumnValue(DateTime.Parse("2023-7-1"), autoExpand: true);
var dywhere = new DynamicFilterInfo { Field = "AspNetRoless.Name", Operator = DynamicFilterOperator.Equal, Value = "Admin" };
var method = typeof(ISelect<object>).GetMethod("WhereDynamicFilter");
var users4 = fsql.Select<AspNetUsers>().IncludeByPropertyName("AspNetUserRoless", then => then.WhereDynamicFilter(dywhere)).ToList();
@ -1086,10 +1091,10 @@ namespace base_entity
.ToList();
var atimpl = fsql.CodeFirst.GetTableByEntity(typeof(AsTableLog))
var atimpl2 = fsql.CodeFirst.GetTableByEntity(typeof(AsTableLog))
.AsTableImpl;
atimpl.GetTableNameByColumnValue(DateTime.Parse("2023-7-1"), autoExpand: true);
atimpl2.GetTableNameByColumnValue(DateTime.Parse("2023-7-1"), autoExpand: true);
fsql.Select<User1, UserGroup>()