mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-06-19 12:28:15 +08:00
修复使用 virtual 后实体序列化问题 #5
This commit is contained in:
@ -32,6 +32,47 @@ namespace FreeSql.Tests.Sqlite {
|
||||
public List<TestTypeInfo> Types { get; set; }
|
||||
}
|
||||
|
||||
public partial class Song {
|
||||
[Column(IsIdentity = true)]
|
||||
public int Id { get; set; }
|
||||
public DateTime? Create_time { get; set; }
|
||||
public bool? Is_deleted { get; set; }
|
||||
public string Title { get; set; }
|
||||
public string Url { get; set; }
|
||||
|
||||
public virtual ICollection<Tag> Tags { get; set; }
|
||||
}
|
||||
public partial class Song_tag {
|
||||
public int Song_id { get; set; }
|
||||
public virtual Song Song { get; set; }
|
||||
|
||||
public int Tag_id { get; set; }
|
||||
public virtual Tag Tag { get; set; }
|
||||
}
|
||||
public partial class Tag {
|
||||
[Column(IsIdentity = true)]
|
||||
public int Id { get; set; }
|
||||
public int? Parent_id { get; set; }
|
||||
public virtual Tag Parent { get; set; }
|
||||
|
||||
public decimal? Ddd { get; set; }
|
||||
public string Name { get; set; }
|
||||
|
||||
public virtual ICollection<Song> Songs { get; set; }
|
||||
public virtual ICollection<Tag> Tags { get; set; }
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Lazy() {
|
||||
var tags = g.sqlite.Select<Tag>().Where(a => a.Parent.Name == "xxx")
|
||||
.LeftJoin(a => a.Parent_id == a.Parent.Id)
|
||||
.ToSql();
|
||||
|
||||
var songs = g.sqlite.Select<Song>().Limit(10).ToList();
|
||||
|
||||
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ToList() {
|
||||
}
|
||||
|
Reference in New Issue
Block a user