diff --git a/01-Core/Jinget.Core.DiScanner/Jinget.Core.DiScanner.csproj b/01-Core/Jinget.Core.DiScanner/Jinget.Core.DiScanner.csproj
index 8527782..cc903af 100644
--- a/01-Core/Jinget.Core.DiScanner/Jinget.Core.DiScanner.csproj
+++ b/01-Core/Jinget.Core.DiScanner/Jinget.Core.DiScanner.csproj
@@ -19,9 +19,9 @@
-
-
-
+
+
+
diff --git a/01-Core/Jinget.Core/Attributes/ValidationAttributes/DateGreaterThanAttribute.cs b/01-Core/Jinget.Core/Attributes/ValidationAttributes/DateGreaterThanAttribute.cs
index 55596c7..b7633ac 100644
--- a/01-Core/Jinget.Core/Attributes/ValidationAttributes/DateGreaterThanAttribute.cs
+++ b/01-Core/Jinget.Core/Attributes/ValidationAttributes/DateGreaterThanAttribute.cs
@@ -5,7 +5,7 @@ public class DateGreaterThanAttribute(string otherPropertyName) : ValidationAttr
///
/// check whether is greater than
///
- protected override ValidationResult IsValid(object value, ValidationContext validationContext)
+ protected override ValidationResult? IsValid(object? value, ValidationContext validationContext)
{
if (value == null) return ValidationResult.Success; // Allow nulls (optional, adjust as needed)
diff --git a/01-Core/Jinget.Core/Attributes/ValidationAttributes/TimeGreaterThanAttribute.cs b/01-Core/Jinget.Core/Attributes/ValidationAttributes/TimeGreaterThanAttribute.cs
index a174cd3..9ef932b 100644
--- a/01-Core/Jinget.Core/Attributes/ValidationAttributes/TimeGreaterThanAttribute.cs
+++ b/01-Core/Jinget.Core/Attributes/ValidationAttributes/TimeGreaterThanAttribute.cs
@@ -5,7 +5,7 @@ public class TimeGreaterThanAttribute(string otherPropertyName) : ValidationAttr
///
/// check whether is greater than
///
- protected override ValidationResult IsValid(object value, ValidationContext validationContext)
+ protected override ValidationResult? IsValid(object? value, ValidationContext validationContext)
{
if (value == null)
return ValidationResult.Success; // Allow nulls (optional, adjust as needed)
diff --git a/01-Core/Jinget.Core/CodeDom/JingetDynamicCode.cs b/01-Core/Jinget.Core/CodeDom/JingetDynamicCode.cs
index 3962384..80b2c02 100644
--- a/01-Core/Jinget.Core/CodeDom/JingetDynamicCode.cs
+++ b/01-Core/Jinget.Core/CodeDom/JingetDynamicCode.cs
@@ -179,7 +179,10 @@ public class MethodOptions
/// What should be return type of the dynamically injected Invoke method?
/// If not set, void will be used
///
- public Type ReturnType { get; set; }
+ ///
+ /// Default value: typeof(void)
+ ///
+ public Type ReturnType { get; set; } = typeof(void);
///
/// What are the input parameters for dynamically injected Invoke method?
@@ -188,9 +191,9 @@ public class MethodOptions
public class ParameterOptions
{
- public Type Type { get; set; }
- public string Name { get; set; }
- public object Value { get; set; }
+ public Type? Type { get; set; }
+ public string? Name { get; set; }
+ public object? Value { get; set; }
}
}
}
\ No newline at end of file
diff --git a/01-Core/Jinget.Core/Compiler/CompilerFeatureRequiredAttribute.cs b/01-Core/Jinget.Core/Compiler/CompilerFeatureRequiredAttribute.cs
index 5cee541..fd4df06 100644
--- a/01-Core/Jinget.Core/Compiler/CompilerFeatureRequiredAttribute.cs
+++ b/01-Core/Jinget.Core/Compiler/CompilerFeatureRequiredAttribute.cs
@@ -3,6 +3,8 @@
///
/// add support for 'required' keyword using latest lang version and .net standard 2.1
///
+#pragma warning disable CS9113 // Parameter is unread.
public class CompilerFeatureRequiredAttribute(string name) : Attribute
+#pragma warning restore CS9113 // Parameter is unread.
{
}
\ No newline at end of file
diff --git a/01-Core/Jinget.Core/ExpressionToSql/Internal/OrderBy.cs b/01-Core/Jinget.Core/ExpressionToSql/Internal/OrderBy.cs
index aecaad2..66dd65e 100644
--- a/01-Core/Jinget.Core/ExpressionToSql/Internal/OrderBy.cs
+++ b/01-Core/Jinget.Core/ExpressionToSql/Internal/OrderBy.cs
@@ -13,7 +13,7 @@ public class OrderBy
///
/// The order by expression
///
- public virtual Expression> Name { get; set; }
+ public virtual Expression>? Name { get; set; }
public OrderBy() { }
public OrderBy(string name) => Name = ExpressionUtility.ToExpression(name, "x");
@@ -29,12 +29,14 @@ public OrderBy() { }
///
public override string ToString()
{
+ if (Name == null)
+ return "";
StringBuilder orderByClause = new();
orderByClause.Append('[');
-
+
if (Name.Body is MemberExpression expression &&
- expression.Expression.NodeType != ExpressionType.Convert &&
- expression.Expression.NodeType != ExpressionType.Parameter)
+ expression.Expression?.NodeType != ExpressionType.Convert &&
+ expression.Expression?.NodeType != ExpressionType.Parameter)
orderByClause.Append(Expression.Lambda(expression).Compile().DynamicInvoke());
else
orderByClause.Append(Name.Stringfy());
diff --git a/01-Core/Jinget.Core/ExpressionToSql/Internal/Where.cs b/01-Core/Jinget.Core/ExpressionToSql/Internal/Where.cs
index 74fa0ef..4268e38 100644
--- a/01-Core/Jinget.Core/ExpressionToSql/Internal/Where.cs
+++ b/01-Core/Jinget.Core/ExpressionToSql/Internal/Where.cs
@@ -59,7 +59,7 @@ private static WherePart Recurse(ref int i, Expression expression, bool isUnary
return WherePart.Concat(Where.Recurse(ref i, member), "=", WherePart.IsParameter(i++, true));
}
- if (((MemberExpression)expression).Expression.NodeType == ExpressionType.Constant)
+ if (((MemberExpression)expression).Expression?.NodeType == ExpressionType.Constant)
{
goto case_ConstantExpression;
}
@@ -260,6 +260,9 @@ public static WherePart IsCollection(ref int countStart, IEnumerable values)
public static WherePart Concat(WherePart left, string @operator, WherePart right)
{
+ if (right.Sql == null)
+ throw new Exception("Jinget Says: Right-side expression can not be null here");
+
//these operators does not need to append @
List excludedList = ["IN", "AND", "OR"];
var rightExpr = !excludedList.Contains(@operator) && !right.Sql.StartsWith("@")
diff --git a/01-Core/Jinget.Core/ExtensionMethods/Dapper/DynamicParametersExtensions.cs b/01-Core/Jinget.Core/ExtensionMethods/Dapper/DynamicParametersExtensions.cs
index 02b9b21..9ca8316 100644
--- a/01-Core/Jinget.Core/ExtensionMethods/Dapper/DynamicParametersExtensions.cs
+++ b/01-Core/Jinget.Core/ExtensionMethods/Dapper/DynamicParametersExtensions.cs
@@ -14,23 +14,39 @@ public static class DynamicParametersExtensions
///
public static List GetSQLValues(this DynamicParameters parameters)
{
- List