Browse Source

Update demo

pull/14/head
sunkaixuna 3 years ago
parent
commit
74d490f965
  1. 9
      Src/Asp.Net/SqlServerTest/UnitTest/UCodeFirst.cs
  2. 5
      Src/Asp.Net/SqlSugar/Abstract/DbBindProvider/DbBindAccessory.cs

9
Src/Asp.Net/SqlServerTest/UnitTest/UCodeFirst.cs

@ -45,8 +45,17 @@ namespace OrmTest
{
}
db.CodeFirst.InitTables<UnitTableName>();
db.CodeFirst.InitTables<UnitGe>();
db.Insertable(new UnitGe() { geometry1 = "POINT (20 180)" }).ExecuteCommand();
var gelist=db.Queryable<UnitGe>().Select(it=>new { geometry1 = it.geometry1.ToString()}).ToList();
}
public class UnitGe
{
[SugarColumn(ColumnDataType = "geometry")]
public string geometry1 { get; set; }
}
[SugarTable("abp.UnitTableName","备注")]
public class UnitTableName
{

5
Src/Asp.Net/SqlSugar/Abstract/DbBindProvider/DbBindAccessory.cs

@ -84,7 +84,10 @@ namespace SqlSugar
{
keys.Add(dataReader.GetName(i));
var type = dataReader.GetFieldType(i);
sbTypes.Append(type.Name.Substring(0,2));
if (type != null)
{
sbTypes.Append(type.Name.Substring(0, 2));
}
}
types = sbTypes.ToString();
return keys;

Loading…
Cancel
Save