Skip to content

Commit

Permalink
Rename some Public APIs
Browse files Browse the repository at this point in the history
  • Loading branch information
LaylaLiu committed Mar 17, 2016
1 parent a341364 commit 14db585
Show file tree
Hide file tree
Showing 26 changed files with 849 additions and 931 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1800,23 +1800,23 @@
<Compile Include="..\WriterValidatorMinimalValidation.cs">
<Link>Microsoft\OData\Core\WriterValidatorMinimalValidation.cs</Link>
</Compile>
<Compile Include="..\UriParser\CustomUriTypePrefixLiterals.cs">
<Link>Microsoft\OData\Core\UriParser\CustomUriTypePrefixLiterals.cs</Link>
<Compile Include="..\UriParser\CustomUriLiteralPrefixes.cs">
<Link>Microsoft\OData\Core\UriParser\CustomUriLiteralPrefixes.cs</Link>
</Compile>
<Compile Include="..\UriParser\Parsers\TypeParsers\Common\IUriTypeParser.cs">
<Link>Microsoft\OData\Core\UriParser\Parsers\TypeParsers\Common\IUriTypeParser.cs</Link>
<Compile Include="..\UriParser\Parsers\LiteralParsers\Common\IUriLiteralParser.cs">
<Link>Microsoft\OData\Core\UriParser\Parsers\LiteralParsers\Common\IUriLiteralParser.cs</Link>
</Compile>
<Compile Include="..\UriParser\Parsers\TypeParsers\Common\UriTypeParsingException.cs">
<Link>Microsoft\OData\Core\UriParser\Parsers\TypeParsers\Common\UriTypeParsingException.cs</Link>
<Compile Include="..\UriParser\Parsers\LiteralParsers\Common\UriLiteralParsingException.cs">
<Link>Microsoft\OData\Core\UriParser\Parsers\LiteralParsers\Common\UriLiteralParsingException.cs</Link>
</Compile>
<Compile Include="..\UriParser\Parsers\TypeParsers\DefaultUriTypeParser.cs">
<Link>Microsoft\OData\Core\UriParser\Parsers\TypeParsers\DefaultUriTypeParser.cs</Link>
<Compile Include="..\UriParser\Parsers\LiteralParsers\DefaultUriLiteralParser.cs">
<Link>Microsoft\OData\Core\UriParser\Parsers\LiteralParsers\DefaultUriLiteralParser.cs</Link>
</Compile>
<Compile Include="..\UriParser\Parsers\TypeParsers\UriCustomTypeParsers.cs">
<Link>Microsoft\OData\Core\UriParser\Parsers\TypeParsers\UriCustomTypeParsers.cs</Link>
<Compile Include="..\UriParser\Parsers\LiteralParsers\CustomUriLiteralParsers.cs">
<Link>Microsoft\OData\Core\UriParser\Parsers\LiteralParsers\CustomUriLiteralParsers.cs</Link>
</Compile>
<Compile Include="..\UriParser\Parsers\TypeParsers\UriPrimitiveTypeParser.cs">
<Link>Microsoft\OData\Core\UriParser\Parsers\TypeParsers\UriPrimitiveTypeParser.cs</Link>
<Compile Include="..\UriParser\Parsers\LiteralParsers\UriPrimitiveTypeParser.cs">
<Link>Microsoft\OData\Core\UriParser\Parsers\LiteralParsers\UriPrimitiveTypeParser.cs</Link>
</Compile>
<Compile Include="..\UriParser\Parsers\UriParserHelper.cs">
<Link>Microsoft\OData\Core\UriParser\Parsers\UriParserHelper.cs</Link>
Expand Down
2 changes: 1 addition & 1 deletion src/Microsoft.OData.Core/GlobalSuppressions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -110,4 +110,4 @@
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Scope = "member", Target = "Microsoft.OData.Core.JsonLight.ODataJsonLightDeltaReader.#IsTopLevel")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Scope = "member", Target = "Microsoft.OData.Core.JsonLight.ODataJsonLightDeltaWriter.#IsTopLevel")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays", Scope = "member", Target = "Microsoft.OData.Core.UriParser.FunctionSignatureWithReturnType.#ArgumentTypes")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Scope = "member", Target = "Microsoft.OData.Core.UriParser.Parsers.TypeParsers.UriPrimitiveTypeParser.#TryUriStringToPrimitive(System.String,Microsoft.OData.Edm.IEdmTypeReference,System.Object&,Microsoft.OData.Core.UriParser.Parsers.TypeParsers.Common.UriTypeParsingException&)")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Scope = "member", Target = "Microsoft.OData.Core.UriParser.Parsers.UriPrimitiveTypeParser.#TryUriStringToPrimitive(System.String,Microsoft.OData.Edm.IEdmTypeReference,System.Object&,Microsoft.OData.Core.UriParser.Parsers.Common.UriLiteralParsingException&)")]
12 changes: 6 additions & 6 deletions src/Microsoft.OData.Core/Microsoft.OData.Core.Net45.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@
<Compile Include="UriParser\Binders\UnaryOperatorBinder.cs" />
<Compile Include="UriParser\BuiltInUriFunctions.cs" />
<Compile Include="UriParser\CustomUriFunctions.cs" />
<Compile Include="UriParser\CustomUriTypePrefixLiterals.cs" />
<Compile Include="UriParser\CustomUriLiteralPrefixes.cs" />
<Compile Include="UriParser\ExceptionUtil.cs" />
<Compile Include="UriParser\ExpressionLexer.cs" />
<Compile Include="UriParser\ExpressionLexerLiteralExtensions.cs" />
Expand Down Expand Up @@ -467,11 +467,11 @@
<Compile Include="UriParser\Parsers\SelectExpandParser.cs" />
<Compile Include="UriParser\Parsers\SelectExpandSyntacticParser.cs" />
<Compile Include="UriParser\Parsers\SelectExpandTermParser.cs" />
<Compile Include="UriParser\Parsers\TypeParsers\Common\IUriTypeParser.cs" />
<Compile Include="UriParser\Parsers\TypeParsers\Common\UriTypeParsingException.cs" />
<Compile Include="UriParser\Parsers\TypeParsers\DefaultUriTypeParser.cs" />
<Compile Include="UriParser\Parsers\TypeParsers\UriCustomTypeParsers.cs" />
<Compile Include="UriParser\Parsers\TypeParsers\UriPrimitiveTypeParser.cs" />
<Compile Include="UriParser\Parsers\LiteralParsers\Common\IUriLiteralParser.cs" />
<Compile Include="UriParser\Parsers\LiteralParsers\Common\UriLiteralParsingException.cs" />
<Compile Include="UriParser\Parsers\LiteralParsers\DefaultUriLiteralParser.cs" />
<Compile Include="UriParser\Parsers\LiteralParsers\CustomUriLiteralParsers.cs" />
<Compile Include="UriParser\Parsers\LiteralParsers\UriPrimitiveTypeParser.cs" />
<Compile Include="UriParser\Parsers\UriParserHelper.cs" />
<Compile Include="UriParser\Parsers\UriPathParser.cs" />
<Compile Include="UriParser\Parsers\UriQueryExpressionParser.cs" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@
<Compile Include="UriParser\Binders\UnaryOperatorBinder.cs" />
<Compile Include="UriParser\BuiltInUriFunctions.cs" />
<Compile Include="UriParser\CustomUriFunctions.cs" />
<Compile Include="UriParser\CustomUriTypePrefixLiterals.cs" />
<Compile Include="UriParser\CustomUriLiteralPrefixes.cs" />
<Compile Include="UriParser\ExceptionUtil.cs" />
<Compile Include="UriParser\ExpressionLexer.cs" />
<Compile Include="UriParser\ExpressionLexerLiteralExtensions.cs" />
Expand Down Expand Up @@ -465,11 +465,11 @@
<Compile Include="UriParser\Parsers\SelectExpandParser.cs" />
<Compile Include="UriParser\Parsers\SelectExpandSyntacticParser.cs" />
<Compile Include="UriParser\Parsers\SelectExpandTermParser.cs" />
<Compile Include="UriParser\Parsers\TypeParsers\Common\IUriTypeParser.cs" />
<Compile Include="UriParser\Parsers\TypeParsers\Common\UriTypeParsingException.cs" />
<Compile Include="UriParser\Parsers\TypeParsers\DefaultUriTypeParser.cs" />
<Compile Include="UriParser\Parsers\TypeParsers\UriCustomTypeParsers.cs" />
<Compile Include="UriParser\Parsers\TypeParsers\UriPrimitiveTypeParser.cs" />
<Compile Include="UriParser\Parsers\LiteralParsers\Common\IUriLiteralParser.cs" />
<Compile Include="UriParser\Parsers\LiteralParsers\Common\UriLiteralParsingException.cs" />
<Compile Include="UriParser\Parsers\LiteralParsers\DefaultUriLiteralParser.cs" />
<Compile Include="UriParser\Parsers\LiteralParsers\CustomUriLiteralParsers.cs" />
<Compile Include="UriParser\Parsers\LiteralParsers\UriPrimitiveTypeParser.cs" />
<Compile Include="UriParser\Parsers\UriParserHelper.cs" />
<Compile Include="UriParser\Parsers\UriPathParser.cs" />
<Compile Include="UriParser\Parsers\UriQueryExpressionParser.cs" />
Expand Down
12 changes: 6 additions & 6 deletions src/Microsoft.OData.Core/Microsoft.OData.Core.Portable45.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@
<Compile Include="UriParser\Binders\UnaryOperatorBinder.cs" />
<Compile Include="UriParser\BuiltInUriFunctions.cs" />
<Compile Include="UriParser\CustomUriFunctions.cs" />
<Compile Include="UriParser\CustomUriTypePrefixLiterals.cs" />
<Compile Include="UriParser\CustomUriLiteralPrefixes.cs" />
<Compile Include="UriParser\ExceptionUtil.cs" />
<Compile Include="UriParser\ExpressionLexer.cs" />
<Compile Include="UriParser\ExpressionLexerLiteralExtensions.cs" />
Expand Down Expand Up @@ -466,11 +466,11 @@
<Compile Include="UriParser\Parsers\SelectExpandParser.cs" />
<Compile Include="UriParser\Parsers\SelectExpandSyntacticParser.cs" />
<Compile Include="UriParser\Parsers\SelectExpandTermParser.cs" />
<Compile Include="UriParser\Parsers\TypeParsers\Common\IUriTypeParser.cs" />
<Compile Include="UriParser\Parsers\TypeParsers\Common\UriTypeParsingException.cs" />
<Compile Include="UriParser\Parsers\TypeParsers\DefaultUriTypeParser.cs" />
<Compile Include="UriParser\Parsers\TypeParsers\UriCustomTypeParsers.cs" />
<Compile Include="UriParser\Parsers\TypeParsers\UriPrimitiveTypeParser.cs" />
<Compile Include="UriParser\Parsers\LiteralParsers\Common\IUriLiteralParser.cs" />
<Compile Include="UriParser\Parsers\LiteralParsers\Common\UriLiteralParsingException.cs" />
<Compile Include="UriParser\Parsers\LiteralParsers\DefaultUriLiteralParser.cs" />
<Compile Include="UriParser\Parsers\LiteralParsers\CustomUriLiteralParsers.cs" />
<Compile Include="UriParser\Parsers\LiteralParsers\UriPrimitiveTypeParser.cs" />
<Compile Include="UriParser\Parsers\UriParserHelper.cs" />
<Compile Include="UriParser\Parsers\UriPathParser.cs" />
<Compile Include="UriParser\Parsers\UriQueryExpressionParser.cs" />
Expand Down
12 changes: 6 additions & 6 deletions src/Microsoft.OData.Core/Microsoft.OData.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@
<Compile Include="UriParser\Binders\UnaryOperatorBinder.cs" />
<Compile Include="UriParser\BuiltInUriFunctions.cs" />
<Compile Include="UriParser\CustomUriFunctions.cs" />
<Compile Include="UriParser\CustomUriTypePrefixLiterals.cs" />
<Compile Include="UriParser\CustomUriLiteralPrefixes.cs" />
<Compile Include="UriParser\ExceptionUtil.cs" />
<Compile Include="UriParser\ExpressionLexer.cs" />
<Compile Include="UriParser\ExpressionLexerLiteralExtensions.cs" />
Expand Down Expand Up @@ -466,11 +466,11 @@
<Compile Include="UriParser\Parsers\SelectExpandParser.cs" />
<Compile Include="UriParser\Parsers\SelectExpandSyntacticParser.cs" />
<Compile Include="UriParser\Parsers\SelectExpandTermParser.cs" />
<Compile Include="UriParser\Parsers\TypeParsers\Common\IUriTypeParser.cs" />
<Compile Include="UriParser\Parsers\TypeParsers\Common\UriTypeParsingException.cs" />
<Compile Include="UriParser\Parsers\TypeParsers\DefaultUriTypeParser.cs" />
<Compile Include="UriParser\Parsers\TypeParsers\UriCustomTypeParsers.cs" />
<Compile Include="UriParser\Parsers\TypeParsers\UriPrimitiveTypeParser.cs" />
<Compile Include="UriParser\Parsers\LiteralParsers\Common\IUriLiteralParser.cs" />
<Compile Include="UriParser\Parsers\LiteralParsers\Common\UriLiteralParsingException.cs" />
<Compile Include="UriParser\Parsers\LiteralParsers\DefaultUriLiteralParser.cs" />
<Compile Include="UriParser\Parsers\LiteralParsers\CustomUriLiteralParsers.cs" />
<Compile Include="UriParser\Parsers\LiteralParsers\UriPrimitiveTypeParser.cs" />
<Compile Include="UriParser\Parsers\UriParserHelper.cs" />
<Compile Include="UriParser\Parsers\UriPathParser.cs" />
<Compile Include="UriParser\Parsers\UriQueryExpressionParser.cs" />
Expand Down
25 changes: 1 addition & 24 deletions src/Microsoft.OData.Core/UriParser/CustomUriFunctions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,23 +47,6 @@ private static readonly Dictionary<string, FunctionSignatureWithReturnType[]> Cu
/// <exception cref="ODataException">Throws if built-in function signature overload already exists.</exception>
/// <exception cref="ODataException">Throws if custom function signature overload already exists</exception>
public static void AddCustomUriFunction(string functionName, FunctionSignatureWithReturnType functionSignature)
{
AddCustomUriFunction(functionName, functionSignature, false);
}

/// <summary>
/// Add a custom uri function to extend or override the built-in OData protocol of uri functions.
/// In case the function signature already exists as a built-in function, if requested (addAsOverloadToBuiltInFunction = true), the new function signature will be added as another overload.
/// In case the function name already exists as a custom function, the signature will be added as an another overload.
/// </summary>
/// <param name="functionName">The new custom function name</param>
/// <param name="functionSignature">The new custom function signature</param>
/// <param name="addAsOverloadToBuiltInFunction">If 'True', add as another overload to the existing built-in function in case signature already exists</param>
/// <exception cref="ArgumentNullException">Arguments are null, or function signature return type is null</exception>
/// <exception cref="ODataException">Throws if built-in function name already exists, and parameter 'addAsOverloadToBuiltInFunction' is not 'True'</exception>
/// <exception cref="ODataException">Throws if built-in function signature overload already exists.</exception>
/// <exception cref="ODataException">Throws if custom function signature overload already exists</exception>
public static void AddCustomUriFunction(string functionName, FunctionSignatureWithReturnType functionSignature, bool addAsOverloadToBuiltInFunction)
{
// Parameters validation
ExceptionUtils.CheckArgumentStringNotNullOrEmpty(functionName, "customFunctionName");
Expand All @@ -80,12 +63,6 @@ public static void AddCustomUriFunction(string functionName, FunctionSignatureWi
FunctionSignatureWithReturnType[] existingBuiltInFunctionOverload;
if (BuiltInUriFunctions.TryGetBuiltInFunction(functionName, out existingBuiltInFunctionOverload))
{
// Built-In function with the same signature already exists, and will not be added as an another overload by user request.
if (!addAsOverloadToBuiltInFunction)
{
throw new ODataException(Strings.CustomUriFunctions_AddCustomUriFunction_BuiltInExistsNotAddingAsOverload(functionName));
}

// Function name exists, check if full signature exists among the overloads.
if (existingBuiltInFunctionOverload.Any(builtInFunction =>
AreFunctionsSignatureEqual(functionSignature, builtInFunction)))
Expand Down Expand Up @@ -208,7 +185,7 @@ private static void AddCustomFunction(string customFunctionName, FunctionSignatu
}

// Add the custom function as an overload to the same function name
CustomFunctions[customFunctionName] =
CustomFunctions[customFunctionName] =
existingCustomFunctionOverloads.Concat(new FunctionSignatureWithReturnType[] { newCustomFunctionSignature }).ToArray();
}
}
Expand Down
Loading

0 comments on commit 14db585

Please sign in to comment.