- fix string[] UseJsonMap bug;#653

This commit is contained in:
2881099
2022-08-09 09:47:43 +08:00
parent 976fa15879
commit 26b562410c
3 changed files with 63 additions and 28 deletions

View File

@ -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();