Skip to content

.NET Core 2.2 -> 3.0 #597

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 50 commits into from
Oct 29, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
24a2ef3
merge: merge into correct email:
wisepotato Oct 23, 2019
adf845b
Merge branch 'feat/upgrade-2.2' into feat/upgrade-2.2-real
wisepotato Oct 23, 2019
4124aa9
feat: upgrade to 2.2
wisepotato Oct 23, 2019
fb6aa66
chore: merge fixes
wisepotato Oct 23, 2019
17f0c8c
chore: spacing fix
wisepotato Oct 23, 2019
10ea6cb
chore: revert silencing error
wisepotato Oct 23, 2019
0a4e322
chore: small spacing fix
wisepotato Oct 23, 2019
9697449
chore: remove unneeeded dependencies
wisepotato Oct 23, 2019
931c97c
chore: fix framework dependencies
wisepotato Oct 23, 2019
dd37d8e
chore: updates
wisepotato Oct 23, 2019
aaa7655
merge: merge from dev-v4
wisepotato Oct 23, 2019
13bfdeb
chore: test fixes
wisepotato Oct 23, 2019
5b10565
chore: start integration tests
wisepotato Oct 23, 2019
487728e
chore: cleanup name of dertest
wisepotato Oct 23, 2019
80ea141
chore: start of getRepostory
wisepotato Oct 23, 2019
754e2e3
chore: upgrade testsdk version + xunit version
wisepotato Oct 23, 2019
19349ae
feat: use template in version control of packages in integrationTests
wisepotato Oct 23, 2019
7617445
feat: unit test assemblyinfo add, port old test to integration (attri…
wisepotato Oct 23, 2019
bc5c1df
docs: add version compatibility
wisepotato Oct 24, 2019
70dd35d
chore: add asterisk for version number
wisepotato Oct 24, 2019
9f11631
feat: port defaultentityrepositorytests to integration tests
wisepotato Oct 24, 2019
67dd3eb
chore: should add logging, done.
wisepotato Oct 24, 2019
15a9402
tests: bad response from tests
wisepotato Oct 24, 2019
153f9cb
chore: fixes for lang version and making ifs more noticable
wisepotato Oct 24, 2019
9e6c36b
fix: fix routing issue with upgrade to enableendpointrouting
wisepotato Oct 24, 2019
bf72324
chore: HostEnvironment -> IWebHostEnvironment
wisepotato Oct 24, 2019
07840c4
chore: act -> Act, assert -> Assert, arrange -> Arrange
wisepotato Oct 24, 2019
9ee71f5
chore: fix tests
wisepotato Oct 24, 2019
9000421
chore: re-add unit test for defaultentityrepository for test IAsyncQu…
wisepotato Oct 24, 2019
2843111
refactor: make if statements more conscise
wisepotato Oct 24, 2019
d6f763f
chore: final stretch
wisepotato Oct 24, 2019
98b1119
tests: revert for good tests
wisepotato Oct 24, 2019
cd7e19c
Revert "tests: revert for good tests"
maurei Oct 29, 2019
90ebfca
Revert "chore: final stretch"
maurei Oct 29, 2019
5f7d330
fix: client generated id tests
maurei Oct 29, 2019
f149bc9
fix: create data tests with workaround for efcore 3.0 bug
maurei Oct 29, 2019
f8e9523
refactor: DetachRelationships usage of is operator
maurei Oct 29, 2019
9ff0709
fix: move MetaStartup to other assembly as .net core 3 bug workaround
maurei Oct 29, 2019
9b2ecdf
fix: UpdatingRelationshipTests locally evaluated queries error
maurei Oct 29, 2019
57c5da1
feat: reintroduced generic processor (RepositoryRelationshipUpdateHel…
maurei Oct 29, 2019
7faa500
feat: full sql support for UpdateRelationshipsAsync using expression …
maurei Oct 29, 2019
73f43e9
fix: DeletingDataTest
maurei Oct 29, 2019
fe67998
fix: paging test
maurei Oct 29, 2019
82005ec
fix: paging unit tests
maurei Oct 29, 2019
4a3296e
chore: remove RE-split models, duplicate models to NoEntityFrameworkE…
maurei Oct 29, 2019
e83abfd
fix: NoEntityFrameworkExample tests fixed by workaround assembly problem
maurei Oct 29, 2019
a81b6ac
fix: connection string e2e test projects
maurei Oct 29, 2019
518e4d0
chore: minor cleanup
maurei Oct 29, 2019
7845250
chore: minor cleanup
maurei Oct 29, 2019
6e8ddf4
chore: cleanup
maurei Oct 29, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 14 additions & 15 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,24 +1,23 @@
<Project>

<PropertyGroup>
<NetCoreAppVersion>netcoreapp2.2</NetCoreAppVersion>
<NetStandardVersion>netstandard2.0</NetStandardVersion>
<AspNetCoreVersion>2.2.*</AspNetCoreVersion>
<MicrosoftLoggingVersion>2.2.*</MicrosoftLoggingVersion>
<MicrosoftConfigurationVersion>2.2.*</MicrosoftConfigurationVersion>
<MicrosoftOptionsVersion>2.2.*</MicrosoftOptionsVersion>
<EFCoreVersion>2.2.*</EFCoreVersion>
<EFCoreToolsVersion>2.2.*</EFCoreToolsVersion>
<NpgsqlVersion>4.0.0</NpgsqlVersion>
<NpgsqlPostgreSQLVersion>2.1.0</NpgsqlPostgreSQLVersion>
<NetCoreAppVersion>netcoreapp3.0</NetCoreAppVersion>
<NetStandardVersion>netstandard2.1</NetStandardVersion>
<AspNetCoreVersion>3.*</AspNetCoreVersion>
<MicrosoftLoggingVersion>3.*</MicrosoftLoggingVersion>
<MicrosoftConfigurationVersion>3.*</MicrosoftConfigurationVersion>
<MicrosoftOptionsVersion>3.*</MicrosoftOptionsVersion>
<EFCoreVersion>3.*</EFCoreVersion>
<EFCoreToolsVersion>3.*</EFCoreToolsVersion>
<NpgsqlVersion>4.1.1</NpgsqlVersion>
<NpgsqlPostgreSQLVersion>3.0.1</NpgsqlPostgreSQLVersion>
<TuplesVersion>4.5.0</TuplesVersion>
</PropertyGroup>

<!-- Test Project Dependencies -->
<PropertyGroup>
<TestSdkVersion>15.7.2</TestSdkVersion>
<XUnitVersion>2.3.1</XUnitVersion>
<BogusVersion>22.1.2</BogusVersion>
<MoqVersion>4.8.3</MoqVersion>
<TestSdkVersion>16.3.0</TestSdkVersion>
<XUnitVersion>2.4.1</XUnitVersion>
<BogusVersion>28.4.1</BogusVersion>
<MoqVersion>4.13.1</MoqVersion>
</PropertyGroup>
</Project>
15 changes: 15 additions & 0 deletions JsonApiDotnetCore.sln
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "JsonApiDotNetCore", "src\Js
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GettingStarted", "src\Examples\GettingStarted\GettingStarted.csproj", "{067FFD7A-C66B-473D-8471-37F5C95DF61C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IntegrationTests", "test\IntegrationTests\IntegrationTests.csproj", "{CEB08B86-6BF1-4227-B20F-45AE9C1CC6D9}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -158,6 +160,18 @@ Global
{067FFD7A-C66B-473D-8471-37F5C95DF61C}.Release|x64.Build.0 = Release|Any CPU
{067FFD7A-C66B-473D-8471-37F5C95DF61C}.Release|x86.ActiveCfg = Release|Any CPU
{067FFD7A-C66B-473D-8471-37F5C95DF61C}.Release|x86.Build.0 = Release|Any CPU
{CEB08B86-6BF1-4227-B20F-45AE9C1CC6D9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{CEB08B86-6BF1-4227-B20F-45AE9C1CC6D9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CEB08B86-6BF1-4227-B20F-45AE9C1CC6D9}.Debug|x64.ActiveCfg = Debug|Any CPU
{CEB08B86-6BF1-4227-B20F-45AE9C1CC6D9}.Debug|x64.Build.0 = Debug|Any CPU
{CEB08B86-6BF1-4227-B20F-45AE9C1CC6D9}.Debug|x86.ActiveCfg = Debug|Any CPU
{CEB08B86-6BF1-4227-B20F-45AE9C1CC6D9}.Debug|x86.Build.0 = Debug|Any CPU
{CEB08B86-6BF1-4227-B20F-45AE9C1CC6D9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CEB08B86-6BF1-4227-B20F-45AE9C1CC6D9}.Release|Any CPU.Build.0 = Release|Any CPU
{CEB08B86-6BF1-4227-B20F-45AE9C1CC6D9}.Release|x64.ActiveCfg = Release|Any CPU
{CEB08B86-6BF1-4227-B20F-45AE9C1CC6D9}.Release|x64.Build.0 = Release|Any CPU
{CEB08B86-6BF1-4227-B20F-45AE9C1CC6D9}.Release|x86.ActiveCfg = Release|Any CPU
{CEB08B86-6BF1-4227-B20F-45AE9C1CC6D9}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -173,6 +187,7 @@ Global
{789085E1-048F-4996-B600-791B9CA3A663} = {026FBC6C-AF76-4568-9B87-EC73457899FD}
{8BCFF95F-4850-427C-AEDB-B5B4F62B2C7B} = {026FBC6C-AF76-4568-9B87-EC73457899FD}
{21D27239-138D-4604-8E49-DCBE41BCE4C8} = {7A2B7ADD-ECB5-4D00-AA6A-D45BD11C97CF}
{CEB08B86-6BF1-4227-B20F-45AE9C1CC6D9} = {24B15015-62E5-42E1-9BA0-ECE6BE7AA15F}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {A2421882-8F0A-4905-928F-B550B192F9A4}
Expand Down
29 changes: 21 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,12 @@ public class Article : Identifiable
```csharp
public class ArticlesController : JsonApiController<Article>
{
public ArticlesController(
IJsonApiContext jsonApiContext,
IResourceService<Article> resourceService)
: base(jsonApiContext, resourceService) { }
public ArticlesController(
IJsonApiOptions jsonApiOptions,
IResourceService<Article> resourceService,
ILoggerFactory loggerFactory)
: base(jsonApiOptions, resourceService, loggerFactory)
{ }
}
```

Expand All @@ -79,19 +81,18 @@ public class Startup

### Development

Restore all nuget packages with:
Restore all NuGet packages with:

```bash
dotnet restore
```

#### Testing

Running tests locally requires access to a postgresql database.
If you have docker installed, this can be propped up via:
Running tests locally requires access to a PostgreSQL database. If you have docker installed, this can be propped up via:

```bash
docker run --rm --name jsonapi-dotnet-core-testing -e POSTGRES_DB=JsonApiDotNetCoreExample -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=postgres -p 5432:5432 postgres
docker run --rm --name jsonapi-dotnet-core-testing -e POSTGRES_DB=JsonApiDotNetCoreExample -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=postgres -p 5432:5432 postgres
```

And then to run the tests:
Expand All @@ -107,3 +108,15 @@ Sometimes the compiled files can be dirty / corrupt from other branches / failed
```bash
dotnet clean
```


## Compatibility

A lot of changes were introduced in v4.0.0, the following chart should help you with compatibility issues between .NET Core versions

| .NET Core Version | JADNC Version |
| ----------------- | ------------- |
| 2.0 - 2.2 | v3.* |
| 3.* | v4.* |


3 changes: 1 addition & 2 deletions src/Examples/GettingStarted/GettingStarted.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
<TargetFramework>$(NetCoreAppVersion)</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand All @@ -14,7 +14,6 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore" Version="$(AspNetCoreVersion)" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="$(EFCoreVersion)" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="$(EFCoreVersion)" />
</ItemGroup>
Expand Down
7 changes: 2 additions & 5 deletions src/Examples/GettingStarted/Startup.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.EntityFrameworkCore;
using JsonApiDotNetCore.Extensions;
Expand All @@ -21,11 +20,9 @@ public void ConfigureServices(IServiceCollection services)
discover => discover.AddCurrentAssembly(), mvcBuilder: mvcBuilder);
}

public void Configure(IApplicationBuilder app, IHostingEnvironment env, SampleDbContext context)
public void Configure(IApplicationBuilder app, SampleDbContext context)
{
context.Database.EnsureDeleted(); // indicies need to be reset
context.Database.EnsureCreated();

app.UseJsonApi();
}
}
Expand Down
18 changes: 0 additions & 18 deletions src/Examples/JsonApiDotNetCoreExample/Data/AppDbContext.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using JsonApiDotNetCoreExample.Models;
using Microsoft.EntityFrameworkCore;
using JsonApiDotNetCoreExample.Models.Entities;

namespace JsonApiDotNetCoreExample.Data
{
Expand All @@ -25,19 +24,6 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
.WithMany(p => p.TodoItems)
.HasForeignKey(t => t.OwnerId);

modelBuilder.Entity<CourseStudentEntity>()
.HasKey(r => new { r.CourseId, r.StudentId });

modelBuilder.Entity<CourseStudentEntity>()
.HasOne(r => r.Course)
.WithMany(c => c.Students)
.HasForeignKey(r => r.CourseId);

modelBuilder.Entity<CourseStudentEntity>()
.HasOne(r => r.Student)
.WithMany(s => s.Courses)
.HasForeignKey(r => r.StudentId);

modelBuilder.Entity<ArticleTag>()
.HasKey(bc => new { bc.ArticleId, bc.TagId });

Expand Down Expand Up @@ -84,10 +70,6 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
public DbSet<Author> Authors { get; set; }
public DbSet<NonJsonApiResource> NonJsonApiResources { get; set; }
public DbSet<User> Users { get; set; }
public DbSet<CourseEntity> Courses { get; set; }
public DbSet<DepartmentEntity> Departments { get; set; }
public DbSet<CourseStudentEntity> Registrations { get; set; }
public DbSet<StudentEntity> Students { get; set; }
public DbSet<PersonRole> PersonRoles { get; set; }
public DbSet<ArticleTag> ArticleTags { get; set; }
public DbSet<IdentifiableArticleTag> IdentifiableArticleTags { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore" Version="$(AspNetCoreVersion)" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Abstractions" Version="$(EFCoreVersion)" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Proxies" Version="$(EFCoreVersion)" />
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="$(MicrosoftConfigurationVersion)" />
Expand All @@ -29,4 +28,7 @@
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="$(NpgsqlPostgreSQLVersion)" />
</ItemGroup>

<ItemGroup>
<Folder Include="Startups\" />
</ItemGroup>
</Project>

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading