Просмотр исходного кода

fix treat String.Add as Numeric.Add issue

Lith 10 месяцев назад
Родитель
Сommit
f354a8694a

+ 19 - 0
doc/ReleaseLog.md

@@ -0,0 +1,19 @@
+# Vitorm ReleaseLog
+
+-----------------------
+# 1.2.0
+
+- support multipe EntityReader ( EntityConstructor and CompiledLambda )
+- fix String.Format not work for EntityConstructorReader issue
+> userQuery.Select(user => new { name = $"{user.id}_{user.fatherId}_{user.motherId}" });
+
+- fix treat String.Add as Numeric.Add issue
+
+-----------------------
+# 1.1.0
+
+- fix Count issue (work for skip take and distinct)
+- Data and Vitorm ReadOnly feature
+- move extensions to root namespace Vitorm
+- support Drop
+- fix the issue when column name from database differ from property name from entity

+ 1 - 2
doc/TODO.md

@@ -1,5 +1,4 @@
-
-# TODO
+# Vitorm TODO
 
 
 # SqlServer  Select 

+ 1 - 1
src/Vitorm/Sql/DataReader/SqlColumns.cs

@@ -84,7 +84,7 @@ namespace Vitorm.Sql.DataReader
 
         public string GetSqlColumns()
         {
-            var sqlColumns = columns.Select(column => column.sqlColumnName + " as " + column.sqlColumnAlias);
+            var sqlColumns = columns.Select(column => "(" + column.sqlColumnName + ") as " + column.sqlColumnAlias);
             return String.Join(", ", sqlColumns);
         }
 

+ 1 - 1
src/Vitorm/Sql/SqlTranslate/SqlTranslateService.cs

@@ -254,7 +254,7 @@ namespace Vitorm.Sql.SqlTranslate
                                     foreach (var node in nodeParts)
                                     {
                                         if (nodeForAdd == null) nodeForAdd = node;
-                                        else nodeForAdd = ExpressionNode.Binary(nameof(ExpressionType.Add), nodeForAdd, node);
+                                        else nodeForAdd = ExpressionNode.Add(left: nodeForAdd, right: node, typeof(string));
                                     }
 
                                     return $"({EvalExpression(arg, nodeForAdd)})";