Skip to content

Commit fce35b4

Browse files
committed
Update to .NET 6
1 parent 33a957a commit fce35b4

File tree

84 files changed

+53338
-19455
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+53338
-19455
lines changed

ScryfallApi.sln

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio Version 16
4-
VisualStudioVersion = 16.0.30717.126
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.0.31912.275
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ScryfallApi.Client", "src\ScryfallApi.Client\ScryfallApi.Client.csproj", "{80A567E0-6C64-46BE-A724-83E13344A8D0}"
77
EndProject
88
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "samples", "samples", "{C470746D-B24E-4759-B7A3-6C8EDD801544}"
99
EndProject
1010
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ScryfallApi.WebSample", "samples\ScryfallApi.WebSample\ScryfallApi.WebSample.csproj", "{383BF6C1-47B7-47E8-8428-B3A114EFC3B0}"
1111
EndProject
12-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ScryfallApi.NetFxExample", "samples\ScryfallApi.NetFxExample\ScryfallApi.NetFxExample.csproj", "{9EE20F37-E50E-4395-A37D-979AD38D995A}"
13-
EndProject
1412
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{F938EC12-7230-41F9-A93F-44E9D4DCAF02}"
1513
ProjectSection(SolutionItems) = preProject
1614
README.md = README.md
@@ -30,17 +28,12 @@ Global
3028
{383BF6C1-47B7-47E8-8428-B3A114EFC3B0}.Debug|Any CPU.Build.0 = Debug|Any CPU
3129
{383BF6C1-47B7-47E8-8428-B3A114EFC3B0}.Release|Any CPU.ActiveCfg = Release|Any CPU
3230
{383BF6C1-47B7-47E8-8428-B3A114EFC3B0}.Release|Any CPU.Build.0 = Release|Any CPU
33-
{9EE20F37-E50E-4395-A37D-979AD38D995A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
34-
{9EE20F37-E50E-4395-A37D-979AD38D995A}.Debug|Any CPU.Build.0 = Debug|Any CPU
35-
{9EE20F37-E50E-4395-A37D-979AD38D995A}.Release|Any CPU.ActiveCfg = Release|Any CPU
36-
{9EE20F37-E50E-4395-A37D-979AD38D995A}.Release|Any CPU.Build.0 = Release|Any CPU
3731
EndGlobalSection
3832
GlobalSection(SolutionProperties) = preSolution
3933
HideSolutionNode = FALSE
4034
EndGlobalSection
4135
GlobalSection(NestedProjects) = preSolution
4236
{383BF6C1-47B7-47E8-8428-B3A114EFC3B0} = {C470746D-B24E-4759-B7A3-6C8EDD801544}
43-
{9EE20F37-E50E-4395-A37D-979AD38D995A} = {C470746D-B24E-4759-B7A3-6C8EDD801544}
4437
EndGlobalSection
4538
GlobalSection(ExtensibilityGlobals) = postSolution
4639
SolutionGuid = {4C1168D1-1DC7-410F-9D8C-E23492A1FD2F}

samples/ScryfallApi.NetFxExample/App.config

Lines changed: 0 additions & 14 deletions
This file was deleted.

samples/ScryfallApi.NetFxExample/Program.cs

Lines changed: 0 additions & 100 deletions
This file was deleted.

samples/ScryfallApi.NetFxExample/Properties/AssemblyInfo.cs

Lines changed: 0 additions & 36 deletions
This file was deleted.

samples/ScryfallApi.NetFxExample/ScryfallApi.NetFxExample.csproj

Lines changed: 0 additions & 79 deletions
This file was deleted.

samples/ScryfallApi.NetFxExample/packages.config

Lines changed: 0 additions & 9 deletions
This file was deleted.
Lines changed: 38 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,41 @@
1-
using Microsoft.AspNetCore.Hosting;
2-
using Microsoft.Extensions.Hosting;
1+
using ScryfallApi.Client;
32

4-
namespace ScryfallApi.WebSample
3+
var builder = WebApplication.CreateBuilder(args);
4+
5+
// Add services to the container.
6+
builder.Services.AddRazorPages();
7+
8+
// Example of pulling the config from IConfiguration
9+
/*
10+
var scryfallApiClientConfig = Configuration.GetSection("ScryfallApiClient").Get<ScryfallApiClientConfig>();
11+
services.AddScryfallApiClient(scryfallApiClientConfig);
12+
*/
13+
14+
// Example of using default settings
15+
/*
16+
services.AddScryfallApiClient();
17+
*/
18+
19+
// Example of customizing settings with code
20+
builder.Services.AddScryfallApiClient(config =>
521
{
6-
public class Program
7-
{
8-
public static void Main(string[] args)
9-
{
10-
CreateHostBuilder(args).Build().Run();
11-
}
12-
13-
public static IHostBuilder CreateHostBuilder(string[] args) =>
14-
Host.CreateDefaultBuilder(args)
15-
.ConfigureWebHostDefaults(webBuilder =>
16-
{
17-
webBuilder.UseStartup<Startup>();
18-
});
19-
}
22+
config.CacheDuration = TimeSpan.FromMinutes(30);
23+
config.UseSlidingCacheExpiration = true;
24+
});
25+
26+
var app = builder.Build();
27+
28+
// Configure the HTTP request pipeline.
29+
if (!app.Environment.IsDevelopment())
30+
{
31+
app.UseExceptionHandler("/Error");
2032
}
33+
app.UseStaticFiles();
34+
35+
app.UseRouting();
36+
37+
app.UseAuthorization();
38+
39+
app.MapRazorPages();
40+
41+
app.Run();

samples/ScryfallApi.WebSample/ScryfallApi.WebSample.csproj

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
22

33
<PropertyGroup>
4-
<TargetFramework>net5.0</TargetFramework>
4+
<TargetFramework>net6.0</TargetFramework>
5+
<Nullable>enable</Nullable>
6+
<ImplicitUsings>enable</ImplicitUsings>
57
</PropertyGroup>
68

79
<ItemGroup>

0 commit comments

Comments
 (0)