Add capabilities constants file and common/utils file
This commit is contained in:
parent
03761e69c4
commit
fa06f7a962
|
@ -0,0 +1,88 @@
|
||||||
|
// ------------------------------------------------------------
|
||||||
|
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||||
|
// Licensed under the MIT License (MIT). See LICENSE in the repo root for license information.
|
||||||
|
// ------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace Microsoft.OpenApi.OData.Capabilities
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Constant values for Capabilities Vocabulary
|
||||||
|
/// </summary>
|
||||||
|
internal class CapabilitiesConstants
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The namespace of Capabilities annotation.
|
||||||
|
/// </summary>
|
||||||
|
public const string Namespace = "Org.OData.Capabilities.V1.";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Org.OData.Capabilities.V1.ChangeTracking
|
||||||
|
/// </summary>
|
||||||
|
public const string ChangeTracking = Namespace + "ChangeTracking";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Org.OData.Capabilities.V1.FilterRestrictions
|
||||||
|
/// </summary>
|
||||||
|
public const string FilterRestrictions = Namespace + "FilterRestrictions";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Org.OData.Capabilities.V1.SortRestrictions
|
||||||
|
/// </summary>
|
||||||
|
public const string SortRestrictions = Namespace + "SortRestrictions";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Org.OData.Capabilities.V1.NavigationRestrictions
|
||||||
|
/// </summary>
|
||||||
|
public const string NavigationRestrictions = Namespace + "NavigationRestrictions";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Org.OData.Capabilities.V1.SearchRestrictions
|
||||||
|
/// </summary>
|
||||||
|
public const string SearchRestrictions = Namespace + "SearchRestrictions";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Org.OData.Capabilities.V1.CountRestrictions
|
||||||
|
/// </summary>
|
||||||
|
public const string CountRestrictions = Namespace + "CountRestrictions";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Org.OData.Capabilities.V1.ExpandRestrictions
|
||||||
|
/// </summary>
|
||||||
|
public const string ExpandRestrictions = Namespace + "ExpandRestrictions";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Org.OData.Capabilities.V1.DeleteRestrictions
|
||||||
|
/// </summary>
|
||||||
|
public const string DeleteRestrictions = Namespace + "DeleteRestrictions";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Org.OData.Capabilities.V1.DeleteRestrictions
|
||||||
|
/// </summary>
|
||||||
|
public const string UpdateRestrictions = Namespace + "UpdateRestrictions";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Org.OData.Capabilities.V1.InsertRestrictions
|
||||||
|
/// </summary>
|
||||||
|
public const string InsertRestrictions = Namespace + "InsertRestrictions";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Org.OData.Capabilities.V1.TopSupported
|
||||||
|
/// </summary>
|
||||||
|
public const string TopSupported = Namespace + "TopSupported";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Org.OData.Capabilities.V1.SkipSupported
|
||||||
|
/// </summary>
|
||||||
|
public const string SkipSupported = Namespace + "SkipSupported";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Org.OData.Capabilities.V1.BatchSupported
|
||||||
|
/// </summary>
|
||||||
|
public const string BatchSupported = Namespace + "BatchSupported";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Org.OData.Capabilities.V1.IndexableByKey
|
||||||
|
/// </summary>
|
||||||
|
public const string IndexableByKey = Namespace + "IndexableByKey";
|
||||||
|
}
|
||||||
|
}
|
32
src/Microsoft.OpenApi.OData.Reader/Common/Utils.cs
Normal file
32
src/Microsoft.OpenApi.OData.Reader/Common/Utils.cs
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
// ------------------------------------------------------------
|
||||||
|
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||||
|
// Licensed under the MIT License (MIT). See LICENSE in the repo root for license information.
|
||||||
|
// ------------------------------------------------------------
|
||||||
|
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace Microsoft.OpenApi.OData.Common
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Utilities methods
|
||||||
|
/// </summary>
|
||||||
|
public static class Utils
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Check the input argument whether its value is null or not.
|
||||||
|
/// </summary>
|
||||||
|
/// <typeparam name="T">The input value type.</typeparam>
|
||||||
|
/// <param name="value">The input value</param>
|
||||||
|
/// <param name="parameterName">The input parameter name.</param>
|
||||||
|
/// <returns>The input value.</returns>
|
||||||
|
internal static T CheckArgumentNull<T>(T value, string parameterName) where T : class
|
||||||
|
{
|
||||||
|
if (null == value)
|
||||||
|
{
|
||||||
|
throw new ArgumentNullException(parameterName);
|
||||||
|
}
|
||||||
|
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue