本文整理汇总了C#中IEdmTypeReference.IsEntityCollectionType方法的典型用法代码示例。如果您正苦于以下问题:C# IEdmTypeReference.IsEntityCollectionType方法的具体用法?C# IEdmTypeReference.IsEntityCollectionType怎么用?C# IEdmTypeReference.IsEntityCollectionType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IEdmTypeReference
的用法示例。
在下文中一共展示了IEdmTypeReference.IsEntityCollectionType方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ParseComplexOrCollectionAlias
/// <summary>
/// Parse the complex/collection value in parameter alias.
/// </summary>
/// <param name="queryToken">The parsed token.</param>
/// <param name="parameterType">The expected parameter type.</param>
/// <param name="model">The model</param>
/// <returns>Token with complex/collection value passed.</returns>
private static QueryToken ParseComplexOrCollectionAlias(QueryToken queryToken, IEdmTypeReference parameterType, IEdmModel model)
{
LiteralToken valueToken = queryToken as LiteralToken;
string valueStr;
if (valueToken != null && (valueStr = valueToken.Value as string) != null && !string.IsNullOrEmpty(valueToken.OriginalText))
{
var lexer = new ExpressionLexer(valueToken.OriginalText, true /*moveToFirstToken*/, false /*useSemicolonDelimiter*/, true /*parsingFunctionParameters*/);
if (lexer.CurrentToken.Kind == ExpressionTokenKind.BracketedExpression)
{
object result = valueStr;
if (!parameterType.IsEntity() && !parameterType.IsEntityCollectionType())
{
result = ODataUriUtils.ConvertFromUriLiteral(valueStr, ODataVersion.V4, model, parameterType);
}
// For non-primitive type, we have to pass parameterType to LiteralToken, then to ConstantNode so the service can know what the type it is.
return new LiteralToken(result, valueToken.OriginalText, parameterType);
}
}
return queryToken;
}