Browse Source

Update CodeFirst (DateOnly TimeOnly)

pull/31/head
sunkaixuan 2 years ago
parent
commit
7dc8ded2a8
  1. 8
      Src/Asp.NetCore2/SqlSugar/Abstract/EntityMaintenance/EntityMaintenance.cs

8
Src/Asp.NetCore2/SqlSugar/Abstract/EntityMaintenance/EntityMaintenance.cs

@ -346,6 +346,14 @@ namespace SqlSugar
{
continue;
}
if (column.DataType == null&& property != null&& property.PropertyType.Name.IsIn("TimeOnly"))
{
column.DataType = "time";
}
if (column.DataType == null && property != null && property.PropertyType.Name.IsIn("DateOnly"))
{
column.DataType = "date";
}
result.Columns.Add(column);
}
}

Loading…
Cancel
Save