Skip to content

Commit f68efb4

Browse files
authored
Merge pull request #300 from btecu/updates
Upgrade to AspNetCore/EfCore 2.1 and use `Mvc.Core` instead of `Mvc`
2 parents e79b88e + 2390669 commit f68efb4

40 files changed

+118
-142
lines changed

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
language: csharp
22
dist: trusty
33
sudo: required
4-
services:
4+
services:
55
- postgresql
66
before_script:
77
- psql -c 'create database JsonApiDotNetCoreExample;' -U postgres
88
mono: none
9-
dotnet: 2.1.105 # https://www.microsoft.com/net/download/linux
9+
dotnet: 2.1.300 # https://www.microsoft.com/net/download/linux
1010
branches:
1111
only:
1212
- master

Directory.Build.props

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,28 +4,27 @@
44
<NetCoreAppVersion>netcoreapp2.0</NetCoreAppVersion>
55
<NetStandardVersion>netstandard2.0</NetStandardVersion>
66

7-
<AspNetCoreVersion>2.0.1</AspNetCoreVersion>
7+
<AspNetCoreVersion>2.1.0</AspNetCoreVersion>
88

9-
<MicrosoftLoggingVersion>2.0.0</MicrosoftLoggingVersion>
10-
<MicrosoftConfigurationVersion>2.0.0</MicrosoftConfigurationVersion>
11-
<MicrosoftOptionsVersion>2.0.0</MicrosoftOptionsVersion>
9+
<MicrosoftLoggingVersion>2.1.0</MicrosoftLoggingVersion>
10+
<MicrosoftConfigurationVersion>2.1.0</MicrosoftConfigurationVersion>
11+
<MicrosoftOptionsVersion>2.1.0</MicrosoftOptionsVersion>
1212

13-
<EFCoreVersion>2.0.1</EFCoreVersion>
14-
<EFCoreToolsVersion>2.0.1</EFCoreToolsVersion>
13+
<EFCoreVersion>2.1.0</EFCoreVersion>
14+
<EFCoreToolsVersion>2.1.0</EFCoreToolsVersion>
1515

16-
<NpgsqlVersion>3.2.6</NpgsqlVersion>
17-
<NpgsqlPostgreSQLVersion>2.0.0</NpgsqlPostgreSQLVersion>
16+
<NpgsqlVersion>4.0.0</NpgsqlVersion>
17+
<NpgsqlPostgreSQLVersion>2.1.0</NpgsqlPostgreSQLVersion>
1818

19-
<TuplesVersion>4.4.0</TuplesVersion>
19+
<TuplesVersion>4.5.0</TuplesVersion>
2020
</PropertyGroup>
2121

2222
<!-- Test Project Dependencies -->
2323
<PropertyGroup>
24-
<TestSdkVersion>15.3.0-preview-20170427-09</TestSdkVersion>
25-
<TestHostVersion>1.1.2</TestHostVersion>
26-
<XUnitVersion>2.3.0-beta3-build3705</XUnitVersion>
27-
<BogusVersion>15.0.3</BogusVersion>
28-
<MoqVersion>4.7.99</MoqVersion>
24+
<TestSdkVersion>15.7.2</TestSdkVersion>
25+
<XUnitVersion>2.3.1</XUnitVersion>
26+
<BogusVersion>22.1.2</BogusVersion>
27+
<MoqVersion>4.8.3</MoqVersion>
2928
</PropertyGroup>
3029

3130
</Project>

benchmarks/Benchmarks.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<AssemblyName>Benchmarks</AssemblyName>
66
</PropertyGroup>
77
<ItemGroup>
8-
<PackageReference Include="BenchmarkDotNet" Version="0.10.10" />
8+
<PackageReference Include="BenchmarkDotNet" Version="0.10.14" />
99
<PackageReference Include="moq" Version="$(MoqVersion)" />
1010
<PackageReference Include="xunit" Version="$(xUnitVersion)" />
1111
</ItemGroup>

src/Examples/JsonApiDotNetCoreExample/Controllers/Restricted/ReadOnlyController.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ namespace JsonApiDotNetCoreExample.Controllers.Restricted
55
{
66
[Route("[controller]")]
77
[HttpReadOnly]
8-
public class ReadOnlyController : Controller
8+
public class ReadOnlyController : ControllerBase
99
{
1010
[HttpGet]
1111
public IActionResult Get() => Ok();
@@ -22,7 +22,7 @@ public class ReadOnlyController : Controller
2222

2323
[Route("[controller]")]
2424
[NoHttpPost]
25-
public class NoHttpPostController : Controller
25+
public class NoHttpPostController : ControllerBase
2626
{
2727
[HttpGet]
2828
public IActionResult Get() => Ok();
@@ -39,7 +39,7 @@ public class NoHttpPostController : Controller
3939

4040
[Route("[controller]")]
4141
[NoHttpPatch]
42-
public class NoHttpPatchController : Controller
42+
public class NoHttpPatchController : ControllerBase
4343
{
4444
[HttpGet]
4545
public IActionResult Get() => Ok();
@@ -56,7 +56,7 @@ public class NoHttpPatchController : Controller
5656

5757
[Route("[controller]")]
5858
[NoHttpDelete]
59-
public class NoHttpDeleteController : Controller
59+
public class NoHttpDeleteController : ControllerBase
6060
{
6161
[HttpGet]
6262
public IActionResult Get() => Ok();

src/Examples/JsonApiDotNetCoreExample/Controllers/TestValuesController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
namespace JsonApiDotNetCoreExample.Controllers
44
{
55
[Route("[controller]")]
6-
public class TestValuesController : Controller
6+
public class TestValuesController : ControllerBase
77
{
88
[HttpGet]
99
public IActionResult Get()

src/Examples/JsonApiDotNetCoreExample/Controllers/TodoItemsCustomController.cs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,17 +33,12 @@ public CustomJsonApiController(
3333
}
3434

3535
public class CustomJsonApiController<T, TId>
36-
: Controller where T : class, IIdentifiable<TId>
36+
: ControllerBase where T : class, IIdentifiable<TId>
3737
{
3838
private readonly ILogger _logger;
3939
private readonly IResourceService<T, TId> _resourceService;
4040
private readonly IJsonApiContext _jsonApiContext;
4141

42-
protected IActionResult UnprocessableEntity()
43-
{
44-
return new StatusCodeResult(422);
45-
}
46-
4742
protected IActionResult Forbidden()
4843
{
4944
return new StatusCodeResult(403);

src/Examples/JsonApiDotNetCoreExample/JsonApiDotNetCoreExample.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,5 @@
2525
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="$(EFCoreToolsVersion)" />
2626
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="$(NpgsqlPostgreSQLVersion)" />
2727
</ItemGroup>
28+
2829
</Project>

src/Examples/JsonApiDotNetCoreExample/Migrations/20180327120810_initial.Designer.cs

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Examples/JsonApiDotNetCoreExample/Migrations/20180327120810_initial.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
using Microsoft.EntityFrameworkCore.Metadata;
1+
using Microsoft.EntityFrameworkCore.Metadata;
22
using Microsoft.EntityFrameworkCore.Migrations;
33
using System;
44
using System.Collections.Generic;
5+
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
56

67
namespace JsonApiDotNetCoreExample.Migrations
78
{

src/Examples/JsonApiDotNetCoreExample/Migrations/AppDbContextModelSnapshot.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// <auto-generated />
1+
// <auto-generated />
22
using JsonApiDotNetCoreExample.Data;
33
using Microsoft.EntityFrameworkCore;
44
using Microsoft.EntityFrameworkCore.Infrastructure;
@@ -7,6 +7,7 @@
77
using Microsoft.EntityFrameworkCore.Storage;
88
using Microsoft.EntityFrameworkCore.Storage.Internal;
99
using System;
10+
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
1011

1112
namespace JsonApiDotNetCoreExample.Migrations
1213
{

0 commit comments

Comments
 (0)