mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-06-18 20:08:15 +08:00
- fix string[] UseJsonMap bug;#653
This commit is contained in:
@ -312,6 +312,11 @@ namespace base_entity
|
||||
{
|
||||
public DateTime Date { get; set; }
|
||||
}
|
||||
record TestClass(string Name)
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public string[] Tags { get; init; } = Array.Empty<string>();
|
||||
}
|
||||
static void Main(string[] args)
|
||||
{
|
||||
#region 初始化 IFreeSql
|
||||
@ -361,6 +366,23 @@ namespace base_entity
|
||||
BaseEntity.Initialization(fsql, () => _asyncUow.Value);
|
||||
#endregion
|
||||
|
||||
|
||||
fsql.UseJsonMap();
|
||||
|
||||
fsql.CodeFirst.ConfigEntity<TestClass>(cf =>
|
||||
{
|
||||
cf.Property(p => p.Name).IsNullable(false);
|
||||
cf.Property(p => p.Tags).JsonMap();
|
||||
});
|
||||
|
||||
fsql.Insert(new TestClass("test 1")
|
||||
{
|
||||
Tags = new[] { "a", "b" },
|
||||
})
|
||||
.ExecuteAffrows();
|
||||
var records = fsql.Queryable<TestClass>().ToList();
|
||||
|
||||
|
||||
InitData();
|
||||
InitData();
|
||||
|
||||
|
Reference in New Issue
Block a user