Skip to content
Permalink
Browse files

文字错误更正

  • Loading branch information
28810 28810
28810 authored and 28810 committed Mar 4, 2019
1 parent 30385d2 commit a2a3bb62d2191adcc405b8f1295c9c4b7c61c4e2
@@ -33,7 +33,7 @@ var t2 = fsql.DbFirst.GetTablesByDatabase(fsql.DbFirst.GetDatabases()[0]);
> 更多模板逐步开发中。。。
```csharp
//创建模板生成类现实
//创建模板生成类实现
var gen = new FreeSql.Generator.TemplateGenerator();
gen.Build(fsql.DbFirst,
@"C:\Users\28810\Desktop\github\FreeSql\Templates\MySql\simple-entity", //模板目录(事先下载)
@@ -27,7 +27,7 @@ IFreeSql fsql = new FreeSql.FreeSqlBuilder()
}) //监听SQL命令对象,在执行后
.Build();
//创建模板生成类现实
//创建模板生成类实现
var gen = new FreeSql.Generator.TemplateGenerator();
gen.Build(mysql.DbFirst,
@"C:\Users\28810\Desktop\github\FreeSql\Templates\MySql\simple-entity", //模板目录(事先下载)
@@ -33,7 +33,7 @@ var t2 = fsql.DbFirst.GetTablesByDatabase(fsql.DbFirst.GetDatabases()[0]);
> 更多模板逐步开发中。。。
```csharp
//创建模板生成类现实
//创建模板生成类实现
var gen = new FreeSql.Generator.TemplateGenerator();
gen.Build(fsql.DbFirst,
@"C:\Users\28810\Desktop\github\FreeSql\Templates\MySql\simple-entity", //模板目录(事先下载)
@@ -18,7 +18,7 @@ var mysql = new FreeSql.FreeSqlBuilder()
.UseConnectionString(FreeSql.DataType.MySql, "Data Source=127.0.0.1;Port=3306;User ID=root;Password=root;Initial Catalog=cccddd;Charset=utf8;SslMode=none;Max pool size=10")
.Build();
//创建模板生成类现实
//创建模板生成类实现
var gen = new FreeSql.Generator.TemplateGenerator();
gen.Build(mysql.DbFirst,
@"C:\Users\28810\Desktop\github\FreeSql\Templates\MySql\simple-entity", //模板目录(事先下载)
@@ -5,7 +5,7 @@
<Version>0.0.12</Version>
<Authors>FreeSql</Authors>
<Product>FreeSql</Product>
<Description>FreeSql ICodeFirst 扩展库,现实从 EFCore FluentAPI/Attribute 读取,从而做到无缝接入已使用 EFCore 项目开发。</Description>
<Description>FreeSql ICodeFirst 扩展库,实现从 EFCore FluentAPI/Attribute 读取,从而做到无缝接入已使用 EFCore 项目开发。</Description>
<PackageProjectUrl>https://github.com/2881099/FreeSql</PackageProjectUrl>
<RepositoryUrl>https://github.com/2881099/FreeSql</RepositoryUrl>
</PropertyGroup>
@@ -46,7 +46,7 @@ public abstract class BaseRepository<TEntity> : IRepository<TEntity>
case DataType.Oracle:
case DataType.Sqlite:
default:
throw new NotImplementedException($"{_fsql.Ado.DataType}不支持类似returning或output类型的特性,请参考FreeSql插入数据的方法重新现实");
throw new NotImplementedException($"{_fsql.Ado.DataType}不支持类似returning或output类型的特性,请参考FreeSql插入数据的方法重新实现");
}
}

@@ -60,7 +60,7 @@ public abstract class BaseRepository<TEntity> : IRepository<TEntity>
case DataType.Oracle:
case DataType.Sqlite:
default:
throw new NotImplementedException($"{_fsql.Ado.DataType}不支持类似returning或output类型的特性,请参考FreeSql插入数据的方法重新现实");
throw new NotImplementedException($"{_fsql.Ado.DataType}不支持类似returning或output类型的特性,请参考FreeSql插入数据的方法重新实现");
}
}

@@ -74,7 +74,7 @@ public abstract class BaseRepository<TEntity> : IRepository<TEntity>
case DataType.Oracle:
case DataType.Sqlite:
default:
throw new NotImplementedException($"{_fsql.Ado.DataType}不支持类似returning或output类型的特性,请参考FreeSql插入数据的方法重新现实");
throw new NotImplementedException($"{_fsql.Ado.DataType}不支持类似returning或output类型的特性,请参考FreeSql插入数据的方法重新实现");
}
}

@@ -88,7 +88,7 @@ public abstract class BaseRepository<TEntity> : IRepository<TEntity>
case DataType.Oracle:
case DataType.Sqlite:
default:
throw new NotImplementedException($"{_fsql.Ado.DataType}不支持类似returning或output类型的特性,请参考FreeSql插入数据的方法重新现实");
throw new NotImplementedException($"{_fsql.Ado.DataType}不支持类似returning或output类型的特性,请参考FreeSql插入数据的方法重新实现");
}
}

@@ -4,7 +4,7 @@
<TargetFramework>netstandard2.0</TargetFramework>
<Version>0.1.7</Version>
<Authors>YeXiangQin</Authors>
<Description>FreeSql 通用仓库层现实,支持 MySql/SqlServer/PostgreSQL/Oracle/Sqlite 数据库。</Description>
<Description>FreeSql 通用仓库层实现,支持 MySql/SqlServer/PostgreSQL/Oracle/Sqlite 数据库。</Description>
<PackageProjectUrl>https://github.com/2881099/FreeSql</PackageProjectUrl>
<PackageTags>FreeSql ORM Repository</PackageTags>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
@@ -22,7 +22,7 @@ public class FreeSqlBuilder {
/// <summary>
/// 使用缓存,不指定默认使用内存
/// </summary>
/// <param name="cache">缓存现实</param>
/// <param name="cache">缓存实现</param>
/// <returns></returns>
public FreeSqlBuilder UseCache(IDistributedCache cache) {
_cache = cache;
@@ -297,7 +297,7 @@ internal abstract class CommonExpression {
}
var other3Exp = ExpressionLambdaToSqlOther(exp3, _tables, _selectColumnMap, getSelectGroupingMapString, tbtype, isQuoteName);
if (string.IsNullOrEmpty(other3Exp) == false) return other3Exp;
throw new Exception($"未现实函数表达式 {exp3} 解析");
throw new Exception($"未实现函数表达式 {exp3} 解析");
case ExpressionType.MemberAccess:
var exp4 = exp as MemberExpression;
if (exp4.Expression != null && exp4.Expression.Type.IsArray == false && exp4.Expression.Type.IsNullableType()) return ExpressionLambdaToSql(exp4.Expression, _tables, _selectColumnMap, getSelectGroupingMapString, tbtype, isQuoteName);
@@ -380,7 +380,7 @@ internal abstract class CommonExpression {
exp2 = expStack.Pop();
switch (exp2.NodeType) {
case ExpressionType.Constant:
throw new NotImplementedException("未现实 MemberAccess 下的 Constant");
throw new NotImplementedException("未实现 MemberAccess 下的 Constant");
case ExpressionType.Parameter:
case ExpressionType.MemberAccess:

@@ -25,7 +25,7 @@ class CacheProvider : ICache {
try { Cache.Remove($"{key1}|{key2}"); } catch { } // redis-cluster 不允许执行 multi keys 命令
CacheSupportMultiRemove = Cache.Get(key1) == null && cache.Get(key2) == null;
if (CacheSupportMultiRemove == false) {
log.LogWarning("FreeSql Warning: 低性能, IDistributedCache 没现实批量删除缓存 Cache.Remove(\"key1|key2\").");
log.LogWarning("FreeSql Warning: 低性能, IDistributedCache 没实现批量删除缓存 Cache.Remove(\"key1|key2\").");
Remove(key1, key2);
}
}
@@ -99,7 +99,7 @@ class CacheProvider : ICache {

public T Shell<T>(string key, int timeoutSeconds, Func<T> getData) {
if (timeoutSeconds <= 0) return getData();
if (Cache == null) throw new Exception("缓存现实 IDistributedCache 为 null");
if (Cache == null) throw new Exception("缓存实现 IDistributedCache 为 null");
var cacheValue = Cache.Get(key);
if (cacheValue != null) {
try {
@@ -117,7 +117,7 @@ class CacheProvider : ICache {

public T Shell<T>(string key, string field, int timeoutSeconds, Func<T> getData) {
if (timeoutSeconds <= 0) return getData();
if (Cache == null) throw new Exception("缓存现实 IDistributedCache 为 null");
if (Cache == null) throw new Exception("缓存实现 IDistributedCache 为 null");
var hashkey = $"{key}:{field}";
var cacheValue = Cache.Get(hashkey);
if (cacheValue != null) {
@@ -137,7 +137,7 @@ class CacheProvider : ICache {

async public Task<T> ShellAsync<T>(string key, int timeoutSeconds, Func<Task<T>> getDataAsync) {
if (timeoutSeconds <= 0) return await getDataAsync();
if (Cache == null) throw new Exception("缓存现实 IDistributedCache 为 null");
if (Cache == null) throw new Exception("缓存实现 IDistributedCache 为 null");
var cacheValue = await Cache.GetAsync(key);
if (cacheValue != null) {
try {
@@ -155,7 +155,7 @@ class CacheProvider : ICache {

async public Task<T> ShellAsync<T>(string key, string field, int timeoutSeconds, Func<Task<T>> getDataAsync) {
if (timeoutSeconds <= 0) return await getDataAsync();
if (Cache == null) throw new Exception("缓存现实 IDistributedCache 为 null");
if (Cache == null) throw new Exception("缓存实现 IDistributedCache 为 null");
var hashkey = $"{key}:{field}";
var cacheValue = await Cache.GetAsync(hashkey);
if (cacheValue != null) {
@@ -39,7 +39,7 @@ abstract class Select1Provider<T1> : Select0Provider<ISelect<T1>, T1>, ISelect<T
case "InnerJoin": this.InternalJoin(expCall.Arguments[0], SelectTableInfoType.InnerJoin); break;
case "RightJoin": this.InternalJoin(expCall.Arguments[0], SelectTableInfoType.RightJoin); break;

default: throw new NotImplementedException($"未现实 {expCall.Method.Name}");
default: throw new NotImplementedException($"未实现 {expCall.Method.Name}");
}
}
}
@@ -61,7 +61,7 @@ public abstract class MygisGeometry {
else if (wkt.StartsWith("multipoint", StringComparison.CurrentCultureIgnoreCase)) return new MygisMultiPoint(ParseLineString(wkt.Substring(10).Trim('(', ')')));
else if (wkt.StartsWith("multilinestring", StringComparison.CurrentCultureIgnoreCase)) return new MygisMultiLineString(ParseMultiLineString(wkt.Substring(15).Trim('(', ')')));
else if (wkt.StartsWith("multipolygon", StringComparison.CurrentCultureIgnoreCase)) return new MygisMultiPolygon(ParseMultiPolygon(wkt.Substring(12).Trim('(', ')')));
throw new NotImplementedException($"MygisGeometry.Parse 未现实 \"{wkt}\"");
throw new NotImplementedException($"MygisGeometry.Parse 未实现 \"{wkt}\"");
}
static MygisPoint ParsePoint(string str) {
var m = regexMygisPoint.Match(str);
@@ -187,7 +187,7 @@ class MySqlExpression : CommonExpression {
case "Equals": return $"({left} = {getExp(exp.Arguments[0])})";
}
}
throw new Exception($"MySqlExpression 未现实函数表达式 {exp} 解析");
throw new Exception($"MySqlExpression 未实现函数表达式 {exp} 解析");
}
internal override string ExpressionLambdaToSqlCallMath(MethodCallExpression exp, List<SelectTableInfo> _tables, List<SelectColumnInfo> _selectColumnMap, Func<Expression[], string> getSelectGroupingMapString, SelectTableInfoType tbtype, bool isQuoteName) {
Func<Expression, string> getExp = exparg => ExpressionLambdaToSql(exparg, _tables, _selectColumnMap, getSelectGroupingMapString, tbtype, isQuoteName);
@@ -213,7 +213,7 @@ class MySqlExpression : CommonExpression {
case "Atan2": return $"atan2({getExp(exp.Arguments[0])}, {getExp(exp.Arguments[1])})";
case "Truncate": return $"truncate({getExp(exp.Arguments[0])}, 0)";
}
throw new Exception($"MySqlExpression 未现实函数表达式 {exp} 解析");
throw new Exception($"MySqlExpression 未实现函数表达式 {exp} 解析");
}
internal override string ExpressionLambdaToSqlCallDateTime(MethodCallExpression exp, List<SelectTableInfo> _tables, List<SelectColumnInfo> _selectColumnMap, Func<Expression[], string> getSelectGroupingMapString, SelectTableInfoType tbtype, bool isQuoteName) {
Func<Expression, string> getExp = exparg => ExpressionLambdaToSql(exparg, _tables, _selectColumnMap, getSelectGroupingMapString, tbtype, isQuoteName);
@@ -256,7 +256,7 @@ class MySqlExpression : CommonExpression {
case "ToString": return $"date_format({left}, '%Y-%m-%d %H:%i:%s.%f')";
}
}
throw new Exception($"MySqlExpression 未现实函数表达式 {exp} 解析");
throw new Exception($"MySqlExpression 未实现函数表达式 {exp} 解析");
}
internal override string ExpressionLambdaToSqlCallTimeSpan(MethodCallExpression exp, List<SelectTableInfo> _tables, List<SelectColumnInfo> _selectColumnMap, Func<Expression[], string> getSelectGroupingMapString, SelectTableInfoType tbtype, bool isQuoteName) {
Func<Expression, string> getExp = exparg => ExpressionLambdaToSql(exparg, _tables, _selectColumnMap, getSelectGroupingMapString, tbtype, isQuoteName);
@@ -286,7 +286,7 @@ class MySqlExpression : CommonExpression {
case "ToString": return $"cast({left} as char)";
}
}
throw new Exception($"MySqlExpression 未现实函数表达式 {exp} 解析");
throw new Exception($"MySqlExpression 未实现函数表达式 {exp} 解析");
}
internal override string ExpressionLambdaToSqlCallConvert(MethodCallExpression exp, List<SelectTableInfo> _tables, List<SelectColumnInfo> _selectColumnMap, Func<Expression[], string> getSelectGroupingMapString, SelectTableInfoType tbtype, bool isQuoteName) {
Func<Expression, string> getExp = exparg => ExpressionLambdaToSql(exparg, _tables, _selectColumnMap, getSelectGroupingMapString, tbtype, isQuoteName);
@@ -309,7 +309,7 @@ class MySqlExpression : CommonExpression {
case "ToUInt64": return $"cast({getExp(exp.Arguments[0])} as unsigned)";
}
}
throw new Exception($"MySqlExpression 未现实函数表达式 {exp} 解析");
throw new Exception($"MySqlExpression 未实现函数表达式 {exp} 解析");
}
}
}
@@ -187,7 +187,7 @@ class OracleExpression : CommonExpression {
case "Equals": return $"({left} = {getExp(exp.Arguments[0])})";
}
}
throw new Exception($"OracleExpression 未现实函数表达式 {exp} 解析");
throw new Exception($"OracleExpression 未实现函数表达式 {exp} 解析");
}
internal override string ExpressionLambdaToSqlCallMath(MethodCallExpression exp, List<SelectTableInfo> _tables, List<SelectColumnInfo> _selectColumnMap, Func<Expression[], string> getSelectGroupingMapString, SelectTableInfoType tbtype, bool isQuoteName) {
Func<Expression, string> getExp = exparg => ExpressionLambdaToSql(exparg, _tables, _selectColumnMap, getSelectGroupingMapString, tbtype, isQuoteName);
@@ -214,7 +214,7 @@ class OracleExpression : CommonExpression {
//case "Atan2": return $"atan2({getExp(exp.Arguments[0])}, {getExp(exp.Arguments[1])})";
case "Truncate": return $"trunc({getExp(exp.Arguments[0])}, 0)";
}
throw new Exception($"OracleExpression 未现实函数表达式 {exp} 解析");
throw new Exception($"OracleExpression 未实现函数表达式 {exp} 解析");
}
internal override string ExpressionLambdaToSqlCallDateTime(MethodCallExpression exp, List<SelectTableInfo> _tables, List<SelectColumnInfo> _selectColumnMap, Func<Expression[], string> getSelectGroupingMapString, SelectTableInfoType tbtype, bool isQuoteName) {
Func<Expression, string> getExp = exparg => ExpressionLambdaToSql(exparg, _tables, _selectColumnMap, getSelectGroupingMapString, tbtype, isQuoteName);
@@ -257,7 +257,7 @@ class OracleExpression : CommonExpression {
case "ToString": return $"to_char({left},'YYYY-MM-DD HH24:MI:SS.FF6')";
}
}
throw new Exception($"OracleExpression 未现实函数表达式 {exp} 解析");
throw new Exception($"OracleExpression 未实现函数表达式 {exp} 解析");
}
internal override string ExpressionLambdaToSqlCallTimeSpan(MethodCallExpression exp, List<SelectTableInfo> _tables, List<SelectColumnInfo> _selectColumnMap, Func<Expression[], string> getSelectGroupingMapString, SelectTableInfoType tbtype, bool isQuoteName) {
Func<Expression, string> getExp = exparg => ExpressionLambdaToSql(exparg, _tables, _selectColumnMap, getSelectGroupingMapString, tbtype, isQuoteName);
@@ -287,7 +287,7 @@ class OracleExpression : CommonExpression {
case "ToString": return $"to_char({left})";
}
}
throw new Exception($"OracleExpression 未现实函数表达式 {exp} 解析");
throw new Exception($"OracleExpression 未实现函数表达式 {exp} 解析");
}
internal override string ExpressionLambdaToSqlCallConvert(MethodCallExpression exp, List<SelectTableInfo> _tables, List<SelectColumnInfo> _selectColumnMap, Func<Expression[], string> getSelectGroupingMapString, SelectTableInfoType tbtype, bool isQuoteName) {
Func<Expression, string> getExp = exparg => ExpressionLambdaToSql(exparg, _tables, _selectColumnMap, getSelectGroupingMapString, tbtype, isQuoteName);
@@ -310,7 +310,7 @@ class OracleExpression : CommonExpression {
case "ToUInt64": return $"cast({getExp(exp.Arguments[0])} as number)";
}
}
throw new Exception($"OracleExpression 未现实函数表达式 {exp} 解析");
throw new Exception($"OracleExpression 未实现函数表达式 {exp} 解析");
}
}
}
@@ -284,7 +284,7 @@ class PostgreSQLExpression : CommonExpression {
case "Equals": return $"({left} = ({getExp(exp.Arguments[0])})::varchar)";
}
}
throw new Exception($"PostgreSQLExpression 未现实函数表达式 {exp} 解析");
throw new Exception($"PostgreSQLExpression 未实现函数表达式 {exp} 解析");
}
internal override string ExpressionLambdaToSqlCallMath(MethodCallExpression exp, List<SelectTableInfo> _tables, List<SelectColumnInfo> _selectColumnMap, Func<Expression[], string> getSelectGroupingMapString, SelectTableInfoType tbtype, bool isQuoteName) {
Func<Expression, string> getExp = exparg => ExpressionLambdaToSql(exparg, _tables, _selectColumnMap, getSelectGroupingMapString, tbtype, isQuoteName);
@@ -310,7 +310,7 @@ class PostgreSQLExpression : CommonExpression {
case "Atan2": return $"atan2({getExp(exp.Arguments[0])}, {getExp(exp.Arguments[1])})";
case "Truncate": return $"trunc({getExp(exp.Arguments[0])}, 0)";
}
throw new Exception($"PostgreSQLExpression 未现实函数表达式 {exp} 解析");
throw new Exception($"PostgreSQLExpression 未实现函数表达式 {exp} 解析");
}
internal override string ExpressionLambdaToSqlCallDateTime(MethodCallExpression exp, List<SelectTableInfo> _tables, List<SelectColumnInfo> _selectColumnMap, Func<Expression[], string> getSelectGroupingMapString, SelectTableInfoType tbtype, bool isQuoteName) {
Func<Expression, string> getExp = exparg => ExpressionLambdaToSql(exparg, _tables, _selectColumnMap, getSelectGroupingMapString, tbtype, isQuoteName);
@@ -353,7 +353,7 @@ class PostgreSQLExpression : CommonExpression {
case "ToString": return $"to_char({left}, 'YYYY-MM-DD HH24:MI:SS.US')";
}
}
throw new Exception($"PostgreSQLExpression 未现实函数表达式 {exp} 解析");
throw new Exception($"PostgreSQLExpression 未实现函数表达式 {exp} 解析");
}
internal override string ExpressionLambdaToSqlCallTimeSpan(MethodCallExpression exp, List<SelectTableInfo> _tables, List<SelectColumnInfo> _selectColumnMap, Func<Expression[], string> getSelectGroupingMapString, SelectTableInfoType tbtype, bool isQuoteName) {
Func<Expression, string> getExp = exparg => ExpressionLambdaToSql(exparg, _tables, _selectColumnMap, getSelectGroupingMapString, tbtype, isQuoteName);
@@ -383,7 +383,7 @@ class PostgreSQLExpression : CommonExpression {
case "ToString": return $"({left})::varchar";
}
}
throw new Exception($"PostgreSQLExpression 未现实函数表达式 {exp} 解析");
throw new Exception($"PostgreSQLExpression 未实现函数表达式 {exp} 解析");
}
internal override string ExpressionLambdaToSqlCallConvert(MethodCallExpression exp, List<SelectTableInfo> _tables, List<SelectColumnInfo> _selectColumnMap, Func<Expression[], string> getSelectGroupingMapString, SelectTableInfoType tbtype, bool isQuoteName) {
Func<Expression, string> getExp = exparg => ExpressionLambdaToSql(exparg, _tables, _selectColumnMap, getSelectGroupingMapString, tbtype, isQuoteName);
@@ -406,7 +406,7 @@ class PostgreSQLExpression : CommonExpression {
case "ToUInt64": return $"({getExp(exp.Arguments[0])})::int8";
}
}
throw new Exception($"PostgreSQLExpression 未现实函数表达式 {exp} 解析");
throw new Exception($"PostgreSQLExpression 未实现函数表达式 {exp} 解析");
}
}
}

0 comments on commit a2a3bb6

Please sign in to comment.
You can’t perform that action at this time.