From 3c1e616f0b8de964345b52e6022129247180c16f Mon Sep 17 00:00:00 2001
From: 28810 <28810@YEXIANGQIN>
Date: Wed, 11 Dec 2019 22:49:54 +0800
Subject: [PATCH] =?UTF-8?q?-=20=E5=A2=9E=E5=8A=A0=20FreeSql.Generator=20?=
=?UTF-8?q?=E5=AE=9E=E4=BD=93=E7=B1=BB=E7=94=9F=E6=88=90=E5=B7=A5=E5=85=B7?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
Extensions/FreeSql.Generator/ConsoleApp.cs | 2 +-
FreeSql/FreeSql.xml | 464 ++++++++++-----------
2 files changed, 226 insertions(+), 240 deletions(-)
diff --git a/Extensions/FreeSql.Generator/ConsoleApp.cs b/Extensions/FreeSql.Generator/ConsoleApp.cs
index 4e456fc5..16614070 100644
--- a/Extensions/FreeSql.Generator/ConsoleApp.cs
+++ b/Extensions/FreeSql.Generator/ConsoleApp.cs
@@ -218,7 +218,7 @@ new Colorful.Formatter("推荐在实体类目录创建 gen.bat,双击它重新
if (File.Exists(rebuildBat) == false)
{
File.WriteAllText(rebuildBat, @$"
-FreeSql.Generator -Razor {ArgsRazorRaw} - NameOptions {string.Join(",", ArgsNameOptions.Select(a => a ? 1 : 0))} -NameSpace {ArgsNameSpace} -DB ""{ArgsDbType},{ArgsConnectionString}""
+FreeSql.Generator -Razor {ArgsRazorRaw} -NameOptions {string.Join(",", ArgsNameOptions.Select(a => a ? 1 : 0))} -NameSpace {ArgsNameSpace} -DB ""{ArgsDbType},{ArgsConnectionString}""
");
Console.WriteFormatted(" OUT -> " + rebuildBat + " (以后) 双击它重新生成实体\r\n", Color.Magenta);
++outputCounter;
diff --git a/FreeSql/FreeSql.xml b/FreeSql/FreeSql.xml
index ac93e9cc..27ff99c1 100644
--- a/FreeSql/FreeSql.xml
+++ b/FreeSql/FreeSql.xml
@@ -2267,181 +2267,7 @@
CodeFirst迁移,执行完成触发
-
-
-
-
- Insert/Update自动值处理
-
-
-
-
- 内置解析功能,可辅助您进行解析
-
-
-
-
- 需要您解析的表达式
-
-
-
-
- 解析后的内容
-
-
-
-
- 实体类型
-
-
-
-
- 实体配置
-
-
-
-
- 索引配置
-
-
-
-
- 实体类型
-
-
-
-
- 实体的属性
-
-
-
-
- 实体的属性配置
-
-
-
-
- 标识符,可将 CurdBefore 与 CurdAfter 进行匹配
-
-
-
-
- 操作类型
-
-
-
-
- 实体类型
-
-
-
-
- 实体类型的元数据
-
-
-
-
- 执行的 SQL
-
-
-
-
- 参数化命令
-
-
-
-
- 发生的错误
-
-
-
-
- 执行SQL命令,返回的结果
-
-
-
-
- 耗时(单位:Ticks)
-
-
-
-
- 耗时(单位:毫秒)
-
-
-
-
- 标识符,可将 SyncStructureBeforeEventArgs 与 SyncStructureAfterEventArgs 进行匹配
-
-
-
-
- 实体类型
-
-
-
-
- 执行的 SQL
-
-
-
-
- 发生的错误
-
-
-
-
- 耗时(单位:Ticks)
-
-
-
-
- 耗时(单位:毫秒)
-
-
-
-
- 类型
-
-
-
-
- 属性列的元数据
-
-
-
-
- 反射的属性信息
-
-
-
-
- 获取实体的属性值,也可以设置实体的属性新值
-
-
-
-
- 【开发环境必备】自动同步实体结构到数据库,程序运行中检查实体表是否存在,然后创建或修改
-
-
-
-
- 转小写同步结构
-
-
-
-
- 转大写同步结构
-
-
-
-
- 将数据库的主键、自增、索引设置导入,适用 DbFirst 模式,无须在实体类型上设置 [Column(IsPrimary)] 或者 ConfigEntity。此功能目前可用于 mysql/sqlserver/postgresql/oracle。
- 本功能会影响 IFreeSql 首次访问的速度。
- 若使用 CodeFirst 创建索引后,又直接在数据库上建了索引,若无本功能下一次 CodeFirst 迁移时数据库上创建的索引将被删除
-
-
-
+
不使用命令参数化执行,针对 Insert/Update
@@ -2730,99 +2556,105 @@
-
+
- C#:从元组集合中查找 exp1, exp2, exp2 是否存在
- SQL:
- exp1 = that[0].Item1 and exp2 = that[0].Item2 and exp3 = that[0].Item3 OR
- exp1 = that[1].Item1 and exp2 = that[1].Item2 and exp3 = that[1].Item3 OR
- ...
- 注意:当 that 为 null 或 empty 时,返回 1=0
+ 获取c#类型对象
-
-
-
-
-
-
-
+
-
+
- 测量两个经纬度的距离,返回单位:米
+ 获取ado.net读取方法, GetBoolean、GetInt64
- 经纬坐标1
- 经纬坐标2
- 返回距离(单位:米)
+
+
-
+
- 将 IEnumable<T> 转成 ISelect<T>,以便使用 FreeSql 的查询功能。此方法用于 Lambad 表达式中,快速进行集合导航的查询。
+ 序列化
+
+
+
+
+
+
+ 反序列化
+
+
+
+
+
+
+ 获取数据库枚举类型,适用 PostgreSQL
+
+
+
+
+
+
+ AsType, Ctor, ClearData 三处地方需要重新加载
+
+
+
+
+ AsType, Ctor, ClearData 三处地方需要重新加载
+
+
+
+
+ 通过属性的注释文本,通过 xml 读取
+
+
+ Dict:key=属性名,value=注释
+
+
+
+ 创建一个过滤器
-
+ 名字
+ 表达式
-
+
- 多表查询
+ 中间表,多对多
-
-
+
- 多表查询
+ 不进行任何处理
-
-
+
- 多表查询
+ 将帕斯卡命名字符串转换为下划线分隔字符串
+
+ BigApple -> Big_Apple
-
-
+
- 多表查询
+ 将帕斯卡命名字符串转换为下划线分隔字符串,且转换为全大写
+
+ BigApple -> BIG_APPLE
-
-
+
- 多表查询
+ 将帕斯卡命名字符串转换为下划线分隔字符串,且转换为全小写
+
+ BigApple -> big_apple
-
-
+
- 多表查询
+ 将字符串转换为大写
+
+ BigApple -> BIGAPPLE
-
-
-
-
- 多表查询
-
-
-
-
-
- 多表查询
-
-
-
-
-
- 多表查询
-
-
-
-
-
- 本方法实现从已知的内存 List 数据,进行和 ISelect.IncludeMany 相同功能的贪婪加载
- 示例:new List<Song>(new[] { song1, song2, song3 }).IncludeMany(g.sqlite, a => a.Tags);
- 文档:https://github.com/2881099/FreeSql/wiki/%e8%b4%aa%e5%a9%aa%e5%8a%a0%e8%bd%bd#%E5%AF%BC%E8%88%AA%E5%B1%9E%E6%80%A7-onetomanymanytomany
+
选择一个集合的导航属性,如: .IncludeMany(a => a.Tags)
@@ -2992,6 +2824,160 @@
CodeFirst 模式开发相关方法
+
+
+ DbFirst 模式开发相关方法
+
+ <
+
+
+ true 时生效
+
+
+
+
+
+ 使用 or 拼接两个 lambda 表达式
+
+
+
+
+
+ 使用 or 拼接两个 lambda 表达式
+
+
+
+ true 时生效
+
+
+
+
+
+ 将 lambda 表达式取反
+
+
+
+ true 时生效
+
+
+
+
+ 生成类似Mongodb的ObjectId有序、不重复Guid
+
+
+
+
+
+ 插入数据
+
+
+
+
+
+
+ 插入数据,传入实体
+
+
+
+
+
+
+
+ 插入数据,传入实体数组
+
+
+
+
+
+
+
+ 插入数据,传入实体集合
+
+
+
+
+
+
+
+ 插入数据,传入实体集合
+
+
+
+
+
+
+
+ 修改数据
+
+
+
+
+
+
+ 修改数据,传入动态对象如:主键值 | new[]{主键值1,主键值2} | TEntity1 | new[]{TEntity1,TEntity2} | new{id=1}
+
+
+ 主键值、主键值集合、实体、实体集合、匿名对象、匿名对象集合
+
+
+
+
+ 查询数据
+
+
+
+
+
+
+ 查询数据,传入动态对象如:主键值 | new[]{主键值1,主键值2} | TEntity1 | new[]{TEntity1,TEntity2} | new{id=1}
+
+
+ 主键值、主键值集合、实体、实体集合、匿名对象、匿名对象集合
+
+
+
+
+ 删除数据
+
+
+
+
+
+
+ 删除数据,传入动态对象如:主键值 | new[]{主键值1,主键值2} | TEntity1 | new[]{TEntity1,TEntity2} | new{id=1}
+
+
+ 主键值、主键值集合、实体、实体集合、匿名对象、匿名对象集合
+
+
+
+
+ 开启事务(不支持异步),60秒未执行完将自动提交
+
+ 事务体 () => {}
+
+
+
+ 开启事务(不支持异步)
+
+ 事务体 () => {}
+ 超时,未执行完将自动提交
+
+
+
+ 数据库访问对象
+
+
+
+
+ 所有拦截方法都在这里
+
+
+
+
+ CodeFirst 模式开发相关方法
+
+
DbFirst 模式开发相关方法