Update README.md

This commit is contained in:
果糖网 2021-11-09 02:54:19 +08:00 committed by GitHub
parent 8e1a0d1940
commit 6d01efcdc9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -168,8 +168,8 @@ x.AsInsertable.ExecuteCommand();
``` ```
### Feature8 Auto split table ### Feature8 Auto split table
Split entity
```cs ```cs
//entity
[SplitTable(SplitType.Year)]//Table by year (the table supports year, quarter, month, week and day) [SplitTable(SplitType.Year)]//Table by year (the table supports year, quarter, month, week and day)
[SugarTable("SplitTestTable_{year}{month}{day}")] [SugarTable("SplitTestTable_{year}{month}{day}")]
public class SplitTestTable public class SplitTestTable
@ -178,14 +178,17 @@ x.AsInsertable.ExecuteCommand();
public long Id { get; set; } public long Id { get; set; }
public string Name { get; set; } public string Name { get; set; }
[SplitField]
//When the sub-table field is inserted, which table will be inserted according to this field. //When the sub-table field is inserted, which table will be inserted according to this field.
//When it is updated and deleted, it can also be convenient to use this field to //When it is updated and deleted, it can also be convenient to use this field to
//find out the related table //find out the related table
[SplitField]
public DateTime CreateTime { get; set; } public DateTime CreateTime { get; set; }
} }
//split query ```
Split query
```cs
var lis2t = db.Queryable<OrderSpliteTest>() var lis2t = db.Queryable<OrderSpliteTest>()
.SplitTable(DateTime.Now.Date.AddYears(-1), DateTime.Now) .SplitTable(DateTime.Now.Date.AddYears(-1), DateTime.Now)
.ToPageList(1,2);  .ToPageList(1,2); 
``` ```