private DataSourceStubModelReference ComputeDataSourceStubReference(MethodCallExpression methodCall) { DataSourceStubModelReference modelReference = null; ConstantExpression namespaceName = null; ConstantExpression name = null; var argumentIndex = 0; if (methodCall.Method.GetParameters().Length > 2) { namespaceName = methodCall.Arguments[argumentIndex++] as ConstantExpression; } name = methodCall.Arguments[argumentIndex++] as ConstantExpression; if ((argumentIndex == 1 || namespaceName != null) && name != null) { if (name.Value is string nameValue) { if (namespaceName == null) { modelReference = new DataSourceStubModelReference(QueryContext, nameValue); } else { modelReference = new DataSourceStubModelReference(QueryContext, namespaceName.Value as string, nameValue); } } } return(modelReference); }
private DataSourceStubModelReference ComputeDataSourceStubReference( MethodCallExpression methodCall) { DataSourceStubModelReference modelReference = null; ConstantExpression namespaceName = null; ConstantExpression name = null; var argumentIndex = 0; if (methodCall.Method.GetParameters().Length > 2) { namespaceName = methodCall.Arguments[argumentIndex++] as ConstantExpression; } name = methodCall.Arguments[argumentIndex++] as ConstantExpression; if ((argumentIndex == 1 || namespaceName != null) && name != null) { var nameValue = name.Value as string; if (nameValue != null) { if (namespaceName == null) { modelReference = new DataSourceStubModelReference( this.QueryContext, nameValue); } else { modelReference = new DataSourceStubModelReference( this.QueryContext, namespaceName.Value as string, nameValue); } } } return modelReference; }