update

2881099
2020-12-21 23:32:21 +08:00
parent 8464ffc22f
commit e7db520fb7
2 changed files with 20 additions and 0 deletions

@@ -228,6 +228,25 @@ fsql.Insert(new Type()).ExecuteAffrows();
//INSERT INTO `type`(`Name`) VALUES('xxx')
```
## 自定义重写(RewriteSql)、重读(RereadSql)
写入时重写 SQL、读取时重写 SQL适合 geography 类型的读写场景。
```csharp
[Column(
DbType = "geography",
RewriteSql = "geography::STGeomFromText({0}, 4236)",
RereadSql = "{0}.STAsText()"
)]
public string geo { get; set; }
//插入INSERT INTO [ts_geocrud01]([id], [geo]) VALUES(@id_0, geography::STGeomFromText(@geo_0, 4236))
//查询SELECT TOP 1 a.[id], a.[geo].STAsText()
//FROM [ts_geocrud01] a
//WHERE (a.[id] = 'c7227d5e-0bcf-4b71-8f0f-d69a552fe84e')
```
## 名称
FreeSql 默认使用实体的类名,或属性名与数据库映射,也可以指定映射的名称;

@@ -5,6 +5,7 @@
> 安装前添加源https://www.myget.org/F/ncc/api/v3/index.json
- 增加 Column 特性 RewriteSql/RereadSql
- 修复 延时属性时级联保存失败的 bug
- 修复 分组查询后,无法使用子查询的问题;
- 修复 UseGenerateCommandParameterWithLambda + Enum + MapType(string) bug