Skip to content

Commit 4a9d159

Browse files
committed
chore: upgrade Api to netcore 3.0
1 parent 72c87bf commit 4a9d159

File tree

3 files changed

+23
-15
lines changed

3 files changed

+23
-15
lines changed

SendItemsApi/SendItemsApi.csproj

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
22

33
<PropertyGroup>
4-
<TargetFramework>netcoreapp2.1</TargetFramework>
5-
<PackageTargetFallback>portable-net45+win8</PackageTargetFallback>
4+
<TargetFramework>netcoreapp3.0</TargetFramework>
65
<AssemblyName>Denifia.Stardew.SendItemsApi</AssemblyName>
76
<RootNamespace>Denifia.Stardew.SendItemsApi</RootNamespace>
87
<Version>1.0.1</Version>
@@ -28,9 +27,6 @@
2827
<ItemGroup>
2928
<PackageReference Include="LiteDB" Version="4.1.4" />
3029
<PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.4.1" />
31-
<PackageReference Include="Microsoft.AspNetCore" Version="2.1.4" />
32-
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="2.1.3" />
33-
<PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="2.1.1" />
3430
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="2.1.4" />
3531
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="2.1.4" />
3632
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer.Design" Version="1.1.6" />

SendItemsApi/Startup.cs

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ namespace Denifia.Stardew.SendItemsApi
99
{
1010
public class Startup
1111
{
12-
public Startup(IHostingEnvironment env)
12+
public Startup(IWebHostEnvironment env)
1313
{
1414
var builder = new ConfigurationBuilder()
15-
.SetBasePath(env.ContentRootPath)
16-
.AddJsonFile("appsettings.json", optional: false, reloadOnChange: true)
17-
.AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true)
18-
.AddEnvironmentVariables();
15+
.SetBasePath(env.ContentRootPath);
16+
// .AddJsonFile("appsettings.json", optional: false, reloadOnChange: true)
17+
// .AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true)
18+
//.AddEnvironmentVariables();
1919
Configuration = builder.Build();
2020
}
2121

@@ -26,17 +26,21 @@ public void ConfigureServices(IServiceCollection services)
2626
{
2727
services.Configure<AzureStorageConfig>(Configuration.GetSection("AzureStorage"));
2828
services.AddScoped<ITableStorageRepository, AzureTableStorageRepository>();
29-
services.AddMvc();
29+
services.AddControllers();
3030
}
3131

3232
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
33-
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
33+
public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILoggerFactory loggerFactory)
3434
{
35-
loggerFactory.AddConsole(Configuration.GetSection("Logging"));
36-
loggerFactory.AddDebug();
35+
// loggerFactory.AddConsole(Configuration.GetSection("Logging"));
36+
// loggerFactory.AddDebug();
3737

38+
app.UseRouting();
3839
app.UseStaticFiles();
39-
app.UseMvc();
40+
app.UseEndpoints(x =>
41+
{
42+
x.MapControllers();
43+
});
4044
}
4145
}
4246
}

StardewMods.code-workspace

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"folders": [
3+
{
4+
"path": "."
5+
}
6+
],
7+
"settings": {}
8+
}

0 commit comments

Comments
 (0)