private DbExpression ValueTypeTranslate(TranslationContext context, Expression exp) { switch (exp.NodeType) { case ExpressionType.Call: var call = (MethodCallExpression)exp; var method = call.Method; if (method.IsGenericMethod) { method = method.GetGenericMethodDefinition(); } if (ValueTypeMethods.TryGetValue(method, out ValueTypeTranslateMethodType action)) { return(action(context, call, method)); } if (method.IsDefined(typeof(DbFunctionAttribute))) { return(ScalarCustomFunctionTranslate(context, call, method)); } if (RecursiveConstantTranslate(context, exp, out DbExpression result)) { return(result); } break; } throw new TranslateException(exp, Res.NotSupportedExpressionParseValueType); }