mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-04-22 10:42:52 +08:00
update readme
This commit is contained in:
parent
5b3820185f
commit
2dd937303b
@ -344,9 +344,17 @@ namespace FreeSql.Tests
|
||||
public bool IsLeaf { get; set; }
|
||||
}
|
||||
|
||||
public static int GetUNIX_TIMESTAMP() => 0;
|
||||
[Fact]
|
||||
public void Test1()
|
||||
{
|
||||
g.mysql.Aop.ParseExpression += new EventHandler<Aop.ParseExpressionEventArgs>((s, e) =>
|
||||
{
|
||||
if (e.Expression.NodeType == ExpressionType.Call && (e.Expression as MethodCallExpression).Method.Name == "GetUNIX_TIMESTAMP")
|
||||
e.Result = "UNIX_TIMESTAMP(NOW())";
|
||||
});
|
||||
var dkkdksdjgj = g.mysql.Select<TaskBuild>().Where(a => a.OptionsEntity04 > GetUNIX_TIMESTAMP()).ToSql();
|
||||
|
||||
var kdkdfm = g.sqlite.Select<AnswerQuestionnaire>()
|
||||
.Include(a => a.MedicalRecord)
|
||||
.ToSql();
|
||||
|
@ -65,7 +65,7 @@ IFreeSql fsql = new FreeSql.FreeSqlBuilder()
|
||||
.UseConnectionString(FreeSql.DataType.Sqlite,
|
||||
@"Data Source=|DataDirectory|\document.db;Pooling=true;Max Pool Size=10")
|
||||
.UseAutoSyncStructure(true) //自动同步实体结构到数据库
|
||||
.Build();
|
||||
.Build(); //请务必定义成 Singleton 单例模式
|
||||
|
||||
class Song {
|
||||
[Column(IsIdentity = true)]
|
||||
|
Loading…
x
Reference in New Issue
Block a user