mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-06-28 04:35:29 +08:00
Update mongodb
This commit is contained in:
parent
8112da7fbf
commit
056245e676
@ -95,9 +95,17 @@ namespace MongoDbTest
|
||||
{
|
||||
Age = it.Age > 0 ? it.Age : 1,
|
||||
Age2 = it.Age < 0 ? it.Age : 1,
|
||||
Age3 = false ? 0:it.Age,
|
||||
Age4 = true ? 100 : it.Age,
|
||||
Age5= it.Age <0 ? 1:it.Age ,
|
||||
Age6 = it.Age > 0 ? 1 : it.Age,
|
||||
}).ToList();
|
||||
if (list10.First().Age != 11) Cases.ThrowUnitError();
|
||||
if (list10.First().Age2 != 1) Cases.ThrowUnitError();
|
||||
if (list10.First().Age3 != 11) Cases.ThrowUnitError();
|
||||
if (list10.First().Age4 != 100) Cases.ThrowUnitError();
|
||||
if (list10.First().Age5 != 11) Cases.ThrowUnitError();
|
||||
if (list10.First().Age6 != 1) Cases.ThrowUnitError();
|
||||
}
|
||||
[SqlSugar.SugarTable("UnitStudent1231sds3z1")]
|
||||
public class Student : MongoDbBase
|
||||
|
@ -34,8 +34,8 @@ namespace SqlSugar.MongoDb
|
||||
else
|
||||
{
|
||||
var testValue = MongoNestedTranslator.TranslateNoFieldName(exp.Test, context, new ExpressionVisitorContext() { IsText=true });
|
||||
var ifTrueValue = MongoNestedTranslator.TranslateNoFieldName(exp.IfTrue, context);
|
||||
var ifFalseValue = MongoNestedTranslator.TranslateNoFieldName(exp.IfFalse, context);
|
||||
var ifTrueValue = MongoNestedTranslator.TranslateNoFieldName(exp.IfTrue, context, new ExpressionVisitorContext() { IsText = true });
|
||||
var ifFalseValue = MongoNestedTranslator.TranslateNoFieldName(exp.IfFalse, context, new ExpressionVisitorContext() { IsText = true });
|
||||
if (exp.IfTrue is MemberExpression member && member.Expression is ParameterExpression)
|
||||
{
|
||||
ifTrueValue = $"${ifTrueValue}";
|
||||
|
Loading…
Reference in New Issue
Block a user