Skip to content

update develop #311

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 24 commits into from
Jun 18, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
e7dc018
test(spec): can create hasOne relationship with resource
jaredcnance Jun 10, 2018
b6bbbdb
Merge pull request #296 from json-api-dotnet/test/creating-has-one
jaredcnance Jun 10, 2018
50cfa8d
Merge pull request #254 from json-api-dotnet/fix/#237
jaredcnance Jun 12, 2018
99ce78e
docs(*): add xml comments
jaredcnance Jun 12, 2018
ab15d70
Make `AddJsonApi` chainable
btecu Jun 12, 2018
4ac497c
Merge pull request #298 from json-api-dotnet/docs/xml-documentation
jaredcnance Jun 12, 2018
3fc1099
Merge pull request #299 from btecu/services
jaredcnance Jun 12, 2018
443e039
Use `MvcCore` instead of `Mvc`
btecu Jun 12, 2018
bbe0375
Update dependencies
btecu Jun 12, 2018
ad39fd7
Fix tests, cleanup warning (deprecations)
btecu Jun 12, 2018
3757b5c
Reduce verbosity
btecu Jun 13, 2018
1f474d2
Merge pull request #303 from btecu/verbosity
jaredcnance Jun 13, 2018
2103344
Further reduce tests verbosity
btecu Jun 13, 2018
12a385b
Make paths consistent
btecu Jun 13, 2018
43ac8b0
Remove already included packages
btecu Jun 13, 2018
e79b88e
Merge pull request #304 from btecu/verbosity
jaredcnance Jun 13, 2018
9c45cb5
fix test issue and bump package version to 2.3.0
jaredcnance Jun 14, 2018
2390669
Merge branch 'master' into updates
jaredcnance Jun 14, 2018
f68efb4
Merge pull request #300 from btecu/updates
jaredcnance Jun 14, 2018
27f890a
Link to performance reports and related projects
jaredcnance Jun 15, 2018
8b0c3fd
Merge pull request #306 from json-api-dotnet/jaredcnance-patch-1
jaredcnance Jun 15, 2018
1f5608e
make attr constructor public
jaredcnance Jun 18, 2018
55407f2
update version 2.3.1
jaredcnance Jun 18, 2018
8f7f0f7
Merge pull request #309 from json-api-dotnet/jaredcnance-patch-1
jaredcnance Jun 18, 2018
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
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
language: csharp
dist: trusty
sudo: required
services:
services:
- postgresql
before_script:
- psql -c 'create database JsonApiDotNetCoreExample;' -U postgres
mono: none
dotnet: 2.1.105 # https://www.microsoft.com/net/download/linux
dotnet: 2.1.300 # https://www.microsoft.com/net/download/linux
branches:
only:
- master
Expand Down
27 changes: 13 additions & 14 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,27 @@
<NetCoreAppVersion>netcoreapp2.0</NetCoreAppVersion>
<NetStandardVersion>netstandard2.0</NetStandardVersion>

<AspNetCoreVersion>2.0.1</AspNetCoreVersion>
<AspNetCoreVersion>2.1.0</AspNetCoreVersion>

<MicrosoftLoggingVersion>2.0.0</MicrosoftLoggingVersion>
<MicrosoftConfigurationVersion>2.0.0</MicrosoftConfigurationVersion>
<MicrosoftOptionsVersion>2.0.0</MicrosoftOptionsVersion>
<MicrosoftLoggingVersion>2.1.0</MicrosoftLoggingVersion>
<MicrosoftConfigurationVersion>2.1.0</MicrosoftConfigurationVersion>
<MicrosoftOptionsVersion>2.1.0</MicrosoftOptionsVersion>

<EFCoreVersion>2.0.1</EFCoreVersion>
<EFCoreToolsVersion>2.0.1</EFCoreToolsVersion>
<EFCoreVersion>2.1.0</EFCoreVersion>
<EFCoreToolsVersion>2.1.0</EFCoreToolsVersion>

<NpgsqlVersion>3.2.6</NpgsqlVersion>
<NpgsqlPostgreSQLVersion>2.0.0</NpgsqlPostgreSQLVersion>
<NpgsqlVersion>4.0.0</NpgsqlVersion>
<NpgsqlPostgreSQLVersion>2.1.0</NpgsqlPostgreSQLVersion>

<TuplesVersion>4.4.0</TuplesVersion>
<TuplesVersion>4.5.0</TuplesVersion>
</PropertyGroup>

<!-- Test Project Dependencies -->
<PropertyGroup>
<TestSdkVersion>15.3.0-preview-20170427-09</TestSdkVersion>
<TestHostVersion>1.1.2</TestHostVersion>
<XUnitVersion>2.3.0-beta3-build3705</XUnitVersion>
<BogusVersion>15.0.3</BogusVersion>
<MoqVersion>4.7.99</MoqVersion>
<TestSdkVersion>15.7.2</TestSdkVersion>
<XUnitVersion>2.3.1</XUnitVersion>
<BogusVersion>22.1.2</BogusVersion>
<MoqVersion>4.8.3</MoqVersion>
</PropertyGroup>

</Project>
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,14 @@ These are some steps you can take to help you understand what this project is an
- [The json:api specification](http://jsonapi.org/format/)
- [Demo [Video]](https://youtu.be/KAMuo6K7VcE)
- [Our documentation](https://json-api-dotnet.github.io)
- Check out the examples in the next section
- [Check out the example projects](https://github.com/json-api-dotnet/JsonApiDotNetCore/tree/master/src/Examples)

## Related Projects

- [Performance Reports](https://github.com/json-api-dotnet/PerformanceReports)
- [JsonApiDotNetCore.MongoDb](https://github.com/json-api-dotnet/JsonApiDotNetCore.MongoDb)
- [JsonApiDotNetCore.Marten](https://github.com/wayne-o/JsonApiDotNetCore.Marten)
- [Todo List App](https://github.com/json-api-dotnet/TodoListExample)

## Examples

Expand Down
4 changes: 2 additions & 2 deletions benchmarks/Benchmarks.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
<AssemblyName>Benchmarks</AssemblyName>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="BenchmarkDotNet" Version="0.10.10" />
<PackageReference Include="BenchmarkDotNet" Version="0.10.14" />
<PackageReference Include="moq" Version="$(MoqVersion)" />
<PackageReference Include="xunit" Version="$(xUnitVersion)" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\src\JsonApiDotNetCore\JsonApiDotNetCore.csproj" />
<ProjectReference Include="../src/JsonApiDotNetCore/JsonApiDotNetCore.csproj" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace JsonApiDotNetCoreExample.Controllers.Restricted
{
[Route("[controller]")]
[HttpReadOnly]
public class ReadOnlyController : Controller
public class ReadOnlyController : ControllerBase
{
[HttpGet]
public IActionResult Get() => Ok();
Expand All @@ -22,7 +22,7 @@ public class ReadOnlyController : Controller

[Route("[controller]")]
[NoHttpPost]
public class NoHttpPostController : Controller
public class NoHttpPostController : ControllerBase
{
[HttpGet]
public IActionResult Get() => Ok();
Expand All @@ -39,7 +39,7 @@ public class NoHttpPostController : Controller

[Route("[controller]")]
[NoHttpPatch]
public class NoHttpPatchController : Controller
public class NoHttpPatchController : ControllerBase
{
[HttpGet]
public IActionResult Get() => Ok();
Expand All @@ -56,7 +56,7 @@ public class NoHttpPatchController : Controller

[Route("[controller]")]
[NoHttpDelete]
public class NoHttpDeleteController : Controller
public class NoHttpDeleteController : ControllerBase
{
[HttpGet]
public IActionResult Get() => Ok();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace JsonApiDotNetCoreExample.Controllers
{
[Route("[controller]")]
public class TestValuesController : Controller
public class TestValuesController : ControllerBase
{
[HttpGet]
public IActionResult Get()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,12 @@ public CustomJsonApiController(
}

public class CustomJsonApiController<T, TId>
: Controller where T : class, IIdentifiable<TId>
: ControllerBase where T : class, IIdentifiable<TId>
{
private readonly ILogger _logger;
private readonly IResourceService<T, TId> _resourceService;
private readonly IJsonApiContext _jsonApiContext;

protected IActionResult UnprocessableEntity()
{
return new StatusCodeResult(422);
}

protected IActionResult Forbidden()
{
return new StatusCodeResult(403);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,4 @@
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="$(NpgsqlPostgreSQLVersion)" />
</ItemGroup>

<ItemGroup>
<DotNetCliToolReference Include="Microsoft.EntityFrameworkCore.Tools.DotNet" Version="$(EFCoreToolsVersion)" />
</ItemGroup>

</Project>

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using System;
using System.Collections.Generic;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;

namespace JsonApiDotNetCoreExample.Migrations
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// <auto-generated />
// <auto-generated />
using JsonApiDotNetCoreExample.Data;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
Expand All @@ -7,6 +7,7 @@
using Microsoft.EntityFrameworkCore.Storage;
using Microsoft.EntityFrameworkCore.Storage.Internal;
using System;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;

namespace JsonApiDotNetCoreExample.Migrations
{
Expand Down
26 changes: 11 additions & 15 deletions src/Examples/JsonApiDotNetCoreExample/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,17 @@ public Startup(IHostingEnvironment env)
public virtual IServiceProvider ConfigureServices(IServiceCollection services)
{
var loggerFactory = new LoggerFactory();
loggerFactory.AddConsole(LogLevel.Trace);
services.AddSingleton<ILoggerFactory>(loggerFactory);
loggerFactory.AddConsole(LogLevel.Warning);

services.AddDbContext<AppDbContext>(options =>
{
options.UseNpgsql(GetDbConnectionString());
}, ServiceLifetime.Transient);

services.AddJsonApi<AppDbContext>(opt =>
{
opt.Namespace = "api/v1";
opt.DefaultPageSize = 5;
opt.IncludeTotalRecordCount = true;
});
services
.AddSingleton<ILoggerFactory>(loggerFactory)
.AddDbContext<AppDbContext>(options =>
options.UseNpgsql(GetDbConnectionString()), ServiceLifetime.Transient)
.AddJsonApi<AppDbContext>(options => {
options.Namespace = "api/v1";
options.DefaultPageSize = 5;
options.IncludeTotalRecordCount = true;
});

var provider = services.BuildServiceProvider();
var appContext = provider.GetRequiredService<AppDbContext>();
Expand All @@ -60,11 +57,10 @@ public virtual void Configure(
context.Database.EnsureCreated();

loggerFactory.AddConsole(Config.GetSection("Logging"));
loggerFactory.AddDebug();

app.UseJsonApi();
}

public string GetDbConnectionString() => Config["Data:DefaultConnection"];
}
}
}
6 changes: 3 additions & 3 deletions src/Examples/JsonApiDotNetCoreExample/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
"Logging": {
"IncludeScopes": false,
"LogLevel": {
"Default": "Trace",
"System": "Trace",
"Microsoft": "Trace"
"Default": "Warning",
"System": "Warning",
"Microsoft": "Warning"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="$(MicrosoftLoggingVersion)" />
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="$(NpgsqlPostgreSQLVersion)" />
<PackageReference Include="Npgsql" Version="$(NpgsqlVersion)" />
<PackageReference Include="Dapper" Version="1.50.2" />
<PackageReference Include="Dapper" Version="1.50.5" />
</ItemGroup>

</Project>
5 changes: 2 additions & 3 deletions src/Examples/NoEntityFrameworkExample/Startup.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using JsonApiDotNetCore.Extensions;
using JsonApiDotNetCore.Extensions;
using JsonApiDotNetCore.Services;
using JsonApiDotNetCoreExample.Data;
using JsonApiDotNetCoreExample.Models;
Expand Down Expand Up @@ -31,7 +31,7 @@ public Startup(IHostingEnvironment env)
public virtual IServiceProvider ConfigureServices(IServiceCollection services)
{
// Add framework services.
var mvcBuilder = services.AddMvc();
var mvcBuilder = services.AddMvcCore();

services.AddJsonApi(options => {
options.Namespace = "api/v1";
Expand All @@ -55,7 +55,6 @@ public virtual IServiceProvider ConfigureServices(IServiceCollection services)
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory, AppDbContext context)
{
loggerFactory.AddConsole(Configuration.GetSection("Logging"));
loggerFactory.AddDebug();

context.Database.EnsureCreated();

Expand Down
6 changes: 1 addition & 5 deletions src/Examples/OperationsExample/OperationsExample.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<ItemGroup>
<ProjectReference Include="../../JsonApiDotNetCore/JsonApiDotNetCore.csproj" />
<ProjectReference Include="..\JsonApiDotNetCoreExample\JsonApiDotNetCoreExample.csproj" />
<ProjectReference Include="../JsonApiDotNetCoreExample/JsonApiDotNetCoreExample.csproj" />
</ItemGroup>

<ItemGroup>
Expand All @@ -27,8 +27,4 @@
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="$(NpgsqlPostgreSQLVersion)" />
</ItemGroup>

<ItemGroup>
<DotNetCliToolReference Include="Microsoft.EntityFrameworkCore.Tools.DotNet" Version="$(EFCoreToolsVersion)" />
</ItemGroup>

</Project>
3 changes: 1 addition & 2 deletions src/Examples/OperationsExample/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public Startup(IHostingEnvironment env)
public virtual IServiceProvider ConfigureServices(IServiceCollection services)
{
var loggerFactory = new LoggerFactory();
loggerFactory.AddConsole(LogLevel.Trace);
loggerFactory.AddConsole(LogLevel.Warning);

services.AddSingleton<ILoggerFactory>(loggerFactory);

Expand All @@ -47,7 +47,6 @@ public virtual void Configure(
context.Database.EnsureCreated();

loggerFactory.AddConsole(Config.GetSection("Logging"));
loggerFactory.AddDebug();
app.UseJsonApi();
}

Expand Down
6 changes: 3 additions & 3 deletions src/Examples/OperationsExample/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
"Logging": {
"IncludeScopes": false,
"LogLevel": {
"Default": "Trace",
"System": "Trace",
"Microsoft": "Trace"
"Default": "Warning",
"System": "Warning",
"Microsoft": "Warning"
}
}
}
4 changes: 2 additions & 2 deletions src/Examples/ReportsExample/ReportsExample.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore" Version="$(AspNetCoreVersion)" />
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="$(AspNetCoreVersion)" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Core" Version="$(AspNetCoreVersion)" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="$(MicrosoftLoggingVersion)" />
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="$(NpgsqlPostgreSQLVersion)" />
<PackageReference Include="Npgsql" Version="$(NpgsqlVersion)" />
<PackageReference Include="Dapper" Version="1.50.2" />
<PackageReference Include="Dapper" Version="1.50.5" />
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion src/Examples/ReportsExample/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public Startup(IHostingEnvironment env)

public virtual void ConfigureServices(IServiceCollection services)
{
var mvcBuilder = services.AddMvc();
var mvcBuilder = services.AddMvcCore();
services.AddJsonApi(opt =>
{
opt.BuildContextGraph(builder =>
Expand Down
2 changes: 1 addition & 1 deletion src/Examples/ReportsExample/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"Logging": {
"IncludeScopes": false,
"LogLevel": {
"Default": "Information"
"Default": "Warning"
}
}
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace JsonApiDotNetCore.Builders
{
public interface IDocumentBuilderOptionsProvider
{
DocumentBuilderOptions GetDocumentBuilderOptions();
DocumentBuilderOptions GetDocumentBuilderOptions();
}
}
Loading