Skip to content

Commit

Permalink
.NET 5.0 (#118)
Browse files Browse the repository at this point in the history
Co-authored-by: Joao Grassi <joao@joaograssi.com>
  • Loading branch information
bruno-garcia and joaopgrassi committed Nov 22, 2020
1 parent dc71f97 commit d114dc6
Show file tree
Hide file tree
Showing 24 changed files with 364 additions and 441 deletions.
7 changes: 2 additions & 5 deletions .github/workflows/api-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,10 @@ jobs:
steps:
- name: Check out code
uses: actions/checkout@v2
with:
submodules: true

- name: Install .NET Core SDK
- name: .NET Core CLI 5.0 RC1
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.102
dotnet-version: '5.0.100'

- name: Build
run: dotnet build -c Release
Expand Down
7 changes: 2 additions & 5 deletions .github/workflows/scheduler-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,10 @@ jobs:
steps:
- name: Check out code
uses: actions/checkout@v2
with:
submodules: true

- name: Install .NET Core SDK
- name: .NET Core CLI 5.0 RC1
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.102
dotnet-version: '5.0.100'

- name: Build
run: dotnet build -c Release
Expand Down
3 changes: 0 additions & 3 deletions .gitmodules

This file was deleted.

18 changes: 0 additions & 18 deletions NuGetTrends.sln
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
global.json = global.json
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Shortr", "src\Shortr\src\Shortr\Shortr.csproj", "{CB5B370A-9C85-4061-8750-53213B780769}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Shortr.Npgsql", "src\Shortr\src\Shortr.Npgsql\Shortr.Npgsql.csproj", "{5100C8E5-2EBF-4E54-A3B5-A51F42B5AC7D}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Shortr.AspNetCore", "src\Shortr\src\Shortr.AspNetCore\Shortr.AspNetCore.csproj", "{97F2C54F-2A31-44A4-91BB-E88E24EF86AD}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -49,18 +43,6 @@ Global
{A6E228CA-5E81-4B3C-82E3-5CF18BB0784D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A6E228CA-5E81-4B3C-82E3-5CF18BB0784D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A6E228CA-5E81-4B3C-82E3-5CF18BB0784D}.Release|Any CPU.Build.0 = Release|Any CPU
{CB5B370A-9C85-4061-8750-53213B780769}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{CB5B370A-9C85-4061-8750-53213B780769}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CB5B370A-9C85-4061-8750-53213B780769}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CB5B370A-9C85-4061-8750-53213B780769}.Release|Any CPU.Build.0 = Release|Any CPU
{5100C8E5-2EBF-4E54-A3B5-A51F42B5AC7D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5100C8E5-2EBF-4E54-A3B5-A51F42B5AC7D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5100C8E5-2EBF-4E54-A3B5-A51F42B5AC7D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5100C8E5-2EBF-4E54-A3B5-A51F42B5AC7D}.Release|Any CPU.Build.0 = Release|Any CPU
{97F2C54F-2A31-44A4-91BB-E88E24EF86AD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{97F2C54F-2A31-44A4-91BB-E88E24EF86AD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{97F2C54F-2A31-44A4-91BB-E88E24EF86AD}.Release|Any CPU.ActiveCfg = Release|Any CPU
{97F2C54F-2A31-44A4-91BB-E88E24EF86AD}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
3 changes: 2 additions & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"sdk": {
"version": "3.1.100"
"version": "5.0.100",
"rollForward": "latestMinor"
}
}
4 changes: 2 additions & 2 deletions src/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<Project>
<PropertyGroup>
<LangVersion>8.0</LangVersion>
<LangVersion>9.0</LangVersion>
<Nullable>enable</Nullable>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<NoWarn>$(NoWarn);1591</NoWarn>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0 " PrivateAssets="All" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.0-beta-20204-02 " PrivateAssets="All" />
</ItemGroup>
</Project>
4 changes: 2 additions & 2 deletions src/NuGet.Protocol.Catalog/NuGet.Protocol.Catalog.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions">
<Version>3.1.1</Version>
<Version>5.0.0-rc.1.20451.14</Version>
</PackageReference>
<PackageReference Include="Newtonsoft.Json">
<Version>12.0.3</Version>
</PackageReference>
<PackageReference Include="NuGet.Protocol">
<Version>5.4.0</Version>
<Version>5.8.0-preview.3.6823</Version>
</PackageReference>
</ItemGroup>

Expand Down
24 changes: 12 additions & 12 deletions src/NuGetTrends.Api/NuGetTrends.Api.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net5.0</TargetFramework>
<IncludeOpenAPIAnalyzers>true</IncludeOpenAPIAnalyzers>
</PropertyGroup>

Expand All @@ -12,20 +12,20 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Swashbuckle.AspNetCore" Version="5.0.0" />
<PackageReference Include="Sentry.AspNetCore" Version="2.0.2" />
<PackageReference Include="Sentry.Serilog" Version="2.0.2" />
<PackageReference Include="Serilog.AspNetCore" Version="2.1.1" />
<PackageReference Include="Serilog.Settings.Configuration" Version="3.1.0" />
<PackageReference Include="Serilog.Sinks.Console" Version="3.1.1" />
<PackageReference Include="Serilog.Sinks.Logz.Io" Version="2.2.1" />
<PackageReference Include="Serilog.Enrichers.Environment" Version="2.1.3" />
<PackageReference Include="Shortr.AspNetCore" Version="1.0.0-beta01" />
<PackageReference Include="Shortr.Npgsql" Version="1.0.0-beta01" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="5.6.1" />
<PackageReference Include="Sentry.AspNetCore" Version="3.0.0-alpha.4" />
<PackageReference Include="Sentry.Serilog" Version="3.0.0-alpha.4" />
<PackageReference Include="Serilog.AspNetCore" Version="3.4.1-dev-00180" />
<PackageReference Include="Serilog.Settings.Configuration" Version="3.2.0-dev-00244" />
<PackageReference Include="Serilog.Sinks.Console" Version="4.0.0-dev-00839" />
<PackageReference Include="Serilog.Sinks.Logz.Io" Version="2.2.2" />
<PackageReference Include="Serilog.Enrichers.Environment" Version="2.2.0-dev-00761" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\NuGetTrends.Data\NuGetTrends.Data.csproj" />
<ProjectReference Include="..\Shortr\src\Shortr.AspNetCore\Shortr.AspNetCore.csproj" />
<ProjectReference Include="..\Shortr\src\Shortr.Npgsql\Shortr.Npgsql.csproj" />
</ItemGroup>
</ItemGroup>

</Project>
3 changes: 2 additions & 1 deletion src/NuGetTrends.Api/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ public void ConfigureServices(IServiceCollection services)
services
.AddDbContext<NuGetTrendsContext>(options =>
{
options.UseNpgsql(Configuration.GetConnectionString("NuGetTrends"));
options
.UseNpgsql(Configuration.GetConnectionString("NuGetTrends"));
if (_hostingEnvironment.IsDevelopment())
{
options.EnableSensitiveDataLogging();
Expand Down
10 changes: 6 additions & 4 deletions src/NuGetTrends.Data/BasePostgresContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@ public abstract class BasePostgresContext : DbContext

protected BasePostgresContext(DbContextOptions options)
: base(options)
{

}
{ }

protected override void OnModelCreating(ModelBuilder modelBuilder)
{
Expand Down Expand Up @@ -60,7 +58,11 @@ private void ConvertToSnake(INpgsqlNameTranslator mapper, object entity)
table.SetTableName(ConvertGeneralToSnake(mapper, table.GetTableName()));
break;
case IMutableProperty property:
#pragma warning disable 618
// https://github.com/dotnet/efcore/issues/23301#issuecomment-727003676
// If you have a model for 3.1 and you haven't changed it to use TPT, then you should be okay calling the implementation above in 5.0.
property.SetColumnName(ConvertGeneralToSnake(mapper, property.GetColumnName()));
#pragma warning restore 618
break;
case IMutableKey primaryKey:
primaryKey.SetName(ConvertKeyToSnake(mapper, primaryKey.GetName()));
Expand All @@ -69,7 +71,7 @@ private void ConvertToSnake(INpgsqlNameTranslator mapper, object entity)
foreignKey.SetConstraintName(ConvertKeyToSnake(mapper, foreignKey.GetConstraintName()));
break;
case IMutableIndex indexKey:
indexKey.SetName(ConvertKeyToSnake(mapper, indexKey.GetName()));
indexKey.SetDatabaseName(ConvertKeyToSnake(mapper, indexKey.GetDatabaseName()));
break;
default:
throw new NotImplementedException("Unexpected type was provided to snake case converter");
Expand Down
146 changes: 0 additions & 146 deletions src/NuGetTrends.Data/Migrations/20200320022342_EFUpgrade.cs

This file was deleted.

Loading

0 comments on commit d114dc6

Please sign in to comment.