Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 10 additions & 23 deletions FreeSql.Tests/FreeSql.Tests/FreeSql.Tests.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ class Topic
public TestTypeInfo Type { get; set; }
public string Title { get; set; }
public DateTime CreateTime { get; set; }
public DateTime? UpdateTime { get; set; }
}
class TestTypeInfo
{
Expand Down Expand Up @@ -2054,6 +2055,16 @@ public void ToTreeList()
.AsTreeCte().Any());
}

[Fact]
public void WithMemoryTest()
{
var fsql = g.pgsql;
var topics = new List<Topic>() { new Topic { Id = 1, CreateTime = new DateTime(1900, 1, 1), UpdateTime = new DateTime(1900, 1, 2) } };
var sql = fsql.Select<Topic>().WithMemory(topics).ToSql();
Assert.Equal(@"SELECT a.""id"", a.""clicks"", a.""typeguid"", a.""title"", a.""createtime"", a.""updatetime""
FROM ( SELECT 1 as ""id"", 0 as ""clicks"", 0 as ""typeguid"", NULL::varchar as ""title"", '1900-01-01 00:00:00.000000'::timestamp as ""createtime"", '1900-01-02 00:00:00.000000'::timestamp as ""updatetime"" ) a", sql);
}

[Table(Name = "D_District")]
public class BaseDistrict
{
Expand Down
Loading