@ -34,8 +34,7 @@ namespace Oqtane.Controllers
|
||||
|
||||
using (var httpClient = new HttpClient())
|
||||
{
|
||||
CancellationToken token;
|
||||
var searchResult = await GetJson<SearchResult>(httpClient, "https://azuresearch-usnc.nuget.org/query?q=tags:oqtane", token);
|
||||
var searchResult = await GetJson<SearchResult>(httpClient, "https://azuresearch-usnc.nuget.org/query?q=tags:oqtane");
|
||||
foreach(Data data in searchResult.Data)
|
||||
{
|
||||
if (data.Tags.Contains(tag))
|
||||
@ -61,9 +60,8 @@ namespace Oqtane.Controllers
|
||||
{
|
||||
using (var httpClient = new HttpClient())
|
||||
{
|
||||
CancellationToken token;
|
||||
folder = Path.Combine(_environment.WebRootPath, folder);
|
||||
var response = await httpClient.GetAsync("https://www.nuget.org/api/v2/package/" + packageid.ToLower() + "/" + version, token).ConfigureAwait(false);
|
||||
var response = await httpClient.GetAsync("https://www.nuget.org/api/v2/package/" + packageid.ToLower() + "/" + version).ConfigureAwait(false);
|
||||
response.EnsureSuccessStatusCode();
|
||||
string filename = packageid + "." + version + ".nupkg";
|
||||
using (var fileStream = new FileStream(Path.Combine(folder, filename), FileMode.Create, FileAccess.Write, FileShare.None))
|
||||
@ -73,10 +71,10 @@ namespace Oqtane.Controllers
|
||||
}
|
||||
}
|
||||
|
||||
private async Task<T> GetJson<T>(HttpClient httpClient, string url, CancellationToken token)
|
||||
private async Task<T> GetJson<T>(HttpClient httpClient, string url)
|
||||
{
|
||||
Uri uri = new Uri(url);
|
||||
var response = await httpClient.GetAsync(uri, token).ConfigureAwait(false);
|
||||
var response = await httpClient.GetAsync(uri).ConfigureAwait(false);
|
||||
response.EnsureSuccessStatusCode();
|
||||
var stream = await response.Content.ReadAsStreamAsync();
|
||||
using (var streamReader = new StreamReader(stream))
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
<TargetFramework>net5.0</TargetFramework>
|
||||
<LangVersion>7.3</LangVersion>
|
||||
<Configurations>Debug;Release</Configurations>
|
||||
<Version>1.0.4</Version>
|
||||
@ -37,15 +37,15 @@
|
||||
<EmbeddedResource Include="Modules\HtmlText\Scripts\HtmlText.Uninstall.sql" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="dbup" Version="4.3.0" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="3.2.0" />
|
||||
<PackageReference Include="dbup" Version="4.4.0" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="5.0.0-rc.1.20451.17" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="3.1.4" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="3.1.4" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="3.1.4" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="3.1.4" />
|
||||
<PackageReference Include="Microsoft.Extensions.Localization" Version="3.1.3" />
|
||||
<PackageReference Include="Swashbuckle.AspNetCore" Version="5.4.1" />
|
||||
<PackageReference Include="System.Drawing.Common" Version="4.7.0" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="5.0.0-rc.1.20451.17" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="5.0.0-rc.1.20451.13" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="5.0.0-rc.1.20451.13" />
|
||||
<PackageReference Include="Microsoft.Extensions.Localization" Version="5.0.0-rc.1.20451.17" />
|
||||
<PackageReference Include="Swashbuckle.AspNetCore" Version="5.6.3" />
|
||||
<PackageReference Include="System.Drawing.Common" Version="5.0.0-rc.1.20451.14" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Oqtane.Client\Oqtane.Client.csproj" />
|
||||
|
Reference in New Issue
Block a user