change the Edm model to Open API document extension methods
This commit is contained in:
parent
45eedf6c75
commit
ae97031b56
|
@ -11,26 +11,27 @@ using Microsoft.OpenApi.Models;
|
|||
namespace Microsoft.OpenApi.OData
|
||||
{
|
||||
/// <summary>
|
||||
/// Extension methods to write Entity Data Model (EDM) to Open API.
|
||||
/// Extension methods to convert <see cref="IEdmModel"/>
|
||||
/// to Open API document, <see cref="OpenApiDocument"/>.
|
||||
/// </summary>
|
||||
public static class EdmModelOpenApiMappingExtensions
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// Convert <see cref="IEdmModel"/> to <see cref="OpenApiDocument"/>.
|
||||
/// </summary>
|
||||
/// <param name="model"></param>
|
||||
/// <returns></returns>
|
||||
/// <param name="model">The Edm model.</param>
|
||||
/// <returns>The converted Open API document object.</returns>
|
||||
public static OpenApiDocument Convert(this IEdmModel model)
|
||||
{
|
||||
return new OpenApiDocumentGenerator(model).Generate();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Convert <see cref="IEdmModel"/> to <see cref="OpenApiDocument"/> using a configure action.
|
||||
/// </summary>
|
||||
/// <param name="model"></param>
|
||||
/// <param name="configure"></param>
|
||||
/// <returns></returns>
|
||||
/// <param name="model">The Edm model.</param>
|
||||
/// <param name="configure">The configure action.</param>
|
||||
/// <returns>The converted Open API document object.</returns>
|
||||
public static OpenApiDocument Convert(this IEdmModel model, Action<OpenApiDocument> configure)
|
||||
{
|
||||
return new OpenApiDocumentGenerator(model, configure).Generate();
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
|
||||
<ItemGroup>
|
||||
<Compile Remove="EdmModelOpenApiExtensions2.cs" />
|
||||
<Compile Remove="ODataOpenApiConvert.cs" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
@ -1,28 +0,0 @@
|
|||
//---------------------------------------------------------------------
|
||||
// <copyright file="ODataOpenApiConvert.cs" company="Microsoft">
|
||||
// Copyright (C) Microsoft Corporation. All rights reserved. See License.txt in the project root for license information.
|
||||
// </copyright>
|
||||
//---------------------------------------------------------------------
|
||||
|
||||
using Microsoft.OData.Edm;
|
||||
using Microsoft.OpenApi.Models;
|
||||
using System;
|
||||
|
||||
namespace Microsoft.OpenApi.OData
|
||||
{
|
||||
/// <summary>
|
||||
/// Convert <see cref="IEdmModel"/> to Open API document, <see cref="OpenApiDocument"/>.
|
||||
/// </summary>
|
||||
public static class EdmModelOpenApiExtensions
|
||||
{
|
||||
public static OpenApiDocument Convert(this IEdmModel model)
|
||||
{
|
||||
return new OpenApiDocumentGenerator(model).Generate();
|
||||
}
|
||||
|
||||
public static OpenApiDocument Convert(this IEdmModel model, Action<OpenApiDocument> configure)
|
||||
{
|
||||
return new OpenApiDocumentGenerator(model, configure).Generate();
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue