feat: update to net7
This commit is contained in:
parent
3cab23c592
commit
bae09d2727
2 changed files with 151 additions and 151 deletions
|
|
@ -3,9 +3,10 @@ using System.Net.Http;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Text.Json;
|
using System.Text.Json;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
using System.Text.Json.Serialization;
|
||||||
|
|
||||||
|
namespace QuickChart;
|
||||||
|
|
||||||
namespace QuickChart
|
|
||||||
{
|
|
||||||
internal class QuickChartShortUrlResponse
|
internal class QuickChartShortUrlResponse
|
||||||
{
|
{
|
||||||
#pragma warning disable IDE1006 // Naming Styles
|
#pragma warning disable IDE1006 // Naming Styles
|
||||||
|
|
@ -29,7 +30,7 @@ namespace QuickChart
|
||||||
public string Host { get; set; }
|
public string Host { get; set; }
|
||||||
public int Port { get; set; }
|
public int Port { get; set; }
|
||||||
|
|
||||||
private static readonly HttpClient Client = new HttpClient();
|
private static readonly HttpClient Client = new();
|
||||||
|
|
||||||
public Chart(string scheme = null, string host = null, int? port = null)
|
public Chart(string scheme = null, string host = null, int? port = null)
|
||||||
{
|
{
|
||||||
|
|
@ -69,10 +70,10 @@ namespace QuickChart
|
||||||
}
|
}
|
||||||
|
|
||||||
var builder = new StringBuilder();
|
var builder = new StringBuilder();
|
||||||
_ = builder.Append("w=").Append(this.Width.ToString());
|
_ = builder.Append("w=").Append(this.Width);
|
||||||
_ = builder.Append("&h=").Append(this.Height.ToString());
|
_ = builder.Append("&h=").Append(this.Height);
|
||||||
|
|
||||||
_ = builder.Append("&devicePixelRatio=").Append(this.DevicePixelRatio.ToString());
|
_ = builder.Append("&devicePixelRatio=").Append(this.DevicePixelRatio);
|
||||||
_ = builder.Append("&f=").Append(this.Format);
|
_ = builder.Append("&f=").Append(this.Format);
|
||||||
_ = builder.Append("&bkg=").Append(Uri.EscapeDataString(this.BackgroundColor));
|
_ = builder.Append("&bkg=").Append(Uri.EscapeDataString(this.BackgroundColor));
|
||||||
_ = builder.Append("&c=").Append(Uri.EscapeDataString(this.Config));
|
_ = builder.Append("&c=").Append(Uri.EscapeDataString(this.Config));
|
||||||
|
|
@ -97,7 +98,7 @@ namespace QuickChart
|
||||||
|
|
||||||
var options = new JsonSerializerOptions
|
var options = new JsonSerializerOptions
|
||||||
{
|
{
|
||||||
IgnoreNullValues = true
|
DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
|
||||||
};
|
};
|
||||||
|
|
||||||
var json = JsonSerializer.Serialize(new
|
var json = JsonSerializer.Serialize(new
|
||||||
|
|
@ -138,7 +139,7 @@ namespace QuickChart
|
||||||
|
|
||||||
var options = new JsonSerializerOptions
|
var options = new JsonSerializerOptions
|
||||||
{
|
{
|
||||||
IgnoreNullValues = true
|
DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
|
||||||
};
|
};
|
||||||
|
|
||||||
var json = JsonSerializer.Serialize(new
|
var json = JsonSerializer.Serialize(new
|
||||||
|
|
@ -176,4 +177,3 @@ namespace QuickChart
|
||||||
|
|
||||||
public HttpResponseMessage Response { get; private set; }
|
public HttpResponseMessage Response { get; private set; }
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<OutputType>Library</OutputType>
|
<OutputType>Library</OutputType>
|
||||||
<TargetFrameworks>netcoreapp3.1;netstandard2.0;net472</TargetFrameworks>
|
<TargetFrameworks>net7.0</TargetFrameworks>
|
||||||
<PackOnBuild>true</PackOnBuild>
|
<PackOnBuild>true</PackOnBuild>
|
||||||
<Authors>Ian Webster</Authors>
|
<Authors>Ian Webster</Authors>
|
||||||
<Copyright>Ian Webster</Copyright>
|
<Copyright>Ian Webster</Copyright>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue