- bumps everything to net6 for supportability
Signed-off-by: Vincent Biret <vibiret@microsoft.com>
This commit is contained in:
parent
336a7dba80
commit
9073743d90
|
@ -16,7 +16,6 @@ using System.Text;
|
|||
using Microsoft.OpenApi.Extensions;
|
||||
using Microsoft.OpenApi.Models;
|
||||
using Microsoft.OpenApi.OData;
|
||||
using System.Net;
|
||||
using System.Xml;
|
||||
using System.Threading.Tasks;
|
||||
using System.Net.Http;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net5.0-windows</TargetFramework>
|
||||
<TargetFramework>net6.0-windows</TargetFramework>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
|
||||
<UseWindowsForms>true</UseWindowsForms>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net5.0</TargetFramework>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
@ -5,14 +5,13 @@
|
|||
//---------------------------------------------------------------------
|
||||
|
||||
using System;
|
||||
using System.Net;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using System.Xml.Linq;
|
||||
using Microsoft.OData.Edm;
|
||||
using Microsoft.OData.Edm.Csdl;
|
||||
using Microsoft.OpenApi;
|
||||
using Microsoft.OpenApi.OData;
|
||||
using System.Net.Http;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace OoasUtil
|
||||
{
|
||||
|
@ -44,20 +43,17 @@ namespace OoasUtil
|
|||
/// </summary>
|
||||
protected override IEdmModel GetEdmModel()
|
||||
{
|
||||
Uri requestUri = new Uri(Input.OriginalString + "/$metadata");
|
||||
Uri requestUri = new (Input.OriginalString + "/$metadata");
|
||||
|
||||
WebRequest request = WebRequest.Create(requestUri);
|
||||
|
||||
WebResponse response = request.GetResponse();
|
||||
|
||||
Stream receivedStream = response.GetResponseStream();
|
||||
|
||||
StreamReader reader = new StreamReader(receivedStream, Encoding.UTF8);
|
||||
|
||||
string csdl = reader.ReadToEnd();
|
||||
string csdl = GetModelDocumentAsync(requestUri).GetAwaiter().GetResult();
|
||||
|
||||
return CsdlReader.Parse(XElement.Parse(csdl).CreateReader());
|
||||
}
|
||||
private async Task<string> GetModelDocumentAsync(Uri requestUri) {
|
||||
HttpResponseMessage response = await client.GetAsync(requestUri);
|
||||
return await response.Content.ReadAsStringAsync();
|
||||
}
|
||||
private static readonly HttpClient client = new ();
|
||||
|
||||
protected override void ModifySettings()
|
||||
{
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net5.0</TargetFramework>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<OutputType>Exe</OutputType>
|
||||
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
|
||||
</PropertyGroup>
|
||||
|
|
Loading…
Reference in a new issue