diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000000..134066baff --- /dev/null +++ b/.editorconfig @@ -0,0 +1,14 @@ +# EditorConfig is awesome: http://EditorConfig.org + +# top-most EditorConfig file +root = true + +[*] +end_of_line = lf +insert_final_newline = true +indent_style = space +indent_size = 4 +charset = utf-8 + +[*.{csproj,props}] +indent_size = 2 diff --git a/.gitignore b/.gitignore index cd9f35a530..6630942ad5 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,6 @@ *.user .couscous/ docs/Template-Dark/ -.idea/ \ No newline at end of file +.idea/ +**/_site/ +log.txt diff --git a/.travis.yml b/.travis.yml index 234e836e7e..9c5e937589 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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: 1.0.4 # https://www.microsoft.com/net/download/linux +dotnet: 2.1.300 # https://www.microsoft.com/net/download/linux branches: only: - master diff --git a/.vscode/launch.json b/.vscode/launch.json index b26b008078..1da452f8e1 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -1,6 +1,16 @@ { "version": "0.2.0", "configurations": [ + { + "name": "OperationsExample", + "type": "coreclr", + "request": "launch", + "preLaunchTask": "build", + "program": "${workspaceRoot}/src/Examples/OperationsExample/bin/Debug/netcoreapp1.0/OperationsExample.dll", + "args": [], + "cwd": "${workspaceRoot}/src/Examples/OperationsExample", + "stopAtEntry": false + }, { "name": ".NET Core Attach", "type": "coreclr", diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 09ab6390d4..073a93abae 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -17,4 +17,4 @@ "problemMatcher": "$msCompile" } ] -} \ No newline at end of file +} diff --git a/Build.ps1 b/Build.ps1 index 6a37b7f8a5..8ff62d6578 100644 --- a/Build.ps1 +++ b/Build.ps1 @@ -9,28 +9,55 @@ function Get-Version-Suffix-From-Tag return $final } +function CheckLastExitCode { + param ([int[]]$SuccessCodes = @(0), [scriptblock]$CleanupScript=$null) + + if ($SuccessCodes -notcontains $LastExitCode) { + $msg = "EXE RETURNED EXIT CODE $LastExitCode" + throw $msg + } +} + $revision = @{ $true = $env:APPVEYOR_BUILD_NUMBER; $false = 1 }[$env:APPVEYOR_BUILD_NUMBER -ne $NULL]; $revision = "{0:D4}" -f [convert]::ToInt32($revision, 10) dotnet restore dotnet test ./test/UnitTests/UnitTests.csproj +CheckLastExitCode + dotnet test ./test/JsonApiDotNetCoreExampleTests/JsonApiDotNetCoreExampleTests.csproj +CheckLastExitCode + dotnet test ./test/NoEntityFrameworkTests/NoEntityFrameworkTests.csproj +CheckLastExitCode -dotnet build .\src\JsonApiDotNetCore -c Release +dotnet test ./test/OperationsExampleTests/OperationsExampleTests.csproj +CheckLastExitCode -echo "APPVEYOR_REPO_TAG: $env:APPVEYOR_REPO_TAG" +dotnet build .\src\JsonApiDotNetCore -c Release +CheckLastExitCode +Write-Output "APPVEYOR_REPO_TAG: $env:APPVEYOR_REPO_TAG" If($env:APPVEYOR_REPO_TAG -eq $true) { $revision = Get-Version-Suffix-From-Tag - echo "VERSION-SUFFIX: $revision" - echo "RUNNING dotnet pack .\src\JsonApiDotNetCore -c Release -o .\artifacts --version-suffix=$revision" - dotnet pack .\src\JsonApiDotNetCore -c Release -o .\artifacts --version-suffix=$revision + Write-Output "VERSION-SUFFIX: $revision" + + IF ([string]::IsNullOrWhitespace($revision)){ + Write-Output "RUNNING dotnet pack .\src\JsonApiDotNetCore -c Release -o .\artifacts" + dotnet pack .\src\JsonApiDotNetCore -c Release -o .\artifacts --include-symbols + CheckLastExitCode + } + Else { + Write-Output "RUNNING dotnet pack .\src\JsonApiDotNetCore -c Release -o .\artifacts --version-suffix=$revision" + dotnet pack .\src\JsonApiDotNetCore -c Release -o .\artifacts --version-suffix=$revision --include-symbols + CheckLastExitCode + } } Else { - echo "VERSION-SUFFIX: alpha1-$revision" - echo "RUNNING dotnet pack .\src\JsonApiDotNetCore -c Release -o .\artifacts --version-suffix=alpha1-$revision" - dotnet pack .\src\JsonApiDotNetCore -c Release -o .\artifacts --version-suffix=alpha1-$revision -} \ No newline at end of file + Write-Output "VERSION-SUFFIX: alpha1-$revision" + Write-Output "RUNNING dotnet pack .\src\JsonApiDotNetCore -c Release -o .\artifacts --version-suffix=alpha1-$revision" + dotnet pack .\src\JsonApiDotNetCore -c Release -o .\artifacts --version-suffix=alpha1-$revision --include-symbols + CheckLastExitCode +} diff --git a/CONTRIBUTING.MD b/CONTRIBUTING.MD index 0e14787fec..8ce50e6c68 100644 --- a/CONTRIBUTING.MD +++ b/CONTRIBUTING.MD @@ -2,10 +2,14 @@ ## Workflow -1. Search through the issues to see if your particular issue has already been discovered and possibly addressed -2. Open an issue if you can't find anything helpful -3. Open a PR for proposed changes +1. Search through the issues to see if your particular issue has already been discovered and possibly addressed +2. Open an issue if you can't find anything helpful +3. Open a PR for proposed changes ## Commit Guidelines I have chosen to loosely follow the [Angular Commit Guidelines](https://github.com/angular/angular.js/blob/master/CONTRIBUTING.md#commit) + +# Documentation + +If you'd like to help us improve our documentation, please checkout our [GitHub pages repository](https://github.com/json-api-dotnet/json-api-dotnet.github.io) where we host our documentation. diff --git a/Directory.Build.props b/Directory.Build.props index d3e19546db..0d034e0c5d 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,26 +1,30 @@ - + + netcoreapp2.0 netstandard2.0 - 2.0.1 - 2.0.1 - 2.0.0 - 2.0.0 - 4.4.0 + + 2.1.0 + + 2.1.0 + 2.1.0 + 2.1.0 + + 2.1.0 + 2.1.0 + + 4.0.0 + 2.1.0 + + 4.5.0 - - + + - netcoreapp2.0 - 2.0.0 - 2.0.0 - 3.2.6 - 2.0.1 - 15.3.0-preview-20170427-09 - 1.1.2 - 2.3.0-beta3-build3705 - 15.0.3 - 4.7.99 + 15.7.2 + 2.3.1 + 22.1.2 + 4.8.3 - - \ No newline at end of file + + diff --git a/JsonApiDotnetCore.sln b/JsonApiDotnetCore.sln index a144223671..4b7cf5ea47 100644 --- a/JsonApiDotnetCore.sln +++ b/JsonApiDotnetCore.sln @@ -1,6 +1,6 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 15 -VisualStudioVersion = 15.0.26730.10 +VisualStudioVersion = 15.0.27130.2010 MinimumVisualStudioVersion = 10.0.40219.1 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "JsonApiDotNetCore", "src\JsonApiDotNetCore\JsonApiDotNetCore.csproj", "{C0EC9E70-EB2E-436F-9D94-FA16FA774123}" EndProject @@ -15,6 +15,11 @@ EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{C5B4D998-CECB-454D-9F32-085A897577BE}" ProjectSection(SolutionItems) = preProject .gitignore = .gitignore + .travis.yml = .travis.yml + appveyor.yml = appveyor.yml + Build.ps1 = Build.ps1 + build.sh = build.sh + Directory.Build.props = Directory.Build.props README.md = README.md EndProjectSection EndProject @@ -28,6 +33,14 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Examples", "Examples", "{02 EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ReportsExample", "src\Examples\ReportsExample\ReportsExample.csproj", "{FBFB0B0B-EA86-4B41-AB2A-E0249F70C86D}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "benchmarks", "benchmarks", "{076E1AE4-FD25-4684-B826-CAAE37FEA0AA}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Benchmarks", "benchmarks\Benchmarks.csproj", "{1F604666-BB0F-413E-922D-9D37C6073285}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OperationsExample", "src\Examples\OperationsExample\OperationsExample.csproj", "{CF2C1EB6-8449-4B35-B8C7-F43D6D90632D}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OperationsExampleTests", "test\OperationsExampleTests\OperationsExampleTests.csproj", "{9CD2C116-D133-4FE4-97DA-A9FEAFF045F1}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -110,19 +123,58 @@ Global {FBFB0B0B-EA86-4B41-AB2A-E0249F70C86D}.Release|x64.Build.0 = Release|Any CPU {FBFB0B0B-EA86-4B41-AB2A-E0249F70C86D}.Release|x86.ActiveCfg = Release|Any CPU {FBFB0B0B-EA86-4B41-AB2A-E0249F70C86D}.Release|x86.Build.0 = Release|Any CPU + {1F604666-BB0F-413E-922D-9D37C6073285}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1F604666-BB0F-413E-922D-9D37C6073285}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1F604666-BB0F-413E-922D-9D37C6073285}.Debug|x64.ActiveCfg = Debug|Any CPU + {1F604666-BB0F-413E-922D-9D37C6073285}.Debug|x64.Build.0 = Debug|Any CPU + {1F604666-BB0F-413E-922D-9D37C6073285}.Debug|x86.ActiveCfg = Debug|Any CPU + {1F604666-BB0F-413E-922D-9D37C6073285}.Debug|x86.Build.0 = Debug|Any CPU + {1F604666-BB0F-413E-922D-9D37C6073285}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1F604666-BB0F-413E-922D-9D37C6073285}.Release|Any CPU.Build.0 = Release|Any CPU + {1F604666-BB0F-413E-922D-9D37C6073285}.Release|x64.ActiveCfg = Release|Any CPU + {1F604666-BB0F-413E-922D-9D37C6073285}.Release|x64.Build.0 = Release|Any CPU + {1F604666-BB0F-413E-922D-9D37C6073285}.Release|x86.ActiveCfg = Release|Any CPU + {1F604666-BB0F-413E-922D-9D37C6073285}.Release|x86.Build.0 = Release|Any CPU + {CF2C1EB6-8449-4B35-B8C7-F43D6D90632D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CF2C1EB6-8449-4B35-B8C7-F43D6D90632D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CF2C1EB6-8449-4B35-B8C7-F43D6D90632D}.Debug|x64.ActiveCfg = Debug|Any CPU + {CF2C1EB6-8449-4B35-B8C7-F43D6D90632D}.Debug|x64.Build.0 = Debug|Any CPU + {CF2C1EB6-8449-4B35-B8C7-F43D6D90632D}.Debug|x86.ActiveCfg = Debug|Any CPU + {CF2C1EB6-8449-4B35-B8C7-F43D6D90632D}.Debug|x86.Build.0 = Debug|Any CPU + {CF2C1EB6-8449-4B35-B8C7-F43D6D90632D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CF2C1EB6-8449-4B35-B8C7-F43D6D90632D}.Release|Any CPU.Build.0 = Release|Any CPU + {CF2C1EB6-8449-4B35-B8C7-F43D6D90632D}.Release|x64.ActiveCfg = Release|Any CPU + {CF2C1EB6-8449-4B35-B8C7-F43D6D90632D}.Release|x64.Build.0 = Release|Any CPU + {CF2C1EB6-8449-4B35-B8C7-F43D6D90632D}.Release|x86.ActiveCfg = Release|Any CPU + {CF2C1EB6-8449-4B35-B8C7-F43D6D90632D}.Release|x86.Build.0 = Release|Any CPU + {9CD2C116-D133-4FE4-97DA-A9FEAFF045F1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9CD2C116-D133-4FE4-97DA-A9FEAFF045F1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9CD2C116-D133-4FE4-97DA-A9FEAFF045F1}.Debug|x64.ActiveCfg = Debug|Any CPU + {9CD2C116-D133-4FE4-97DA-A9FEAFF045F1}.Debug|x64.Build.0 = Debug|Any CPU + {9CD2C116-D133-4FE4-97DA-A9FEAFF045F1}.Debug|x86.ActiveCfg = Debug|Any CPU + {9CD2C116-D133-4FE4-97DA-A9FEAFF045F1}.Debug|x86.Build.0 = Debug|Any CPU + {9CD2C116-D133-4FE4-97DA-A9FEAFF045F1}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9CD2C116-D133-4FE4-97DA-A9FEAFF045F1}.Release|Any CPU.Build.0 = Release|Any CPU + {9CD2C116-D133-4FE4-97DA-A9FEAFF045F1}.Release|x64.ActiveCfg = Release|Any CPU + {9CD2C116-D133-4FE4-97DA-A9FEAFF045F1}.Release|x64.Build.0 = Release|Any CPU + {9CD2C116-D133-4FE4-97DA-A9FEAFF045F1}.Release|x86.ActiveCfg = Release|Any CPU + {9CD2C116-D133-4FE4-97DA-A9FEAFF045F1}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection GlobalSection(NestedProjects) = preSolution {C0EC9E70-EB2E-436F-9D94-FA16FA774123} = {7A2B7ADD-ECB5-4D00-AA6A-D45BD11C97CF} - {97EE048B-16C0-43F6-BDA9-4E762B2F579F} = {7A2B7ADD-ECB5-4D00-AA6A-D45BD11C97CF} + {97EE048B-16C0-43F6-BDA9-4E762B2F579F} = {026FBC6C-AF76-4568-9B87-EC73457899FD} {0B959765-40D2-43B5-87EE-FE2FEF9DBED5} = {24B15015-62E5-42E1-9BA0-ECE6BE7AA15F} - {570165EC-62B5-4684-A139-8D2A30DD4475} = {7A2B7ADD-ECB5-4D00-AA6A-D45BD11C97CF} + {570165EC-62B5-4684-A139-8D2A30DD4475} = {026FBC6C-AF76-4568-9B87-EC73457899FD} {73DA578D-A63F-4956-83ED-6D7102E09140} = {24B15015-62E5-42E1-9BA0-ECE6BE7AA15F} {6D4BD85A-A262-44C6-8572-FE3A30410BF3} = {24B15015-62E5-42E1-9BA0-ECE6BE7AA15F} {026FBC6C-AF76-4568-9B87-EC73457899FD} = {7A2B7ADD-ECB5-4D00-AA6A-D45BD11C97CF} {FBFB0B0B-EA86-4B41-AB2A-E0249F70C86D} = {026FBC6C-AF76-4568-9B87-EC73457899FD} + {1F604666-BB0F-413E-922D-9D37C6073285} = {076E1AE4-FD25-4684-B826-CAAE37FEA0AA} + {CF2C1EB6-8449-4B35-B8C7-F43D6D90632D} = {026FBC6C-AF76-4568-9B87-EC73457899FD} + {9CD2C116-D133-4FE4-97DA-A9FEAFF045F1} = {24B15015-62E5-42E1-9BA0-ECE6BE7AA15F} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {A2421882-8F0A-4905-928F-B550B192F9A4} diff --git a/README.md b/README.md index c0a02f3d35..81ebba79bf 100644 --- a/README.md +++ b/README.md @@ -1,23 +1,77 @@ +

+ +

+ # JSON API .Net Core -[![Build status](https://ci.appveyor.com/api/projects/status/9fvgeoxdikwkom10?svg=true)](https://ci.appveyor.com/project/jaredcnance/json-api-dotnet-core) -[![Travis](https://img.shields.io/travis/Research-Institute/json-api-dotnet-core.svg?maxAge=3600&label=travis)](https://travis-ci.org/Research-Institute/json-api-dotnet-core) +[![Build status](https://ci.appveyor.com/api/projects/status/9fvgeoxdikwkom10?svg=true)](https://ci.appveyor.com/project/jaredcnance/jsonapidotnetcore) +[![Travis](https://travis-ci.org/json-api-dotnet/JsonApiDotNetCore.svg?branch=master)](https://travis-ci.org/json-api-dotnet/JsonApiDotNetCore) [![NuGet](https://img.shields.io/nuget/v/JsonApiDotNetCore.svg)](https://www.nuget.org/packages/JsonApiDotNetCore/) -[![MyGet CI](https://img.shields.io/myget/research-institute/vpre/JsonApiDotNetCore.svg)](https://www.myget.org/feed/research-institute/package/nuget/JsonApiDotNetCore) [![Join the chat at https://gitter.im/json-api-dotnet-core/Lobby](https://badges.gitter.im/json-api-dotnet-core/Lobby.svg)](https://gitter.im/json-api-dotnet-core/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![FIRST-TIMERS](https://img.shields.io/badge/first--timers--only-friendly-blue.svg)](http://www.firsttimersonly.com/) A framework for building [json:api](http://jsonapi.org/) compliant web APIs. The ultimate goal of this library is to eliminate as much boilerplate as possible by offering out-of-the-box features such as sorting, filtering and pagination. You just need to focus on defining the resources and implementing your custom business logic. This library has been designed around dependency injection making extensibility incredibly easy. +## Getting Started + +These are some steps you can take to help you understand what this project is and how you can use it: + +- [What is json:api and why should I use it?](https://nordicapis.com/the-benefits-of-using-json-api/) +- [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 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 + +See the [examples](https://github.com/json-api-dotnet/JsonApiDotNetCore/tree/master/src/Examples) directory for up-to-date sample applications. There is also a [Todo List App](https://github.com/json-api-dotnet/TodoListExample) that includes a JADNC API and an EmberJs client. + ## Installation And Usage -See the documentation [here](https://research-institute.github.io/json-api-dotnet-core) +See [the documentation](https://json-api-dotnet.github.io/#/) for detailed usage. + +### Models + +```csharp +public class Article : Identifiable +{ + [Attr("name")] + public string Name { get; set; } +} +``` + +### Controllers +```csharp +public class ArticlesController : JsonApiController
+{ + public ArticlesController( + IJsonApiContext jsonApiContext, + IResourceService
resourceService) + : base(jsonApiContext, resourceService) { } +} +``` -## .Net Core v2 Notes +### Middleware -Branch `feat/core-2` is where I am working on .Net Core 2 compatibility tests and package upgrades. -There are several blockers to be aware of: +```csharp +public class Startup +{ + public IServiceProvider ConfigureServices(IServiceCollection services) { + services.AddJsonApi(); + // ... + } -- Microsoft.AspNetCore.* packages target the runtime (netcoreapp) instead of netstandard. [This will be changed in future versions.](https://blogs.msdn.microsoft.com/webdev/2017/05/10/aspnet-2-preview-1/). -- Can't run acceptance testing against postgres on preview runtime [pgsql.EntityFrameworkCore.PostgreSQL#171](https://github.com/npgsql/Npgsql.EntityFrameworkCore.PostgreSQL/issues/171#issuecomment-301287257) + public void Configure(IApplicationBuilder app) { + app.UseJsonApi() + // ... + } +} +``` diff --git a/appveyor.yml b/appveyor.yml index ec135d19bb..78f4d3187e 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -44,6 +44,7 @@ deploy: api_key: secure: 6CeYcZ4Ze+57gxfeuHzqP6ldbUkPtF6pfpVM1Gw/K2jExFrAz763gNAQ++tiacq3 skip_symbols: false + symbol_server: https://www.myget.org/F/research-institute/symbols/api/v2/package on: branch: develop - provider: NuGet diff --git a/benchmarks/.gitignore b/benchmarks/.gitignore new file mode 100644 index 0000000000..5a3c72cbbb --- /dev/null +++ b/benchmarks/.gitignore @@ -0,0 +1,239 @@ +_data/ +*-report-default.md +*-report.csv +*-report.html + +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. + +# User-specific files +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +build/ +bld/ +[Bb]in/ +[Oo]bj/ + +# Visual Studio 2015 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUNIT +*.VisualState.xml +TestResult.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# DNX +project.lock.json +artifacts/ + +*_i.c +*_p.c +*_i.h +*.ilk +*.meta +*.obj +*.pch +*.pdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# JustCode is a .NET coding add-in +.JustCode + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# TODO: Comment the next line if you want to checkin your web deploy settings +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# NuGet Packages +*.nupkg +# The packages folder can be ignored because of Package Restore +**/packages/* +# except build/, which is used as an MSBuild target. +!**/packages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/packages/repositories.config + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Microsoft Azure ApplicationInsights config file +ApplicationInsights.config + +# Windows Store app package directory +AppPackages/ +BundleArtifacts/ + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.pfx +*.publishsettings +node_modules/ +orleans.codegen.cs + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm + +# SQL Server files +*.mdf +*.ldf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe + +# FAKE - F# Make +.fake/ diff --git a/benchmarks/BenchmarkDotNet.Artifacts/results/Benchmarks.JsonApiContext.PathIsRelationship_Benchmarks-report-github.md b/benchmarks/BenchmarkDotNet.Artifacts/results/Benchmarks.JsonApiContext.PathIsRelationship_Benchmarks-report-github.md new file mode 100644 index 0000000000..6be58e241a --- /dev/null +++ b/benchmarks/BenchmarkDotNet.Artifacts/results/Benchmarks.JsonApiContext.PathIsRelationship_Benchmarks-report-github.md @@ -0,0 +1,12 @@ +```ini +BenchmarkDotNet=v0.10.10, OS=Mac OS X 10.12 +Processor=Intel Core i5-5257U CPU 2.70GHz (Broadwell), ProcessorCount=4 +.NET Core SDK=2.1.4 + [Host] : .NET Core 2.0.5 (Framework 4.6.0.0), 64bit RyuJIT + DefaultJob : .NET Core 2.0.5 (Framework 4.6.0.0), 64bit RyuJIT +``` + +| Method | Mean | Error | StdDev | Gen 0 | Allocated | +| ---------- | --------: | ---------: | ---------: | -----: | --------: | +| UsingSplit | 421.08 ns | 19.3905 ns | 54.0529 ns | 0.4725 | 744 B | +| Current | 52.23 ns | 0.8052 ns | 0.7532 ns | - | 0 B | diff --git a/benchmarks/BenchmarkDotNet.Artifacts/results/Benchmarks.LinkBuilder.LinkBuilder_GetNamespaceFromPath_Benchmarks-report-github.md b/benchmarks/BenchmarkDotNet.Artifacts/results/Benchmarks.LinkBuilder.LinkBuilder_GetNamespaceFromPath_Benchmarks-report-github.md new file mode 100644 index 0000000000..72951396e8 --- /dev/null +++ b/benchmarks/BenchmarkDotNet.Artifacts/results/Benchmarks.LinkBuilder.LinkBuilder_GetNamespaceFromPath_Benchmarks-report-github.md @@ -0,0 +1,16 @@ +``` ini + +BenchmarkDotNet=v0.10.10, OS=Mac OS X 10.12 +Processor=Intel Core i5-5257U CPU 2.70GHz (Broadwell), ProcessorCount=4 +.NET Core SDK=2.1.4 + [Host] : .NET Core 2.0.5 (Framework 4.6.0.0), 64bit RyuJIT + Job-XFMVNE : .NET Core 2.0.5 (Framework 4.6.0.0), 64bit RyuJIT + +LaunchCount=3 TargetCount=20 WarmupCount=10 + +``` +| Method | Mean | Error | StdDev | Gen 0 | Allocated | +|--------------------------- |-----------:|----------:|----------:|-------:|----------:| +| UsingSplit | 1,197.6 ns | 11.929 ns | 25.933 ns | 0.9251 | 1456 B | +| UsingSpanWithStringBuilder | 1,542.0 ns | 15.249 ns | 33.792 ns | 0.9460 | 1488 B | +| UsingSpanWithNoAlloc | 272.6 ns | 2.265 ns | 5.018 ns | 0.0863 | 136 B | diff --git a/benchmarks/BenchmarkDotNet.Artifacts/results/Benchmarks.Query.QueryParser_Benchmarks-report-github.md b/benchmarks/BenchmarkDotNet.Artifacts/results/Benchmarks.Query.QueryParser_Benchmarks-report-github.md new file mode 100755 index 0000000000..b3ebd8a29c --- /dev/null +++ b/benchmarks/BenchmarkDotNet.Artifacts/results/Benchmarks.Query.QueryParser_Benchmarks-report-github.md @@ -0,0 +1,16 @@ +``` ini + +BenchmarkDotNet=v0.10.10, OS=Mac OS X 10.12 +Processor=Intel Core i5-5257U CPU 2.70GHz (Broadwell), ProcessorCount=4 +.NET Core SDK=2.0.0 + [Host] : .NET Core 1.1.4 (Framework 4.6.25714.03), 64bit RyuJIT + Job-WKDOLS : .NET Core 1.1.4 (Framework 4.6.25714.03), 64bit RyuJIT + +LaunchCount=3 TargetCount=20 WarmupCount=10 + +``` +| Method | Mean | Error | StdDev | Gen 0 | Gen 1 | Allocated | +|--------------- |-------------:|-----------:|-----------:|---------:|--------:|----------:| +| AscendingSort | 4.316 us | 1.3773 us | 3.0232 us | 0.5066 | 0.1303 | 1.08 KB | +| DescendingSort | 3.300 us | 0.0314 us | 0.0682 us | 0.5123 | 0.1318 | 1.13 KB | +| ComplexQuery | 2,041.642 us | 41.5631 us | 92.1010 us | 312.5000 | 80.2734 | 648.99 KB | diff --git a/benchmarks/BenchmarkDotNet.Artifacts/results/Benchmarks.RequestMiddleware.ContainsMediaTypeParameters_Benchmarks-report-github.md b/benchmarks/BenchmarkDotNet.Artifacts/results/Benchmarks.RequestMiddleware.ContainsMediaTypeParameters_Benchmarks-report-github.md new file mode 100644 index 0000000000..066e7b2036 --- /dev/null +++ b/benchmarks/BenchmarkDotNet.Artifacts/results/Benchmarks.RequestMiddleware.ContainsMediaTypeParameters_Benchmarks-report-github.md @@ -0,0 +1,14 @@ +``` ini + +BenchmarkDotNet=v0.10.10, OS=Mac OS X 10.12 +Processor=Intel Core i5-5257U CPU 2.70GHz (Broadwell), ProcessorCount=4 +.NET Core SDK=2.1.4 + [Host] : .NET Core 2.0.5 (Framework 4.6.0.0), 64bit RyuJIT + DefaultJob : .NET Core 2.0.5 (Framework 4.6.0.0), 64bit RyuJIT + + +``` +| Method | Mean | Error | StdDev | Gen 0 | Allocated | +|----------- |----------:|----------:|----------:|-------:|----------:| +| UsingSplit | 157.28 ns | 2.9689 ns | 5.8602 ns | 0.2134 | 336 B | +| Current | 39.96 ns | 0.6489 ns | 0.6070 ns | - | 0 B | diff --git a/benchmarks/BenchmarkDotNet.Artifacts/results/Benchmarks.Serialization.JsonApiDeserializer_Benchmarks-report-github.md b/benchmarks/BenchmarkDotNet.Artifacts/results/Benchmarks.Serialization.JsonApiDeserializer_Benchmarks-report-github.md new file mode 100755 index 0000000000..6c8c3f2905 --- /dev/null +++ b/benchmarks/BenchmarkDotNet.Artifacts/results/Benchmarks.Serialization.JsonApiDeserializer_Benchmarks-report-github.md @@ -0,0 +1,13 @@ +``` ini + +BenchmarkDotNet=v0.10.10, OS=Mac OS X 10.12 +Processor=Intel Core i5-5257U CPU 2.70GHz (Broadwell), ProcessorCount=4 +.NET Core SDK=2.0.0 + [Host] : .NET Core 1.1.4 (Framework 4.6.25714.03), 64bit RyuJIT + DefaultJob : .NET Core 1.1.4 (Framework 4.6.25714.03), 64bit RyuJIT + + +``` +| Method | Mean | Error | StdDev | +|------------------------ |---------:|----------:|----------:| +| DeserializeSimpleObject | 27.05 us | 0.5353 us | 0.5950 us | diff --git a/benchmarks/BenchmarkDotNet.Artifacts/results/Benchmarks.Serialization.JsonApiSerializer_Benchmarks-report-github.md b/benchmarks/BenchmarkDotNet.Artifacts/results/Benchmarks.Serialization.JsonApiSerializer_Benchmarks-report-github.md new file mode 100755 index 0000000000..f86bf0faa9 --- /dev/null +++ b/benchmarks/BenchmarkDotNet.Artifacts/results/Benchmarks.Serialization.JsonApiSerializer_Benchmarks-report-github.md @@ -0,0 +1,13 @@ +``` ini + +BenchmarkDotNet=v0.10.10, OS=Mac OS X 10.12 +Processor=Intel Core i5-5257U CPU 2.70GHz (Broadwell), ProcessorCount=4 +.NET Core SDK=2.0.0 + [Host] : .NET Core 1.1.4 (Framework 4.6.25714.03), 64bit RyuJIT + DefaultJob : .NET Core 1.1.4 (Framework 4.6.25714.03), 64bit RyuJIT + + +``` +| Method | Mean | Error | StdDev | +|---------------------- |---------:|----------:|----------:| +| SerializeSimpleObject | 7.195 us | 0.1436 us | 0.1816 us | diff --git a/benchmarks/Benchmarks.csproj b/benchmarks/Benchmarks.csproj new file mode 100644 index 0000000000..60a9a8bf42 --- /dev/null +++ b/benchmarks/Benchmarks.csproj @@ -0,0 +1,15 @@ + + + Exe + $(NetCoreAppVersion) + Benchmarks + + + + + + + + + + diff --git a/benchmarks/JsonApiContext/PathIsRelationship_Benchmarks.cs b/benchmarks/JsonApiContext/PathIsRelationship_Benchmarks.cs new file mode 100644 index 0000000000..83fe6fc53c --- /dev/null +++ b/benchmarks/JsonApiContext/PathIsRelationship_Benchmarks.cs @@ -0,0 +1,24 @@ +using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Attributes.Exporters; + +namespace Benchmarks.JsonApiContext +{ + [MarkdownExporter, MemoryDiagnoser] + public class PathIsRelationship_Benchmarks + { + private const string PATH = "https://example.com/api/v1/namespace/articles/relationships/author/"; + + [Benchmark] + public void Current() + => JsonApiDotNetCore.Services.JsonApiContext.PathIsRelationship(PATH); + + [Benchmark] + public void UsingSplit() => UsingSplitImpl(PATH); + + private bool UsingSplitImpl(string path) + { + var split = path.Split('/'); + return split[split.Length - 2] == "relationships"; + } + } +} diff --git a/benchmarks/LinkBuilder/LinkBuilder_ GetNamespaceFromPath_Benchmarks.cs b/benchmarks/LinkBuilder/LinkBuilder_ GetNamespaceFromPath_Benchmarks.cs new file mode 100644 index 0000000000..05728321c3 --- /dev/null +++ b/benchmarks/LinkBuilder/LinkBuilder_ GetNamespaceFromPath_Benchmarks.cs @@ -0,0 +1,38 @@ +using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Attributes.Exporters; +using BenchmarkDotNet.Attributes.Jobs; + +namespace Benchmarks.LinkBuilder +{ + [MarkdownExporter, SimpleJob(launchCount : 3, warmupCount : 10, targetCount : 20), MemoryDiagnoser] + public class LinkBuilder_GetNamespaceFromPath_Benchmarks + { + private const string PATH = "/api/some-really-long-namespace-path/resources/current/articles"; + private const string ENTITY_NAME = "articles"; + + [Benchmark] + public void UsingSplit() => GetNamespaceFromPath_BySplitting(PATH, ENTITY_NAME); + + [Benchmark] + public void Current() => GetNameSpaceFromPath_Current(PATH, ENTITY_NAME); + + public static string GetNamespaceFromPath_BySplitting(string path, string entityName) + { + var nSpace = string.Empty; + var segments = path.Split('/'); + + for (var i = 1; i < segments.Length; i++) + { + if (segments[i].ToLower() == entityName) + break; + + nSpace += $"/{segments[i]}"; + } + + return nSpace; + } + + public static string GetNameSpaceFromPath_Current(string path, string entityName) + => JsonApiDotNetCore.Builders.LinkBuilder.GetNamespaceFromPath(path, entityName); + } +} diff --git a/benchmarks/Program.cs b/benchmarks/Program.cs new file mode 100644 index 0000000000..9a2c45dffb --- /dev/null +++ b/benchmarks/Program.cs @@ -0,0 +1,22 @@ +using BenchmarkDotNet.Running; +using Benchmarks.JsonApiContext; +using Benchmarks.LinkBuilder; +using Benchmarks.Query; +using Benchmarks.RequestMiddleware; +using Benchmarks.Serialization; + +namespace Benchmarks { + class Program { + static void Main(string[] args) { + var switcher = new BenchmarkSwitcher(new[] { + typeof(JsonApiDeserializer_Benchmarks), + typeof(JsonApiSerializer_Benchmarks), + typeof(QueryParser_Benchmarks), + typeof(LinkBuilder_GetNamespaceFromPath_Benchmarks), + typeof(ContainsMediaTypeParameters_Benchmarks), + typeof(PathIsRelationship_Benchmarks) + }); + switcher.Run(args); + } + } +} diff --git a/benchmarks/Query/QueryParser_Benchmarks.cs b/benchmarks/Query/QueryParser_Benchmarks.cs new file mode 100644 index 0000000000..de82baa60f --- /dev/null +++ b/benchmarks/Query/QueryParser_Benchmarks.cs @@ -0,0 +1,67 @@ +using System; +using System.Collections.Generic; +using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Attributes.Exporters; +using BenchmarkDotNet.Attributes.Jobs; +using JsonApiDotNetCore.Configuration; +using JsonApiDotNetCore.Internal; +using JsonApiDotNetCore.Models; +using JsonApiDotNetCore.Services; +using Microsoft.AspNetCore.Http.Internal; +using Microsoft.Extensions.Primitives; +using Moq; + +namespace Benchmarks.Query { + [MarkdownExporter, SimpleJob(launchCount : 3, warmupCount : 10, targetCount : 20), MemoryDiagnoser] + public class QueryParser_Benchmarks { + private readonly BenchmarkFacade _queryParser; + + private const string ATTRIBUTE = "Attribute"; + private const string ASCENDING_SORT = ATTRIBUTE; + private const string DESCENDING_SORT = "-" + ATTRIBUTE; + + public QueryParser_Benchmarks() { + var controllerContextMock = new Mock(); + controllerContextMock.Setup(m => m.RequestEntity).Returns(new ContextEntity { + Attributes = new List { + new AttrAttribute(ATTRIBUTE, ATTRIBUTE) + } + }); + var options = new JsonApiOptions(); + _queryParser = new BenchmarkFacade(controllerContextMock.Object, options); + } + + [Benchmark] + public void AscendingSort() => _queryParser._ParseSortParameters(ASCENDING_SORT); + + [Benchmark] + public void DescendingSort() => _queryParser._ParseSortParameters(DESCENDING_SORT); + + [Benchmark] + public void ComplexQuery() => Run(100, () => _queryParser.Parse( + new QueryCollection( + new Dictionary { + { $"filter[{ATTRIBUTE}]", new StringValues(new [] { "abc", "eq:abc" }) }, + { $"sort", $"-{ATTRIBUTE}" }, + { $"include", "relationship" }, + { $"page[size]", "1" }, + { $"fields[resource]", ATTRIBUTE }, + } + ) + )); + + private void Run(int iterations, Action action) { + for (int i = 0; i < iterations; i++) + action(); + } + + // this facade allows us to expose and micro-benchmark protected methods + private class BenchmarkFacade : QueryParser { + public BenchmarkFacade( + IControllerContext controllerContext, + JsonApiOptions options) : base(controllerContext, options) { } + + public void _ParseSortParameters(string value) => base.ParseSortParameters(value); + } + } +} diff --git a/benchmarks/RequestMiddleware/ContainsMediaTypeParameters_Benchmarks.cs b/benchmarks/RequestMiddleware/ContainsMediaTypeParameters_Benchmarks.cs new file mode 100644 index 0000000000..ed64c98335 --- /dev/null +++ b/benchmarks/RequestMiddleware/ContainsMediaTypeParameters_Benchmarks.cs @@ -0,0 +1,25 @@ +using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Attributes.Exporters; +using JsonApiDotNetCore.Internal; + +namespace Benchmarks.RequestMiddleware +{ + [MarkdownExporter, MemoryDiagnoser] + public class ContainsMediaTypeParameters_Benchmarks + { + private const string MEDIA_TYPE = "application/vnd.api+json; version=1"; + + [Benchmark] + public void UsingSplit() => UsingSplitImpl(MEDIA_TYPE); + + [Benchmark] + public void Current() + => JsonApiDotNetCore.Middleware.RequestMiddleware.ContainsMediaTypeParameters(MEDIA_TYPE); + + private bool UsingSplitImpl(string mediaType) + { + var mediaTypeArr = mediaType.Split(';'); + return (mediaTypeArr[0] == Constants.ContentType && mediaTypeArr.Length == 2); + } + } +} diff --git a/benchmarks/Serialization/JsonApiDeserializer_Benchmarks.cs b/benchmarks/Serialization/JsonApiDeserializer_Benchmarks.cs new file mode 100644 index 0000000000..c490bee362 --- /dev/null +++ b/benchmarks/Serialization/JsonApiDeserializer_Benchmarks.cs @@ -0,0 +1,61 @@ +using System; +using System.Collections.Generic; +using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Attributes.Exporters; +using JsonApiDotNetCore.Builders; +using JsonApiDotNetCore.Configuration; +using JsonApiDotNetCore.Internal.Generics; +using JsonApiDotNetCore.Models; +using JsonApiDotNetCore.Serialization; +using JsonApiDotNetCore.Services; +using Moq; +using Newtonsoft.Json; +using Newtonsoft.Json.Serialization; + +namespace Benchmarks.Serialization { + [MarkdownExporter] + public class JsonApiDeserializer_Benchmarks { + private const string TYPE_NAME = "simple-types"; + private static readonly string Content = JsonConvert.SerializeObject(new Document { + Data = new DocumentData { + Type = TYPE_NAME, + Id = "1", + Attributes = new Dictionary { + { + "name", + Guid.NewGuid().ToString() + } + } + } + }); + + private readonly JsonApiDeSerializer _jsonApiDeSerializer; + + public JsonApiDeserializer_Benchmarks() { + var contextGraphBuilder = new ContextGraphBuilder(); + contextGraphBuilder.AddResource(TYPE_NAME); + var contextGraph = contextGraphBuilder.Build(); + + var jsonApiContextMock = new Mock(); + jsonApiContextMock.SetupAllProperties(); + jsonApiContextMock.Setup(m => m.ContextGraph).Returns(contextGraph); + jsonApiContextMock.Setup(m => m.AttributesToUpdate).Returns(new Dictionary()); + + var jsonApiOptions = new JsonApiOptions(); + jsonApiOptions.SerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver(); + jsonApiContextMock.Setup(m => m.Options).Returns(jsonApiOptions); + + var genericProcessorFactoryMock = new Mock(); + + _jsonApiDeSerializer = new JsonApiDeSerializer(jsonApiContextMock.Object, genericProcessorFactoryMock.Object); + } + + [Benchmark] + public object DeserializeSimpleObject() => _jsonApiDeSerializer.Deserialize(Content); + + private class SimpleType : Identifiable { + [Attr("name")] + public string Name { get; set; } + } + } +} diff --git a/benchmarks/Serialization/JsonApiSerializer_Benchmarks.cs b/benchmarks/Serialization/JsonApiSerializer_Benchmarks.cs new file mode 100644 index 0000000000..3d5ef7c001 --- /dev/null +++ b/benchmarks/Serialization/JsonApiSerializer_Benchmarks.cs @@ -0,0 +1,49 @@ +using System.Collections.Generic; +using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Attributes.Exporters; +using JsonApiDotNetCore.Builders; +using JsonApiDotNetCore.Configuration; +using JsonApiDotNetCore.Internal.Generics; +using JsonApiDotNetCore.Models; +using JsonApiDotNetCore.Serialization; +using JsonApiDotNetCore.Services; +using Moq; +using Newtonsoft.Json.Serialization; + +namespace Benchmarks.Serialization { + [MarkdownExporter] + public class JsonApiSerializer_Benchmarks { + private const string TYPE_NAME = "simple-types"; + private static readonly SimpleType Content = new SimpleType(); + + private readonly JsonApiSerializer _jsonApiSerializer; + + public JsonApiSerializer_Benchmarks() { + var contextGraphBuilder = new ContextGraphBuilder(); + contextGraphBuilder.AddResource(TYPE_NAME); + var contextGraph = contextGraphBuilder.Build(); + + var jsonApiContextMock = new Mock(); + jsonApiContextMock.SetupAllProperties(); + jsonApiContextMock.Setup(m => m.ContextGraph).Returns(contextGraph); + jsonApiContextMock.Setup(m => m.AttributesToUpdate).Returns(new Dictionary()); + + var jsonApiOptions = new JsonApiOptions(); + jsonApiOptions.SerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver(); + jsonApiContextMock.Setup(m => m.Options).Returns(jsonApiOptions); + + var genericProcessorFactoryMock = new Mock(); + + var documentBuilder = new DocumentBuilder(jsonApiContextMock.Object); + _jsonApiSerializer = new JsonApiSerializer(jsonApiContextMock.Object, documentBuilder); + } + + [Benchmark] + public object SerializeSimpleObject() => _jsonApiSerializer.Serialize(Content); + + private class SimpleType : Identifiable { + [Attr("name")] + public string Name { get; set; } + } + } +} diff --git a/build.sh b/build.sh index 441470e65d..50f2ab9c99 100755 --- a/build.sh +++ b/build.sh @@ -7,4 +7,5 @@ dotnet restore dotnet test ./test/UnitTests/UnitTests.csproj dotnet test ./test/JsonApiDotNetCoreExampleTests/JsonApiDotNetCoreExampleTests.csproj -dotnet test ./test/NoEntityFrameworkTests/NoEntityFrameworkTests.csproj \ No newline at end of file +dotnet test ./test/NoEntityFrameworkTests/NoEntityFrameworkTests.csproj +dotnet test ./test/OperationsExampleTests/OperationsExampleTests.csproj diff --git a/couscous.yml b/couscous.yml deleted file mode 100644 index 90f2b9b095..0000000000 --- a/couscous.yml +++ /dev/null @@ -1,110 +0,0 @@ -template: - # Name of the directory containing the website template (default is "website") - # directory: docs/Template-Dark - # Or if you are using a remote template, you can set the Git URL - url: https://github.com/jaredcnance/Template-Dark.git - # Name of the index file (default is "README.md") - index: index.md - -# List of directories to include in the processing (by default it's empty, so all markdown files are parsed) -# Paths are relative to the optional source path given when generating the website, repository root by default -include: - - docs - -# List of directories to exclude from the processing (default contains "vendor" and "website") -# Paths are relative to the optional include paths given when generating the website, repository root by default -exclude: - # This special entry will ask Couscous to read the exluded directories from your ".gitignore" file - - %gitignore% - -# scripts: - # Scripts to execute before generating the website - # before: - # - cp bin/couscous.phar website/ - # Scripts to execute after generating the website - # after: - # - rm website/couscous.phar - -# Set this variable to use a Custom Domain -# The content of this variable will be directly inserted into the CNAME file -# cname: docs.yourdomain.com - -# Set the target branch in which to deploy the generated website -branch: gh-pages - -# Base URL of the published website (no "/" at the end!) -# You are advised to set and use this variable to write your links in the HTML layouts -baseUrl: https://research-institute.github.io/json-api-dotnet-core -github: - user: research-institute - repo: json-api-dotnet-core - -title: JSONAPI .Net Core -subTitle: killing boilerplate in dotnet web APIs - -# The left menu bar -menu: - sections: - intro: - name: Getting Started - items: - about: - text: About - relativeUrl: index.html - installation: - text: Installation - relativeUrl: installation.html - usage: - text: Step by Step - relativeUrl: usage.html - usage: - name: Usage - items: - models: - text: Models - relativeUrl: models.html - contextgraph: - text: Context Graph - relativeUrl: contextgraph.html - meta: - text: Meta - relativeUrl: meta.html - options: - text: Global Options - relativeUrl: options.html - errors: - text: Custom Errors - relativeUrl: errors.html - filtering: - text: Filtering - relativeUrl: filtering.html - pagination: - text: Pagination - relativeUrl: pagination.html - routing: - text: Routing - relativeUrl: routing.html - sorting: - text: Sorting - relativeUrl: sorting.html - sparsefields: - text: Sparse Fieldsets - relativeUrl: sparsefieldsets.html - extensibility: - name: Extensibility - items: - layers: - text: The Layers - relativeUrl: layers.html - controllers: - text: Controllers - relativeUrl: controllers.html - services: - text: Resource Services - relativeUrl: resourceservices.html - repositories: - text: Entity Repositories - relativeUrl: entityrepositories.html - middleware: - text: Middleware - relativeUrl: middleware.html \ No newline at end of file diff --git a/docs/ContextGraph.md b/docs/ContextGraph.md deleted file mode 100644 index f5b8394b83..0000000000 --- a/docs/ContextGraph.md +++ /dev/null @@ -1,58 +0,0 @@ ---- -currentMenu: contextgraph ---- - -# Context Graph - -The [ContextGraph](https://github.com/Research-Institute/json-api-dotnet-core/blob/master/src/JsonApiDotNetCore/Internal/ContextGraph.cs) is a map of all the json:api resources and their relationships that your API serves. -It is built at app startup and available as a singleton through Dependency Injection. - -When you call `services.AddJsonApi()`, the graph is constructed from the context. - -### Defining Non-EF Resources - -If you have models that are not members of a `DbContext`, -you can manually create this graph like so: - -```csharp -// Startup.cs -public void ConfigureServices(IServiceCollection services) -{ - // Add framework services. - var mvcBuilder = services.AddMvc(); - - services.AddJsonApi(options => { - options.Namespace = "api/v1"; - options.BuildContextGraph((builder) => { - builder.AddResource("my-models"); - }); - }, mvcBuilder); - // ... -} -``` - -### Changing Resource Names - -If a DbContext is specified when adding the services, the context will be used to define the resources and their names. By default, these names will be hyphenated. - -```csharp -public class AppDbContext : DbContext { - // this will be translated into "my-models" - public DbSet MyModels { get; set; } -} -``` - -However, you can specify a custom name like so: - -```csharp -public class AppDbContext : DbContext { - // this will be translated into "someModels" - [Resource("someModels")] - public DbSet MyModels { get; set; } -} -``` - - - - - diff --git a/docs/Controllers.md b/docs/Controllers.md deleted file mode 100644 index 0ec47b8774..0000000000 --- a/docs/Controllers.md +++ /dev/null @@ -1,93 +0,0 @@ ---- -currentMenu: controllers ---- - -# Controllers - -You need to create controllers that inherit from [JsonApiController<TEntity>](https://github.com/Research-Institute/json-api-dotnet-core/blob/master/src/JsonApiDotNetCore/Controllers/JsonApiController.cs). - -```csharp -public class ThingsController : JsonApiController -{ - public ThingsController( - IJsonApiContext jsonApiContext, - IResourceService resourceService, - ILoggerFactory loggerFactory) - : base(jsonApiContext, resourceService, loggerFactory) - { } -} -``` - -### Non-Integer Type Keys - -If your model is using a type other than `int` for the primary key, -you should explicitly declare it in the controller -and service generic type definitions: - -```csharp -public class ThingsController : JsonApiController - //---------------------- ^^^^ -{ - public ThingsController( - IJsonApiContext jsonApiContext, - IResourceService resourceService, - //--------------------- ^^^^ - ILoggerFactory loggerFactory) - : base(jsonApiContext, resourceService, loggerFactory) - { } -} -``` - -### Limiting Write Access - -It is possible to limit write resource access on the controller entirely using the following attributes: - -- `NoHttpPost`: disallow POST requests -- `NoHttpPatch`: disallow PATCH requests -- `NoHttpDelete`: disallow DELETE requests -- `HttpReadOnly`: all of the above - -```csharp -[HttpReadOnly] -public class ThingsController : JsonApiController -{ - public ThingsController( - IJsonApiContext jsonApiContext, - IResourceService resourceService, - ILoggerFactory loggerFactory) - : base(jsonApiContext, resourceService, loggerFactory) - { } -} -``` - -### Additional customizations - -If you need additional customization at the controller level, you can override the virtual -methods. Please be aware that this is not the place for advanced business logic -which should be performed at the [service](resourceservices.html) or [repository](entityrepositories.html) layers. Here is an example override at the controller layer: - -```csharp -public class TodoItemsController : JsonApiController -{ - public TodoItemsController( - IJsonApiContext jsonApiContext, - IResourceService resourceService, - ILoggerFactory loggerFactory) - : base(jsonApiContext, resourceService, loggerFactory) - { } - - [HttpGet] - public override async Task GetAsync() - { - // custom code - if(RequestIsValid() == false) - return BadRequest(); - - // return result from base class - return await base.GetAsync(); - } - - // some custom validation logic - private bool RequestIsValid() => true; -} -``` diff --git a/docs/EntityRepositories.md b/docs/EntityRepositories.md deleted file mode 100644 index 62d156e427..0000000000 --- a/docs/EntityRepositories.md +++ /dev/null @@ -1,44 +0,0 @@ ---- -currentMenu: repositories ---- - -# Entity Repositories - -If you want to use EF, but need additional data access logic (such as authorization), you can implement custom methods for accessing the data by creating an implementation of -[IEntityRepository<Entity, TId>](https://github.com/Research-Institute/json-api-dotnet-core/blob/master/src/JsonApiDotNetCore/Data/IEntityRepository.cs). If you only need minor changes you can override the -methods defined in [DefaultEntityRepository<TEntity, TId>](https://github.com/Research-Institute/json-api-dotnet-core/blob/master/src/JsonApiDotNetCore/Data/DefaultEntityRepository.cs). - -The repository should then be -add to the service collection in `Startup.cs` like so: - -```csharp -public IServiceProvider ConfigureServices(IServiceCollection services) { - services.AddScoped, MyAuthorizedEntityRepository>(); - // ... -} -``` - -A sample implementation that performs data authorization might look like: - -```csharp -public class MyAuthorizedEntityRepository : DefaultEntityRepository -{ - private readonly ILogger _logger; - private readonly IAuthenticationService _authenticationService; - - public MyAuthorizedEntityRepository( - ILoggerFactory loggerFactory, - IJsonApiContext jsonApiContext, - IAuthenticationService authenticationService) - : base(loggerFactory, jsonApiContext) - { - _logger = loggerFactory.CreateLogger(); - _authenticationService = authenticationService; - } - - public override IQueryable Get() - { - return base.Get().Where(e => e.UserId == _authenticationService.UserId); - } -} -``` diff --git a/docs/Errors.md b/docs/Errors.md deleted file mode 100644 index 59f4f6da21..0000000000 --- a/docs/Errors.md +++ /dev/null @@ -1,38 +0,0 @@ ---- -currentMenu: errors ---- - -# Custom Errors - -By default, errors will only contain the properties defined by the internal [Error](https://github.com/Research-Institute/json-api-dotnet-core/blob/master/src/JsonApiDotNetCore/Internal/Error.cs) class. However, you can create your own by inheriting from `Error` and either throwing it in a `JsonApiException` or returning the error from your controller. - -```csharp -// custom error definition -public class CustomError : Error { - public CustomError(string status, string title, string detail, string myProp) - : base(status, title, detail) - { - MyCustomProperty = myProp; - } - public string MyCustomProperty { get; set; } -} - -// throwing a custom error -public void MyMethod() { - var error = new CustomError("507", "title", "detail", "custom"); - throw new JsonApiException(error); -} - -// returning from controller -[HttpPost] -public override async Task PostAsync([FromBody] MyEntity entity) -{ - if(_db.IsFull) - return Error(new CustomError("507", "Database is full.", "Theres no more room.", "Sorry.")); - - if(model.Validations.IsValid == false) - return Errors(model.Validations.GetErrors()); - - // ... -} -``` \ No newline at end of file diff --git a/docs/Filtering.md b/docs/Filtering.md deleted file mode 100644 index c258fe4f73..0000000000 --- a/docs/Filtering.md +++ /dev/null @@ -1,50 +0,0 @@ ---- -currentMenu: filtering ---- - -# Filtering - -You can filter resources by attributes using the `filter` query parameter. -By default, all attributes are filterable. -The filtering strategy we have selected, uses the following form: - -``` -?filter[attribute]=value -``` - -For operations other than equality, the query can be prefixed with an operation -identifier): - -``` -?filter[attribute]=eq:value -?filter[attribute]=lt:value -?filter[attribute]=gt:value -?filter[attribute]=le:value -?filter[attribute]=ge:value -?filter[attribute]=like:value -``` - -### Custom Filters - -You can customize the filter implementation by overriding the method in the `DefaultEntityRepository` like so: - -```csharp -public class MyEntityRepository : DefaultEntityRepository -{ - public MyEntityRepository( - AppDbContext context, - ILoggerFactory loggerFactory, - IJsonApiContext jsonApiContext) - : base(context, loggerFactory, jsonApiContext) - { } - - public override IQueryable Filter(IQueryable entities, FilterQuery filterQuery) - { - // use the base filtering method - entities = base.Filter(entities, filterQuery); - - // implement custom method - return ApplyMyCustomFilter(entities, filterQuery); - } -} -``` diff --git a/docs/Index.md b/docs/Index.md deleted file mode 100644 index 64b0861155..0000000000 --- a/docs/Index.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -currentMenu: about ---- - -# JSON API .Net Core - -A framework for building [json:api](http://jsonapi.org/) compliant web servers. It allows you to eliminate a significant amount of boilerplate while offering out-of-the-box features such as sorting, filtering and pagination. This library provides all the required middleware to build a complete server. All you need to focus on is defining the resources and implementing your custom business logic. This library has been designed around dependency injection making extensibility incredibly easy. \ No newline at end of file diff --git a/docs/Installation.md b/docs/Installation.md deleted file mode 100644 index 367d5d3a2e..0000000000 --- a/docs/Installation.md +++ /dev/null @@ -1,29 +0,0 @@ ---- -currentMenu: installation ---- - -# Installation - -- CLI -``` -$ dotnet add package jsonapidotnetcore -``` - -- Visual Studio -``` -Install-Package JsonApiDotnetCore -``` - -- *.csproj -```xml - - - - -``` - -Click [here](https://www.nuget.org/packages/JsonApiDotnetCore/) for the latest NuGet version. - -For pre-releases (develop branch), add the [MyGet](https://www.myget.org/feed/Details/research-institute) package feed -(https://www.myget.org/F/research-institute/api/v3/index.json) -to your nuget configuration. \ No newline at end of file diff --git a/docs/Layers.md b/docs/Layers.md deleted file mode 100644 index 5c71030274..0000000000 --- a/docs/Layers.md +++ /dev/null @@ -1,57 +0,0 @@ ---- -currentMenu: layers ---- - -# The Layers - -By default, data retrieval is distributed across 3 layers: - -1. [JsonApiController](https://github.com/Research-Institute/json-api-dotnet-core/blob/master/src/JsonApiDotNetCore/Controllers/JsonApiController.cs) (required) -2. [IResourceService](https://github.com/Research-Institute/json-api-dotnet-core/blob/master/src/JsonApiDotNetCore/Services/IResourceService.cs) (default [EntityResourceService](https://github.com/Research-Institute/json-api-dotnet-core/blob/master/src/JsonApiDotNetCore/Services/EntityResourceService.cs)) -3. [IEntityRepository](https://github.com/Research-Institute/json-api-dotnet-core/blob/master/src/JsonApiDotNetCore/Data/IEntityRepository.cs) (default [DefaultEntityRepository](https://github.com/Research-Institute/json-api-dotnet-core/blob/master/src/JsonApiDotNetCore/Data/DefaultEntityRepository.cs)) - -Customization can be done at any of these layers. However, it is recommended that you make your customizations at the service or the repository layer when possible to keep the controllers free of unnecessary logic. You can use the following as a general rule of -thumb for where to put business logic: - -- **Controller**: simple validation logic that should result in the return of specific HTTP status codes such as model validation -- **IResourceService**: advanced BL and replacement of data access mechanisms -- **IEntityRepository**: custom logic that builds on the EF APIs, such as Authorization of data - -## Replacing Services / Repositories - -Replacing services is done on a per resource basis and can be done through simple DI -in your Startup.cs file: - -```csharp -public IServiceProvider ConfigureServices(IServiceCollection services) -{ - // custom service - services.AddScoped, CustomPersonService>(); - - // custom repository - services.AddScoped, AuthorizedTodoItemRepository>(); - - // ... -} -``` - -## Not Using Entity Framework? - -Out of the box, the library uses your `DbContext` to create a "ContextGraph" or map of all your models and their relationships. If, however, you have models that are not members of a `DbContext`, you can manually create this graph like so: - -```csharp -// Startup.cs -public void ConfigureServices(IServiceCollection services) -{ - // Add framework services. - var mvcBuilder = services.AddMvc(); - - services.AddJsonApi(options => { - options.Namespace = "api/v1"; - options.BuildContextGraph((builder) => { - builder.AddResource("my-models"); - }); - }, mvcBuilder); - // ... -} -``` diff --git a/docs/Meta.md b/docs/Meta.md deleted file mode 100644 index 10b1a23e9a..0000000000 --- a/docs/Meta.md +++ /dev/null @@ -1,29 +0,0 @@ ---- -currentMenu: meta ---- - -# Meta - -Meta objects can be assigned in two ways: - - Resource meta - - Request Meta - -Resource meta can be defined by implementing `IHasMeta` on the model class: - -```csharp -public class Person : Identifiable, IHasMeta -{ - // ... - - public Dictionary GetMeta(IJsonApiContext context) - { - return new Dictionary { - { "copyright", "Copyright 2015 Example Corp." }, - { "authors", new string[] { "Jared Nance" } } - }; - } -} -``` - -Request Meta can be added by injecting a service that implements `IRequestMeta`. -In the event of a key collision, the Request Meta will take precendence. diff --git a/docs/Middleware.md b/docs/Middleware.md deleted file mode 100644 index 681136ca9b..0000000000 --- a/docs/Middleware.md +++ /dev/null @@ -1,20 +0,0 @@ ---- -currentMenu: middleware ---- - -# Configure Middleware and Services - -Add the following to your `Startup.ConfigureServices` method. -Replace `AppDbContext` with your DbContext. - -```csharp -services.AddJsonApi(); -``` - -Add the middleware to the `Startup.Configure` method. -Note that under the hood, this will call `app.UseMvc()` -so there is no need to add that as well. - -```csharp -app.UseJsonApi(); -``` \ No newline at end of file diff --git a/docs/Models.md b/docs/Models.md deleted file mode 100644 index 73d9afdc43..0000000000 --- a/docs/Models.md +++ /dev/null @@ -1,106 +0,0 @@ ---- -currentMenu: models ---- - -# Defining Models - -Models must implement [IIdentifiable<TId>](https://github.com/Research-Institute/json-api-dotnet-core/blob/master/src/JsonApiDotNetCore/Models/IIdentifiable.cs). -The easiest way to do this is to inherit [Identifiable<TId>](https://github.com/Research-Institute/json-api-dotnet-core/blob/master/src/JsonApiDotNetCore/Models/Identifiable.cs) where `TId` is the type of the primary key, like so: - -```csharp -public class Person : Identifiable -{ } -``` - -You can use the non-generic `Identifiable` if your primary key is an integer: - -```csharp -public class Person : Identifiable -{ } -``` - -If you need to hang annotations or attributes on the `Id` property, you can override the virtual member: - -```csharp -public class Person : Identifiable -{ - [Key] - [Column("person_id")] - public override int Id { get; set; } -} -``` - -If your model must inherit from another class, you can always implement the interface yourself. -In the following example, ApplicationUser inherits IdentityUser which already contains an Id property of -type string. - -```csharp -public class ApplicationUser -: IdentityUser, IIdentifiable -{ - [NotMapped] - public string StringId { get => this.Id; set => Id = value; } -} -``` - -## Specifying Public Attributes - -If you want an attribute on your model to be publicly available, -add the `AttrAttribute` and provide the outbound name. - -```csharp -public class Person : Identifiable -{ - [Attr("first-name")] - public string FirstName { get; set; } -} -``` - -### Immutability - -Attributes can be marked as immutable which will prevent `PATCH` requests -from updating them: - -```csharp -public class Person : Identifiable -{ - [Attr("first-name", immutable: true)] - public string FirstName { get; set; } -} -``` - -## Relationships - -In order for navigation properties to be identified in the model, -they should be labeled with the appropriate attribute (either `HasOne` or `HasMany`). - -```csharp -public class Person : Identifiable -{ - [Attr("first-name")] - public string FirstName { get; set; } - - [HasMany("todo-items")] - public virtual List TodoItems { get; set; } -} -``` - -Dependent relationships should contain a property in the form `{RelationshipName}Id`. -For example, a `TodoItem` may have an `Owner` and so the Id attribute should be `OwnerId` like so: - -```csharp -public class TodoItem : Identifiable -{ - [Attr("description")] - public string Description { get; set; } - - public int OwnerId { get; set; } - - [HasOne("owner")] - public virtual Person Owner { get; set; } -} -``` - -## Resource Names - -See [ContextGraph](contextGraph.html) for details on how the resource names are determined. \ No newline at end of file diff --git a/docs/Options.md b/docs/Options.md deleted file mode 100644 index ffba0bd685..0000000000 --- a/docs/Options.md +++ /dev/null @@ -1,47 +0,0 @@ ---- -currentMenu: options ---- - -# Global Options - -## Client Generated Ids - -By default, the server will respond with a `403 Forbidden` HTTP Status Code if a `POST` request is -received with a client generated id. However, this can be allowed by setting the `AllowClientGeneratedIds` -flag in the options: - -```csharp -public IServiceProvider ConfigureServices(IServiceCollection services) { - services.AddJsonApi( - opt => opt.AllowClientGeneratedIds = true); - // ... -} -``` - -## Pagination - -If you would like pagination implemented by default, you can specify the page size -when setting up the services: - -```csharp -public IServiceProvider ConfigureServices(IServiceCollection services) { - services.AddJsonApi( - opt => opt.DefaultPageSize = 10); - // ... -} -``` - -### Total Record Count - -The total number of records can be added to the document meta by setting it in the options: - -```csharp -public IServiceProvider ConfigureServices(IServiceCollection services) { - services.AddJsonApi(opt => - { - opt.DefaultPageSize = 5; - opt.IncludeTotalRecordCount = true; - }); - // ... -} -``` diff --git a/docs/Pagination.md b/docs/Pagination.md deleted file mode 100644 index 6d645cac2b..0000000000 --- a/docs/Pagination.md +++ /dev/null @@ -1,15 +0,0 @@ ---- -currentMenu: pagination ---- - -# Pagination - -Resources can be paginated. -The following query would set the page size to 10 and get page 2. - -``` -?page[size]=10&page[number]=2 -``` - -If you would like pagination implemented by default, you can specify the page size -when setting up the services: diff --git a/docs/QueryingData.md b/docs/QueryingData.md deleted file mode 100644 index d6de50111a..0000000000 --- a/docs/QueryingData.md +++ /dev/null @@ -1,185 +0,0 @@ -# Querying Data -### Pagination - -Resources can be paginated. -The following query would set the page size to 10 and get page 2. - -``` -?page[size]=10&page[number]=2 -``` - -If you would like pagination implemented by default, you can specify the page size -when setting up the services: - -```csharp - services.AddJsonApi( - opt => opt.DefaultPageSize = 10); -``` - -**Total Record Count** - -The total number of records can be added to the document meta by setting it in the options: - -```csharp -services.AddJsonApi(opt => -{ - opt.DefaultPageSize = 5; - opt.IncludeTotalRecordCount = true; -}); -``` - -### Filtering - -You can filter resources by attributes using the `filter` query parameter. -By default, all attributes are filterable. -The filtering strategy we have selected, uses the following form: - -``` -?filter[attribute]=value -``` - -For operations other than equality, the query can be prefixed with an operation -identifier): - -``` -?filter[attribute]=eq:value -?filter[attribute]=lt:value -?filter[attribute]=gt:value -?filter[attribute]=le:value -?filter[attribute]=ge:value -?filter[attribute]=like:value -``` - -#### Custom Filters - -You can customize the filter implementation by overriding the method in the `DefaultEntityRepository` like so: - -```csharp -public class MyEntityRepository : DefaultEntityRepository -{ - public MyEntityRepository( - AppDbContext context, - ILoggerFactory loggerFactory, - IJsonApiContext jsonApiContext) - : base(context, loggerFactory, jsonApiContext) - { } - - public override IQueryable Filter(IQueryable entities, FilterQuery filterQuery) - { - // use the base filtering method - entities = base.Filter(entities, filterQuery); - - // implement custom method - return ApplyMyCustomFilter(entities, filterQuery); - } -} -``` - -### Sorting - -Resources can be sorted by an attribute: - -``` -?sort=attribute // ascending -?sort=-attribute // descending -``` - -### Meta - -Meta objects can be assigned in two ways: - - Resource meta - - Request Meta - -Resource meta can be defined by implementing `IHasMeta` on the model class: - -```csharp -public class Person : Identifiable, IHasMeta -{ - // ... - - public Dictionary GetMeta(IJsonApiContext context) - { - return new Dictionary { - { "copyright", "Copyright 2015 Example Corp." }, - { "authors", new string[] { "Jared Nance" } } - }; - } -} -``` - -Request Meta can be added by injecting a service that implements `IRequestMeta`. -In the event of a key collision, the Request Meta will take precendence. - -### Client Generated Ids - -By default, the server will respond with a `403 Forbidden` HTTP Status Code if a `POST` request is -received with a client generated id. However, this can be allowed by setting the `AllowClientGeneratedIds` -flag in the options: - -```csharp -services.AddJsonApi(opt => -{ - opt.AllowClientGeneratedIds = true; - // .. -}); -``` - -### Custom Errors - -By default, errors will only contain the properties defined by the internal [Error](https://github.com/Research-Institute/json-api-dotnet-core/blob/master/src/JsonApiDotNetCore/Internal/Error.cs) class. However, you can create your own by inheriting from `Error` and either throwing it in a `JsonApiException` or returning the error from your controller. - -```csharp -// custom error definition -public class CustomError : Error { - public CustomError(string status, string title, string detail, string myProp) - : base(status, title, detail) - { - MyCustomProperty = myProp; - } - public string MyCustomProperty { get; set; } -} - -// throwing a custom error -public void MyMethod() { - var error = new CustomError("507", "title", "detail", "custom"); - throw new JsonApiException(error); -} - -// returning from controller -[HttpPost] -public override async Task PostAsync([FromBody] MyEntity entity) -{ - if(_db.IsFull) - return new ObjectResult(new CustomError("507", "Database is full.", "Theres no more room.", "Sorry.")); - - // ... -} -``` - -### Sparse Fieldsets - -We currently support top-level field selection. -What this means is you can restrict which fields are returned by a query using the `fields` query parameter, but this does not yet apply to included relationships. - -- Currently valid: -```http -GET /articles?fields[articles]=title,body HTTP/1.1 -Accept: application/vnd.api+json -``` - -- Not yet supported: -```http -GET /articles?include=author&fields[articles]=title,body&fields[people]=name HTTP/1.1 -Accept: application/vnd.api+json -``` - -## Tests - -I am using DotNetCoreDocs to generate sample requests and documentation. - -1. To run the tests, start a postgres server and verify the connection properties define in `/test/JsonApiDotNetCoreExampleTests/appsettings.json` -2. `cd ./test/JsonApiDotNetCoreExampleTests` -3. `dotnet test` -4. `cd ./src/JsonApiDotNetCoreExample` -5. `dotnet run` -6. `open http://localhost:5000/docs` diff --git a/docs/ResourceServices.md b/docs/ResourceServices.md deleted file mode 100644 index 28629d9e36..0000000000 --- a/docs/ResourceServices.md +++ /dev/null @@ -1,126 +0,0 @@ ---- -currentMenu: services ---- - -# Resource Services - -The [IResourceService](https://github.com/Research-Institute/json-api-dotnet-core/blob/master/src/JsonApiDotNetCore/Services/IResourceService.cs) acts as a service layer between the controller and the data access -layer. This allows you to customize it however you want and not be dependent upon Entity -Framework. This is also a good place to implement custom business logic. - -### Supplementing Default Behavior - -A simple example would be to send notifications when an entity gets created: - -```csharp -public class TodoItemService : EntityResourceService { - - private readonly INotificationService _notificationService; - - public TodoItemService( - IJsonApiContext jsonApiContext, - IEntityRepository repository, - ILoggerFactory loggerFactory, - // Get the notification service via DI - INotificationService notificationService) - : base(jsonApiContext, repository, loggerFactory) - { - _notificationService = notificationService; - } - - public override async Task CreateAsync(TEntity entity) - { - // call the base implementation which uses Entity Framework - var newEntity = await base.CreateAsync(entity); - - // custom code - _notificationService.Notify($"Entity created: { newEntity.Id }"); - - // don't forget to return the new entity - return entity; - } -} -``` - -### Not Using Entity Framework? - -As previously discussed, this library uses Entity Framework by default. -If you'd like to use another ORM that does not implement `IQueryable`, -you can inject a custom service like so: - -```csharp -// Startup.cs -public void ConfigureServices(IServiceCollection services) -{ - // add the service override for MyModel - services.AddScoped, MyModelService>(); - - // add your own DAO - services.AddScoped(); - // ... -} - - -// MyModelService.cs -public class MyModelService : IResourceService -{ - private readonly IMyModelDAL _dal; - public MyModelService(IMyModelDAL dal) - { - _dal = dal; - } - - public Task> GetAsync() - { - return await _dal.GetModelAsync(); - } -} -``` - -### Limited Requirements - -In some cases it may be necessary to only expose a few methods on the resource. -For this reason, we have created a hierarchy of service interfaces that can be used to get the -exact implementation you require. Below is a table outlining these interfaces: - -![interfaces](service_table.png) - - - In order to take advantage of these interfaces you first need to inject the service for each implemented interface. - Using Autofac, as an example, this is simply: - -```csharp -public class MyResourceService : ICreateService, IDeleteService { - // ... -} -``` - -```csharp -public class Startup { - public IServiceProvider ConfigureServices(IServiceCollection services) { - builder.RegisterType().AsImplementedInterfaces(); - } -} -``` - -Then in the controller, you should inherit the base controller and pass the services into -the named, optional base parameters: - -```csharp -public class MyResourcesController : BaseJsonApiController { - - public MyResourcesController( - IJsonApiContext jsonApiContext, - ICreateService create, - IDeleteService delete - ) : base(jsonApiContext, create: create, delete: delete) { } - - [HttpPost] - public override async Task PostAsync([FromBody] MyResource entity) - => await base.PostAsync(entity); - - [HttpDelete("{id}")] - public override async TaskDeleteAsync(int id) - => await base.DeleteAsync(id); -} -``` \ No newline at end of file diff --git a/docs/Routing.md b/docs/Routing.md deleted file mode 100644 index 008438dd39..0000000000 --- a/docs/Routing.md +++ /dev/null @@ -1,65 +0,0 @@ ---- -currentMenu: routing ---- - -# Routing - -By default the library will configure routes for each controller. -Based on the [recommendations](http://jsonapi.org/recommendations/) -outlined in the JSONAPI spec, routes are hyphenated. - -```http -GET /api/compound-models HTTP/1.1 -Accept: application/vnd.api+json -``` - -## Namespacing and Versioning URLs - -You can add a namespace to the URL by specifying it in `ConfigureServices`: - -```csharp -public IServiceProvider ConfigureServices(IServiceCollection services) { - services.AddJsonApi( - opt => opt.Namespace = "api/v1"); -} -``` - -## Disable Convention - -You can disable the dasherized convention and specify your own template -by using the `DisableRoutingConvention` Attribute. - -```csharp -[Route("[controller]")] -[DisableRoutingConvention] -public class CamelCasedModelsController : JsonApiController { - public CamelCasedModelsController( - IJsonApiContext jsonApiContext, - IResourceService resourceService, - ILoggerFactory loggerFactory) - : base(jsonApiContext, resourceService, loggerFactory) - { } -} -``` - -It is important to note that your routes *must* still end with the model name in the same format -as the resource name. This is so that we can build accurrate resource links in the json:api document. -For example, if you define a resource as `MyModels` the controller route must match: - -```csharp -public IServiceProvider ConfigureServices(IServiceCollection services) { - services.AddJsonApi(options => { - options.BuildContextGraph((builder) => { - // resource definition - builder.AddResource("myModels"); - }); - }); -} - -// controller definition -[Route("api/myModels")] -[DisableRoutingConvention] -public class TodoItemsController : JsonApiController { - //... -} -``` diff --git a/docs/Sorting.md b/docs/Sorting.md deleted file mode 100644 index 6a5367d8d9..0000000000 --- a/docs/Sorting.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -currentMenu: sorting ---- - -# Sorting - -Resources can be sorted by an attribute: - -``` -?sort=attribute // ascending -?sort=-attribute // descending -``` diff --git a/docs/SparseFieldsets.md b/docs/SparseFieldsets.md deleted file mode 100644 index 16e66a2c89..0000000000 --- a/docs/SparseFieldsets.md +++ /dev/null @@ -1,20 +0,0 @@ ---- -currentMenu: sparsefields ---- - -# Sparse Fieldsets - -We currently support top-level field selection. -What this means is you can restrict which fields are returned by a query using the `fields` query parameter, but this does not yet apply to included relationships. - -- Currently valid: -```http -GET /articles?fields[articles]=title,body HTTP/1.1 -Accept: application/vnd.api+json -``` - -- Not yet supported: -```http -GET /articles?include=author&fields[articles]=title,body&fields[people]=name HTTP/1.1 -Accept: application/vnd.api+json -``` \ No newline at end of file diff --git a/docs/Usage.md b/docs/Usage.md deleted file mode 100644 index 33db2d787f..0000000000 --- a/docs/Usage.md +++ /dev/null @@ -1,144 +0,0 @@ ---- -currentMenu: usage ---- - -# Usage - -The most basic use case leverages Entity Framework. -The shortest path to a running API looks like: - -- Create a new web app -- Install -- Define models -- Define the DbContext -- Define controllers -- Add Middleware and Services -- Seed the database -- Run Migrations -- Start the app - -This page will walk you through the **simplest** use case. More detailed examples can be found in the detailed usage subsections. - - -### Create a New Web App - -``` -$ mkdir MyApp -$ cd MyApp -$ dotnet new webapi -``` - -### Install - -See [Installation](installation.html) - -### Models - -Define your domain models such that they implement `IIdentifiable`. -The easiest way to do this is to inherit `Identifiable`: - -```csharp -public class Person : Identifiable -{ - [Attr("name")] - public string Name { get; set; } -} -``` - -### DbContext - -Nothing special here, just an ordinary DbContext - -```csharp -public class AppDbContext : DbContext -{ - public AppDbContext(DbContextOptions options) - : base(options) { } - - public DbSet People { get; set; } -} -``` - -### Controllers - -You need to create controllers that inherit from `JsonApiController` or `JsonApiController` -where `TEntity` is the model that inherits from `Identifiable`. - -```csharp -public class PeopleController : JsonApiController -{ - public PeopleController( - IJsonApiContext jsonApiContext, - IResourceService resourceService, - ILoggerFactory loggerFactory) - : base(jsonApiContext, resourceService, loggerFactory) - { } -} -``` - -### Middleware and Services - -Finally, add the services by adding the following to your -`Startup.ConfigureServices`: - -```csharp -public IServiceProvider ConfigureServices(IServiceCollection services) -{ - // add the db context like you normally would - services.AddDbContext(options => - { // use whatever provider you want, this is just an example - options.UseNpgsql(GetDbConnectionString()); - }, ServiceLifetime.Transient); - - // add jsonapi dotnet core - services.AddJsonApi(); - // ... -} -``` - -Add the middleware to the `Startup.Configure` method. -Note that under the hood, this will call `app.UseMvc()` -so there is no need to add that as well. - -```csharp -public void Configure(IApplicationBuilder app) -{ - app.UseJsonApi(); -} -``` - -### Seeding the Database - -One way to seed the database is in your Configure method: - -```csharp -public void Configure( - IApplicationBuilder app, - AppDbContext context) -{ - context.Database.EnsureCreated(); - if(context.People.Any() == false) - { - context.People.Add(new Person { - Name = "John Doe" - }); - context.SaveChanges(); - } - // ... - app.UseJsonApi(); -} -``` - -### Run Migrations - -``` -$ dotnet ef migrations add AddPeople -$ dotnet ef database update -``` - -### Start the App - -``` -$ dotnet run -$ curl http://localhost:5000/people -``` diff --git a/docs/service_table.png b/docs/service_table.png deleted file mode 100644 index d6ae611370..0000000000 Binary files a/docs/service_table.png and /dev/null differ diff --git a/logo.png b/logo.png new file mode 100644 index 0000000000..78f1acd521 Binary files /dev/null and b/logo.png differ diff --git a/src/Examples/JsonApiDotNetCoreExample/Controllers/Restricted/ReadOnlyController.cs b/src/Examples/JsonApiDotNetCoreExample/Controllers/Restricted/ReadOnlyController.cs index 57fafc8fc6..2515b1ea7a 100644 --- a/src/Examples/JsonApiDotNetCoreExample/Controllers/Restricted/ReadOnlyController.cs +++ b/src/Examples/JsonApiDotNetCoreExample/Controllers/Restricted/ReadOnlyController.cs @@ -5,7 +5,7 @@ namespace JsonApiDotNetCoreExample.Controllers.Restricted { [Route("[controller]")] [HttpReadOnly] - public class ReadOnlyController : Controller + public class ReadOnlyController : ControllerBase { [HttpGet] public IActionResult Get() => Ok(); @@ -22,7 +22,7 @@ public class ReadOnlyController : Controller [Route("[controller]")] [NoHttpPost] - public class NoHttpPostController : Controller + public class NoHttpPostController : ControllerBase { [HttpGet] public IActionResult Get() => Ok(); @@ -39,7 +39,7 @@ public class NoHttpPostController : Controller [Route("[controller]")] [NoHttpPatch] - public class NoHttpPatchController : Controller + public class NoHttpPatchController : ControllerBase { [HttpGet] public IActionResult Get() => Ok(); @@ -56,7 +56,7 @@ public class NoHttpPatchController : Controller [Route("[controller]")] [NoHttpDelete] - public class NoHttpDeleteController : Controller + public class NoHttpDeleteController : ControllerBase { [HttpGet] public IActionResult Get() => Ok(); diff --git a/src/Examples/JsonApiDotNetCoreExample/Controllers/TestValuesController.cs b/src/Examples/JsonApiDotNetCoreExample/Controllers/TestValuesController.cs index 3443d34b74..a29295c426 100644 --- a/src/Examples/JsonApiDotNetCoreExample/Controllers/TestValuesController.cs +++ b/src/Examples/JsonApiDotNetCoreExample/Controllers/TestValuesController.cs @@ -3,7 +3,7 @@ namespace JsonApiDotNetCoreExample.Controllers { [Route("[controller]")] - public class TestValuesController : Controller + public class TestValuesController : ControllerBase { [HttpGet] public IActionResult Get() diff --git a/src/Examples/JsonApiDotNetCoreExample/Controllers/TodoItemsCustomController.cs b/src/Examples/JsonApiDotNetCoreExample/Controllers/TodoItemsCustomController.cs index de784c129a..f5f3e111d9 100644 --- a/src/Examples/JsonApiDotNetCoreExample/Controllers/TodoItemsCustomController.cs +++ b/src/Examples/JsonApiDotNetCoreExample/Controllers/TodoItemsCustomController.cs @@ -33,17 +33,12 @@ public CustomJsonApiController( } public class CustomJsonApiController - : Controller where T : class, IIdentifiable + : ControllerBase where T : class, IIdentifiable { private readonly ILogger _logger; private readonly IResourceService _resourceService; private readonly IJsonApiContext _jsonApiContext; - protected IActionResult UnprocessableEntity() - { - return new StatusCodeResult(422); - } - protected IActionResult Forbidden() { return new StatusCodeResult(403); diff --git a/src/Examples/JsonApiDotNetCoreExample/Controllers/UsersController.cs b/src/Examples/JsonApiDotNetCoreExample/Controllers/UsersController.cs new file mode 100644 index 0000000000..dbd144caa4 --- /dev/null +++ b/src/Examples/JsonApiDotNetCoreExample/Controllers/UsersController.cs @@ -0,0 +1,17 @@ +using JsonApiDotNetCore.Controllers; +using JsonApiDotNetCore.Services; +using JsonApiDotNetCoreExample.Models; +using Microsoft.Extensions.Logging; + +namespace JsonApiDotNetCoreExample.Controllers +{ + public class UsersController : JsonApiController + { + public UsersController( + IJsonApiContext jsonApiContext, + IResourceService resourceService, + ILoggerFactory loggerFactory) + : base(jsonApiContext, resourceService, loggerFactory) + { } + } +} diff --git a/src/Examples/JsonApiDotNetCoreExample/Data/AppDbContext.cs b/src/Examples/JsonApiDotNetCoreExample/Data/AppDbContext.cs index ccdf8e8d9f..ec96cadd8e 100644 --- a/src/Examples/JsonApiDotNetCoreExample/Data/AppDbContext.cs +++ b/src/Examples/JsonApiDotNetCoreExample/Data/AppDbContext.cs @@ -1,5 +1,4 @@ -using JsonApiDotNetCoreExample.Models; -using JsonApiDotNetCore.Models; +using JsonApiDotNetCoreExample.Models; using Microsoft.EntityFrameworkCore; namespace JsonApiDotNetCoreExample.Data @@ -14,12 +13,12 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) { modelBuilder.Entity() .Property(t => t.CreatedDate).HasDefaultValueSql("CURRENT_TIMESTAMP").IsRequired(); - + modelBuilder.Entity() .HasOne(t => t.Assignee) .WithMany(p => p.AssignedTodoItems) .HasForeignKey(t => t.AssigneeId); - + modelBuilder.Entity() .HasOne(t => t.Owner) .WithMany(p => p.TodoItems) @@ -28,11 +27,11 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) public DbSet TodoItems { get; set; } public DbSet People { get; set; } - - [Resource("todo-collections")] public DbSet TodoItemCollections { get; set; } - - [Resource("camelCasedModels")] public DbSet CamelCasedModels { get; set; } + public DbSet
Articles { get; set; } + public DbSet Authors { get; set; } + public DbSet NonJsonApiResources { get; set; } + public DbSet Users { get; set; } } } diff --git a/src/Examples/JsonApiDotNetCoreExample/JsonApiDotNetCoreExample.csproj b/src/Examples/JsonApiDotNetCoreExample/JsonApiDotNetCoreExample.csproj index e9971a1113..fd657e83bf 100755 --- a/src/Examples/JsonApiDotNetCoreExample/JsonApiDotNetCoreExample.csproj +++ b/src/Examples/JsonApiDotNetCoreExample/JsonApiDotNetCoreExample.csproj @@ -1,7 +1,6 @@ - - netcoreapp2.0 + $(NetCoreAppVersion) true JsonApiDotNetCoreExample Exe @@ -13,7 +12,7 @@ - + @@ -27,8 +26,4 @@ - - - - diff --git a/src/Examples/JsonApiDotNetCoreExample/Migrations/20170315140127_initial.Designer.cs b/src/Examples/JsonApiDotNetCoreExample/Migrations/20170315140127_initial.Designer.cs deleted file mode 100644 index be31f0ccae..0000000000 --- a/src/Examples/JsonApiDotNetCoreExample/Migrations/20170315140127_initial.Designer.cs +++ /dev/null @@ -1,92 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using JsonApiDotNetCoreExample.Data; - -namespace JsonApiDotNetCoreExample.Migrations -{ - [DbContext(typeof(AppDbContext))] - [Migration("20170315140127_initial")] - partial class initial - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { - modelBuilder - .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.SerialColumn) - .HasAnnotation("ProductVersion", "1.1.1"); - - modelBuilder.Entity("JsonApiDotNetCoreExample.Models.Person", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("FirstName"); - - b.Property("LastName"); - - b.HasKey("Id"); - - b.ToTable("People"); - }); - - modelBuilder.Entity("JsonApiDotNetCoreExample.Models.TodoItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("CollectionId"); - - b.Property("Description"); - - b.Property("Ordinal"); - - b.Property("OwnerId"); - - b.HasKey("Id"); - - b.HasIndex("CollectionId"); - - b.HasIndex("OwnerId"); - - b.ToTable("TodoItems"); - }); - - modelBuilder.Entity("JsonApiDotNetCoreExample.Models.TodoItemCollection", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Name"); - - b.Property("OwnerId"); - - b.HasKey("Id"); - - b.HasIndex("OwnerId"); - - b.ToTable("TodoItemCollections"); - }); - - modelBuilder.Entity("JsonApiDotNetCoreExample.Models.TodoItem", b => - { - b.HasOne("JsonApiDotNetCoreExample.Models.TodoItemCollection", "Collection") - .WithMany("TodoItems") - .HasForeignKey("CollectionId"); - - b.HasOne("JsonApiDotNetCoreExample.Models.Person", "Owner") - .WithMany("TodoItems") - .HasForeignKey("OwnerId"); - }); - - modelBuilder.Entity("JsonApiDotNetCoreExample.Models.TodoItemCollection", b => - { - b.HasOne("JsonApiDotNetCoreExample.Models.Person", "Owner") - .WithMany("TodoItemCollections") - .HasForeignKey("OwnerId") - .OnDelete(DeleteBehavior.Cascade); - }); - } - } -} diff --git a/src/Examples/JsonApiDotNetCoreExample/Migrations/20170330020650_AddAssignedTodoItems.Designer.cs b/src/Examples/JsonApiDotNetCoreExample/Migrations/20170330020650_AddAssignedTodoItems.Designer.cs deleted file mode 100755 index 52b60adbcb..0000000000 --- a/src/Examples/JsonApiDotNetCoreExample/Migrations/20170330020650_AddAssignedTodoItems.Designer.cs +++ /dev/null @@ -1,100 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using JsonApiDotNetCoreExample.Data; - -namespace JsonApiDotNetCoreExample.Migrations -{ - [DbContext(typeof(AppDbContext))] - [Migration("20170330020650_AddAssignedTodoItems")] - partial class AddAssignedTodoItems - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { - modelBuilder - .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.SerialColumn) - .HasAnnotation("ProductVersion", "1.1.1"); - - modelBuilder.Entity("JsonApiDotNetCoreExample.Models.Person", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("FirstName"); - - b.Property("LastName"); - - b.HasKey("Id"); - - b.ToTable("People"); - }); - - modelBuilder.Entity("JsonApiDotNetCoreExample.Models.TodoItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("AssigneeId"); - - b.Property("CollectionId"); - - b.Property("Description"); - - b.Property("Ordinal"); - - b.Property("OwnerId"); - - b.HasKey("Id"); - - b.HasIndex("AssigneeId"); - - b.HasIndex("CollectionId"); - - b.HasIndex("OwnerId"); - - b.ToTable("TodoItems"); - }); - - modelBuilder.Entity("JsonApiDotNetCoreExample.Models.TodoItemCollection", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Name"); - - b.Property("OwnerId"); - - b.HasKey("Id"); - - b.HasIndex("OwnerId"); - - b.ToTable("TodoItemCollections"); - }); - - modelBuilder.Entity("JsonApiDotNetCoreExample.Models.TodoItem", b => - { - b.HasOne("JsonApiDotNetCoreExample.Models.Person", "Assignee") - .WithMany("AssignedTodoItems") - .HasForeignKey("AssigneeId"); - - b.HasOne("JsonApiDotNetCoreExample.Models.TodoItemCollection", "Collection") - .WithMany("TodoItems") - .HasForeignKey("CollectionId"); - - b.HasOne("JsonApiDotNetCoreExample.Models.Person", "Owner") - .WithMany("TodoItems") - .HasForeignKey("OwnerId"); - }); - - modelBuilder.Entity("JsonApiDotNetCoreExample.Models.TodoItemCollection", b => - { - b.HasOne("JsonApiDotNetCoreExample.Models.Person", "Owner") - .WithMany("TodoItemCollections") - .HasForeignKey("OwnerId") - .OnDelete(DeleteBehavior.Cascade); - }); - } - } -} diff --git a/src/Examples/JsonApiDotNetCoreExample/Migrations/20170330020650_AddAssignedTodoItems.cs b/src/Examples/JsonApiDotNetCoreExample/Migrations/20170330020650_AddAssignedTodoItems.cs deleted file mode 100755 index 8a1810a9d8..0000000000 --- a/src/Examples/JsonApiDotNetCoreExample/Migrations/20170330020650_AddAssignedTodoItems.cs +++ /dev/null @@ -1,43 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -namespace JsonApiDotNetCoreExample.Migrations -{ - public partial class AddAssignedTodoItems : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "AssigneeId", - table: "TodoItems", - nullable: true); - - migrationBuilder.CreateIndex( - name: "IX_TodoItems_AssigneeId", - table: "TodoItems", - column: "AssigneeId"); - - migrationBuilder.AddForeignKey( - name: "FK_TodoItems_People_AssigneeId", - table: "TodoItems", - column: "AssigneeId", - principalTable: "People", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropForeignKey( - name: "FK_TodoItems_People_AssigneeId", - table: "TodoItems"); - - migrationBuilder.DropIndex( - name: "IX_TodoItems_AssigneeId", - table: "TodoItems"); - - migrationBuilder.DropColumn( - name: "AssigneeId", - table: "TodoItems"); - } - } -} diff --git a/src/Examples/JsonApiDotNetCoreExample/Migrations/20170330234539_AddGuidProperty.Designer.cs b/src/Examples/JsonApiDotNetCoreExample/Migrations/20170330234539_AddGuidProperty.Designer.cs deleted file mode 100755 index ded5d1b160..0000000000 --- a/src/Examples/JsonApiDotNetCoreExample/Migrations/20170330234539_AddGuidProperty.Designer.cs +++ /dev/null @@ -1,102 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using JsonApiDotNetCoreExample.Data; - -namespace JsonApiDotNetCoreExample.Migrations -{ - [DbContext(typeof(AppDbContext))] - [Migration("20170330234539_AddGuidProperty")] - partial class AddGuidProperty - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { - modelBuilder - .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.SerialColumn) - .HasAnnotation("ProductVersion", "1.1.1"); - - modelBuilder.Entity("JsonApiDotNetCoreExample.Models.Person", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("FirstName"); - - b.Property("LastName"); - - b.HasKey("Id"); - - b.ToTable("People"); - }); - - modelBuilder.Entity("JsonApiDotNetCoreExample.Models.TodoItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("AssigneeId"); - - b.Property("CollectionId"); - - b.Property("Description"); - - b.Property("GuidProperty"); - - b.Property("Ordinal"); - - b.Property("OwnerId"); - - b.HasKey("Id"); - - b.HasIndex("AssigneeId"); - - b.HasIndex("CollectionId"); - - b.HasIndex("OwnerId"); - - b.ToTable("TodoItems"); - }); - - modelBuilder.Entity("JsonApiDotNetCoreExample.Models.TodoItemCollection", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Name"); - - b.Property("OwnerId"); - - b.HasKey("Id"); - - b.HasIndex("OwnerId"); - - b.ToTable("TodoItemCollections"); - }); - - modelBuilder.Entity("JsonApiDotNetCoreExample.Models.TodoItem", b => - { - b.HasOne("JsonApiDotNetCoreExample.Models.Person", "Assignee") - .WithMany("AssignedTodoItems") - .HasForeignKey("AssigneeId"); - - b.HasOne("JsonApiDotNetCoreExample.Models.TodoItemCollection", "Collection") - .WithMany("TodoItems") - .HasForeignKey("CollectionId"); - - b.HasOne("JsonApiDotNetCoreExample.Models.Person", "Owner") - .WithMany("TodoItems") - .HasForeignKey("OwnerId"); - }); - - modelBuilder.Entity("JsonApiDotNetCoreExample.Models.TodoItemCollection", b => - { - b.HasOne("JsonApiDotNetCoreExample.Models.Person", "Owner") - .WithMany("TodoItemCollections") - .HasForeignKey("OwnerId") - .OnDelete(DeleteBehavior.Cascade); - }); - } - } -} diff --git a/src/Examples/JsonApiDotNetCoreExample/Migrations/20170330234539_AddGuidProperty.cs b/src/Examples/JsonApiDotNetCoreExample/Migrations/20170330234539_AddGuidProperty.cs deleted file mode 100755 index 27815ce504..0000000000 --- a/src/Examples/JsonApiDotNetCoreExample/Migrations/20170330234539_AddGuidProperty.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -namespace JsonApiDotNetCoreExample.Migrations -{ - public partial class AddGuidProperty : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "GuidProperty", - table: "TodoItems", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000")); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "GuidProperty", - table: "TodoItems"); - } - } -} diff --git a/src/Examples/JsonApiDotNetCoreExample/Migrations/20170424180950_AddCreatesAndAchievedDates.Designer.cs b/src/Examples/JsonApiDotNetCoreExample/Migrations/20170424180950_AddCreatesAndAchievedDates.Designer.cs deleted file mode 100755 index 537b3b043a..0000000000 --- a/src/Examples/JsonApiDotNetCoreExample/Migrations/20170424180950_AddCreatesAndAchievedDates.Designer.cs +++ /dev/null @@ -1,108 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using JsonApiDotNetCoreExample.Data; - -namespace JsonApiDotNetCoreExample.Migrations -{ - [DbContext(typeof(AppDbContext))] - [Migration("20170424180950_AddCreatesAndAchievedDates")] - partial class AddCreatesAndAchievedDates - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { - modelBuilder - .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.SerialColumn) - .HasAnnotation("ProductVersion", "1.1.1"); - - modelBuilder.Entity("JsonApiDotNetCoreExample.Models.Person", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("FirstName"); - - b.Property("LastName"); - - b.HasKey("Id"); - - b.ToTable("People"); - }); - - modelBuilder.Entity("JsonApiDotNetCoreExample.Models.TodoItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("AchievedDate"); - - b.Property("AssigneeId"); - - b.Property("CollectionId"); - - b.Property("CreatedDate") - .ValueGeneratedOnAdd() - .HasDefaultValueSql("CURRENT_TIMESTAMP"); - - b.Property("Description"); - - b.Property("GuidProperty"); - - b.Property("Ordinal"); - - b.Property("OwnerId"); - - b.HasKey("Id"); - - b.HasIndex("AssigneeId"); - - b.HasIndex("CollectionId"); - - b.HasIndex("OwnerId"); - - b.ToTable("TodoItems"); - }); - - modelBuilder.Entity("JsonApiDotNetCoreExample.Models.TodoItemCollection", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Name"); - - b.Property("OwnerId"); - - b.HasKey("Id"); - - b.HasIndex("OwnerId"); - - b.ToTable("TodoItemCollections"); - }); - - modelBuilder.Entity("JsonApiDotNetCoreExample.Models.TodoItem", b => - { - b.HasOne("JsonApiDotNetCoreExample.Models.Person", "Assignee") - .WithMany("AssignedTodoItems") - .HasForeignKey("AssigneeId"); - - b.HasOne("JsonApiDotNetCoreExample.Models.TodoItemCollection", "Collection") - .WithMany("TodoItems") - .HasForeignKey("CollectionId"); - - b.HasOne("JsonApiDotNetCoreExample.Models.Person", "Owner") - .WithMany("TodoItems") - .HasForeignKey("OwnerId"); - }); - - modelBuilder.Entity("JsonApiDotNetCoreExample.Models.TodoItemCollection", b => - { - b.HasOne("JsonApiDotNetCoreExample.Models.Person", "Owner") - .WithMany("TodoItemCollections") - .HasForeignKey("OwnerId") - .OnDelete(DeleteBehavior.Cascade); - }); - } - } -} diff --git a/src/Examples/JsonApiDotNetCoreExample/Migrations/20170424180950_AddCreatesAndAchievedDates.cs b/src/Examples/JsonApiDotNetCoreExample/Migrations/20170424180950_AddCreatesAndAchievedDates.cs deleted file mode 100755 index 1c36034fe3..0000000000 --- a/src/Examples/JsonApiDotNetCoreExample/Migrations/20170424180950_AddCreatesAndAchievedDates.cs +++ /dev/null @@ -1,33 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -namespace JsonApiDotNetCoreExample.Migrations -{ - public partial class AddCreatesAndAchievedDates : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "AchievedDate", - table: "TodoItems", - nullable: true); - - migrationBuilder.AddColumn( - name: "CreatedDate", - table: "TodoItems", - nullable: false, - defaultValueSql: "CURRENT_TIMESTAMP"); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "AchievedDate", - table: "TodoItems"); - - migrationBuilder.DropColumn( - name: "CreatedDate", - table: "TodoItems"); - } - } -} diff --git a/src/Examples/JsonApiDotNetCoreExample/Migrations/20170426232509_AddCamelCasedModel.cs b/src/Examples/JsonApiDotNetCoreExample/Migrations/20170426232509_AddCamelCasedModel.cs deleted file mode 100755 index fbec5e0a79..0000000000 --- a/src/Examples/JsonApiDotNetCoreExample/Migrations/20170426232509_AddCamelCasedModel.cs +++ /dev/null @@ -1,30 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Metadata; - -namespace JsonApiDotNetCoreExample.Migrations -{ - public partial class AddCamelCasedModel : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "CamelCasedModels", - columns: table => new - { - Id = table.Column(nullable: false) - .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.SerialColumn), - CompoundAttr = table.Column(nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_CamelCasedModels", x => x.Id); - }); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "CamelCasedModels"); - } - } -} diff --git a/src/Examples/JsonApiDotNetCoreExample/Migrations/20170426232509_AddCamelCasedModel.Designer.cs b/src/Examples/JsonApiDotNetCoreExample/Migrations/20180327120810_initial.Designer.cs old mode 100755 new mode 100644 similarity index 71% rename from src/Examples/JsonApiDotNetCoreExample/Migrations/20170426232509_AddCamelCasedModel.Designer.cs rename to src/Examples/JsonApiDotNetCoreExample/Migrations/20180327120810_initial.Designer.cs index e43d2afc1f..c9788bf82f --- a/src/Examples/JsonApiDotNetCoreExample/Migrations/20170426232509_AddCamelCasedModel.Designer.cs +++ b/src/Examples/JsonApiDotNetCoreExample/Migrations/20180327120810_initial.Designer.cs @@ -1,21 +1,54 @@ -using System; +// +using JsonApiDotNetCoreExample.Data; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; -using JsonApiDotNetCoreExample.Data; +using Microsoft.EntityFrameworkCore.Storage; +using Microsoft.EntityFrameworkCore.Storage.Internal; +using System; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; namespace JsonApiDotNetCoreExample.Migrations { [DbContext(typeof(AppDbContext))] - [Migration("20170426232509_AddCamelCasedModel")] - partial class AddCamelCasedModel + [Migration("20180327120810_initial")] + partial class initial { protected override void BuildTargetModel(ModelBuilder modelBuilder) { +#pragma warning disable 612, 618 modelBuilder .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.SerialColumn) - .HasAnnotation("ProductVersion", "1.1.1"); + .HasAnnotation("ProductVersion", "2.0.1-rtm-125"); + + modelBuilder.Entity("JsonApiDotNetCoreExample.Models.Article", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("AuthorId"); + + b.Property("Name"); + + b.HasKey("Id"); + + b.HasIndex("AuthorId"); + + b.ToTable("Articles"); + }); + + modelBuilder.Entity("JsonApiDotNetCoreExample.Models.Author", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("Name"); + + b.HasKey("Id"); + + b.ToTable("Authors"); + }); modelBuilder.Entity("JsonApiDotNetCoreExample.Models.CamelCasedModel", b => { @@ -93,6 +126,14 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.ToTable("TodoItemCollections"); }); + modelBuilder.Entity("JsonApiDotNetCoreExample.Models.Article", b => + { + b.HasOne("JsonApiDotNetCoreExample.Models.Author", "Author") + .WithMany("Articles") + .HasForeignKey("AuthorId") + .OnDelete(DeleteBehavior.Cascade); + }); + modelBuilder.Entity("JsonApiDotNetCoreExample.Models.TodoItem", b => { b.HasOne("JsonApiDotNetCoreExample.Models.Person", "Assignee") @@ -115,6 +156,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) .HasForeignKey("OwnerId") .OnDelete(DeleteBehavior.Cascade); }); +#pragma warning restore 612, 618 } } } diff --git a/src/Examples/JsonApiDotNetCoreExample/Migrations/20170315140127_initial.cs b/src/Examples/JsonApiDotNetCoreExample/Migrations/20180327120810_initial.cs similarity index 54% rename from src/Examples/JsonApiDotNetCoreExample/Migrations/20170315140127_initial.cs rename to src/Examples/JsonApiDotNetCoreExample/Migrations/20180327120810_initial.cs index e0b4e3b40b..ffbf105255 100644 --- a/src/Examples/JsonApiDotNetCoreExample/Migrations/20170315140127_initial.cs +++ b/src/Examples/JsonApiDotNetCoreExample/Migrations/20180327120810_initial.cs @@ -1,6 +1,6 @@ -using System; using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Metadata; +using System; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; namespace JsonApiDotNetCoreExample.Migrations { @@ -8,6 +8,32 @@ public partial class initial : Migration { protected override void Up(MigrationBuilder migrationBuilder) { + migrationBuilder.CreateTable( + name: "Authors", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.SerialColumn), + Name = table.Column(nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Authors", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "CamelCasedModels", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.SerialColumn), + CompoundAttr = table.Column(nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_CamelCasedModels", x => x.Id); + }); + migrationBuilder.CreateTable( name: "People", columns: table => new @@ -22,6 +48,26 @@ protected override void Up(MigrationBuilder migrationBuilder) table.PrimaryKey("PK_People", x => x.Id); }); + migrationBuilder.CreateTable( + name: "Articles", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.SerialColumn), + AuthorId = table.Column(nullable: false), + Name = table.Column(nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Articles", x => x.Id); + table.ForeignKey( + name: "FK_Articles_Authors_AuthorId", + column: x => x.AuthorId, + principalTable: "Authors", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + migrationBuilder.CreateTable( name: "TodoItemCollections", columns: table => new @@ -47,14 +93,24 @@ protected override void Up(MigrationBuilder migrationBuilder) { Id = table.Column(nullable: false) .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.SerialColumn), + AchievedDate = table.Column(nullable: true), + AssigneeId = table.Column(nullable: true), CollectionId = table.Column(nullable: true), + CreatedDate = table.Column(nullable: false, defaultValueSql: "CURRENT_TIMESTAMP"), Description = table.Column(nullable: true), + GuidProperty = table.Column(nullable: false), Ordinal = table.Column(nullable: false), OwnerId = table.Column(nullable: true) }, constraints: table => { table.PrimaryKey("PK_TodoItems", x => x.Id); + table.ForeignKey( + name: "FK_TodoItems_People_AssigneeId", + column: x => x.AssigneeId, + principalTable: "People", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); table.ForeignKey( name: "FK_TodoItems_TodoItemCollections_CollectionId", column: x => x.CollectionId, @@ -69,6 +125,21 @@ protected override void Up(MigrationBuilder migrationBuilder) onDelete: ReferentialAction.Restrict); }); + migrationBuilder.CreateIndex( + name: "IX_Articles_AuthorId", + table: "Articles", + column: "AuthorId"); + + migrationBuilder.CreateIndex( + name: "IX_TodoItemCollections_OwnerId", + table: "TodoItemCollections", + column: "OwnerId"); + + migrationBuilder.CreateIndex( + name: "IX_TodoItems_AssigneeId", + table: "TodoItems", + column: "AssigneeId"); + migrationBuilder.CreateIndex( name: "IX_TodoItems_CollectionId", table: "TodoItems", @@ -78,18 +149,22 @@ protected override void Up(MigrationBuilder migrationBuilder) name: "IX_TodoItems_OwnerId", table: "TodoItems", column: "OwnerId"); - - migrationBuilder.CreateIndex( - name: "IX_TodoItemCollections_OwnerId", - table: "TodoItemCollections", - column: "OwnerId"); } protected override void Down(MigrationBuilder migrationBuilder) { + migrationBuilder.DropTable( + name: "Articles"); + + migrationBuilder.DropTable( + name: "CamelCasedModels"); + migrationBuilder.DropTable( name: "TodoItems"); + migrationBuilder.DropTable( + name: "Authors"); + migrationBuilder.DropTable( name: "TodoItemCollections"); diff --git a/src/Examples/JsonApiDotNetCoreExample/Migrations/AppDbContextModelSnapshot.cs b/src/Examples/JsonApiDotNetCoreExample/Migrations/AppDbContextModelSnapshot.cs index 5de99f5078..08c284393e 100755 --- a/src/Examples/JsonApiDotNetCoreExample/Migrations/AppDbContextModelSnapshot.cs +++ b/src/Examples/JsonApiDotNetCoreExample/Migrations/AppDbContextModelSnapshot.cs @@ -1,8 +1,13 @@ -using System; +// +using JsonApiDotNetCoreExample.Data; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Metadata; -using JsonApiDotNetCoreExample.Data; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage; +using Microsoft.EntityFrameworkCore.Storage.Internal; +using System; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; namespace JsonApiDotNetCoreExample.Migrations { @@ -11,9 +16,38 @@ partial class AppDbContextModelSnapshot : ModelSnapshot { protected override void BuildModel(ModelBuilder modelBuilder) { +#pragma warning disable 612, 618 modelBuilder .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.SerialColumn) - .HasAnnotation("ProductVersion", "1.1.1"); + .HasAnnotation("ProductVersion", "2.0.1-rtm-125"); + + modelBuilder.Entity("JsonApiDotNetCoreExample.Models.Article", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("AuthorId"); + + b.Property("Name"); + + b.HasKey("Id"); + + b.HasIndex("AuthorId"); + + b.ToTable("Articles"); + }); + + modelBuilder.Entity("JsonApiDotNetCoreExample.Models.Author", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("Name"); + + b.HasKey("Id"); + + b.ToTable("Authors"); + }); modelBuilder.Entity("JsonApiDotNetCoreExample.Models.CamelCasedModel", b => { @@ -91,6 +125,14 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.ToTable("TodoItemCollections"); }); + modelBuilder.Entity("JsonApiDotNetCoreExample.Models.Article", b => + { + b.HasOne("JsonApiDotNetCoreExample.Models.Author", "Author") + .WithMany("Articles") + .HasForeignKey("AuthorId") + .OnDelete(DeleteBehavior.Cascade); + }); + modelBuilder.Entity("JsonApiDotNetCoreExample.Models.TodoItem", b => { b.HasOne("JsonApiDotNetCoreExample.Models.Person", "Assignee") @@ -113,6 +155,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) .HasForeignKey("OwnerId") .OnDelete(DeleteBehavior.Cascade); }); +#pragma warning restore 612, 618 } } } diff --git a/src/Examples/JsonApiDotNetCoreExample/Models/Article.cs b/src/Examples/JsonApiDotNetCoreExample/Models/Article.cs new file mode 100644 index 0000000000..c633d58bdd --- /dev/null +++ b/src/Examples/JsonApiDotNetCoreExample/Models/Article.cs @@ -0,0 +1,14 @@ +using JsonApiDotNetCore.Models; + +namespace JsonApiDotNetCoreExample.Models +{ + public class Article : Identifiable + { + [Attr("name")] + public string Name { get; set; } + + [HasOne("author")] + public Author Author { get; set; } + public int AuthorId { get; set; } + } +} diff --git a/src/Examples/JsonApiDotNetCoreExample/Models/Author.cs b/src/Examples/JsonApiDotNetCoreExample/Models/Author.cs new file mode 100644 index 0000000000..c77ad007c8 --- /dev/null +++ b/src/Examples/JsonApiDotNetCoreExample/Models/Author.cs @@ -0,0 +1,14 @@ +using JsonApiDotNetCore.Models; +using System.Collections.Generic; + +namespace JsonApiDotNetCoreExample.Models +{ + public class Author : Identifiable + { + [Attr("name")] + public string Name { get; set; } + + [HasMany("articles")] + public List
Articles { get; set; } + } +} diff --git a/src/Examples/JsonApiDotNetCoreExample/Models/CamelCasedModel.cs b/src/Examples/JsonApiDotNetCoreExample/Models/CamelCasedModel.cs index 7adf628f38..43d5a43272 100644 --- a/src/Examples/JsonApiDotNetCoreExample/Models/CamelCasedModel.cs +++ b/src/Examples/JsonApiDotNetCoreExample/Models/CamelCasedModel.cs @@ -2,6 +2,7 @@ namespace JsonApiDotNetCoreExample.Models { + [Resource("camelCasedModels")] public class CamelCasedModel : Identifiable { [Attr("compoundAttr")] diff --git a/src/Examples/JsonApiDotNetCoreExample/Models/NonJsonApiResource.cs b/src/Examples/JsonApiDotNetCoreExample/Models/NonJsonApiResource.cs new file mode 100644 index 0000000000..7f979f4cfb --- /dev/null +++ b/src/Examples/JsonApiDotNetCoreExample/Models/NonJsonApiResource.cs @@ -0,0 +1,7 @@ +namespace JsonApiDotNetCoreExample.Models +{ + public class NonJsonApiResource + { + public int Id { get; set; } + } +} diff --git a/src/Examples/JsonApiDotNetCoreExample/Models/Person.cs b/src/Examples/JsonApiDotNetCoreExample/Models/Person.cs index 8acf87c405..d140b23b6b 100644 --- a/src/Examples/JsonApiDotNetCoreExample/Models/Person.cs +++ b/src/Examples/JsonApiDotNetCoreExample/Models/Person.cs @@ -20,6 +20,9 @@ public class Person : Identifiable, IHasMeta [HasMany("todo-collections")] public virtual List TodoItemCollections { get; set; } + + [HasOne("unincludeable-item", Link.All, canInclude: false)] + public virtual TodoItem UnIncludeableItem { get; set; } public Dictionary GetMeta(IJsonApiContext context) { diff --git a/src/Examples/JsonApiDotNetCoreExample/Models/TodoItem.cs b/src/Examples/JsonApiDotNetCoreExample/Models/TodoItem.cs index 7257835791..fecd16319d 100644 --- a/src/Examples/JsonApiDotNetCoreExample/Models/TodoItem.cs +++ b/src/Examples/JsonApiDotNetCoreExample/Models/TodoItem.cs @@ -22,7 +22,7 @@ public TodoItem() [Attr("created-date")] public DateTime CreatedDate { get; set; } - [Attr("achieved-date")] + [Attr("achieved-date", isFilterable: false, isSortable: false)] public DateTime? AchievedDate { get; set; } public int? OwnerId { get; set; } diff --git a/src/Examples/JsonApiDotNetCoreExample/Models/TodoItemCollection.cs b/src/Examples/JsonApiDotNetCoreExample/Models/TodoItemCollection.cs index 95a523dff3..85877b3848 100644 --- a/src/Examples/JsonApiDotNetCoreExample/Models/TodoItemCollection.cs +++ b/src/Examples/JsonApiDotNetCoreExample/Models/TodoItemCollection.cs @@ -4,6 +4,7 @@ namespace JsonApiDotNetCoreExample.Models { + [Resource("todo-collections")] public class TodoItemCollection : Identifiable { [Attr("name")] @@ -16,4 +17,4 @@ public class TodoItemCollection : Identifiable [HasOne("owner")] public virtual Person Owner { get; set; } } -} \ No newline at end of file +} diff --git a/src/Examples/JsonApiDotNetCoreExample/Models/User.cs b/src/Examples/JsonApiDotNetCoreExample/Models/User.cs new file mode 100644 index 0000000000..3b66f0dbb2 --- /dev/null +++ b/src/Examples/JsonApiDotNetCoreExample/Models/User.cs @@ -0,0 +1,10 @@ +using JsonApiDotNetCore.Models; + +namespace JsonApiDotNetCoreExample.Models +{ + public class User : Identifiable + { + [Attr("username")] public string Username { get; set; } + [Attr("password")] public string Password { get; set; } + } +} diff --git a/src/Examples/JsonApiDotNetCoreExample/Program.cs b/src/Examples/JsonApiDotNetCoreExample/Program.cs index 16f0ad10a1..b9bbe37b6a 100644 --- a/src/Examples/JsonApiDotNetCoreExample/Program.cs +++ b/src/Examples/JsonApiDotNetCoreExample/Program.cs @@ -1,26 +1,15 @@ -using System.IO; +using Microsoft.AspNetCore; using Microsoft.AspNetCore.Hosting; -using Microsoft.Extensions.Configuration; namespace JsonApiDotNetCoreExample { public class Program { - public static void Main(string[] args) - { - var config = new ConfigurationBuilder() - .AddCommandLine(args) - .AddEnvironmentVariables(prefix: "ASPNETCORE_") - .Build(); + public static void Main(string[] args) => BuildWebHost(args).Run(); - var host = new WebHostBuilder() - .UseConfiguration(config) - .UseKestrel() - .UseContentRoot(Directory.GetCurrentDirectory()) + public static IWebHost BuildWebHost(string[] args) => + WebHost.CreateDefaultBuilder(args) .UseStartup() .Build(); - - host.Run(); - } } } diff --git a/src/Examples/JsonApiDotNetCoreExample/Resources/UserResource.cs b/src/Examples/JsonApiDotNetCoreExample/Resources/UserResource.cs new file mode 100644 index 0000000000..030bc4eaa4 --- /dev/null +++ b/src/Examples/JsonApiDotNetCoreExample/Resources/UserResource.cs @@ -0,0 +1,12 @@ +using System.Collections.Generic; +using JsonApiDotNetCore.Models; +using JsonApiDotNetCoreExample.Models; + +namespace JsonApiDotNetCoreExample.Resources +{ + public class UserResource : ResourceDefinition + { + protected override List OutputAttrs() + => Remove(user => user.Password); + } +} diff --git a/src/Examples/JsonApiDotNetCoreExample/Startup.cs b/src/Examples/JsonApiDotNetCoreExample/Startup.cs index 9683eb033d..29dfc9e4b5 100644 --- a/src/Examples/JsonApiDotNetCoreExample/Startup.cs +++ b/src/Examples/JsonApiDotNetCoreExample/Startup.cs @@ -18,7 +18,7 @@ public Startup(IHostingEnvironment env) { var builder = new ConfigurationBuilder() .SetBasePath(env.ContentRootPath) - .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true) + .AddJsonFile("appsettings.json", optional: true, reloadOnChange: false) .AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true) .AddEnvironmentVariables(); @@ -28,26 +28,22 @@ public Startup(IHostingEnvironment env) public virtual IServiceProvider ConfigureServices(IServiceCollection services) { var loggerFactory = new LoggerFactory(); - loggerFactory.AddConsole(LogLevel.Trace); - services.AddSingleton(loggerFactory); + loggerFactory.AddConsole(LogLevel.Warning); - services.AddDbContext(options => - { - options.UseNpgsql(GetDbConnectionString()); - }, ServiceLifetime.Transient); + var mvcBuilder = services.AddMvcCore(); - services.AddJsonApi(opt => - { - opt.Namespace = "api/v1"; - opt.DefaultPageSize = 5; - opt.IncludeTotalRecordCount = true; - }); + services + .AddSingleton(loggerFactory) + .AddDbContext(options => options.UseNpgsql(GetDbConnectionString()), ServiceLifetime.Transient) + .AddJsonApi(options => { + options.Namespace = "api/v1"; + options.DefaultPageSize = 5; + options.IncludeTotalRecordCount = true; + }, + mvcBuilder, + discovery => discovery.AddCurrentAssemblyServices()); - var provider = services.BuildServiceProvider(); - var appContext = provider.GetRequiredService(); - if(appContext == null) - throw new ArgumentException(); - + var provider = services.BuildServiceProvider(); return provider; } @@ -60,11 +56,10 @@ public virtual void Configure( context.Database.EnsureCreated(); loggerFactory.AddConsole(Config.GetSection("Logging")); - loggerFactory.AddDebug(); app.UseJsonApi(); } public string GetDbConnectionString() => Config["Data:DefaultConnection"]; } -} \ No newline at end of file +} diff --git a/src/Examples/JsonApiDotNetCoreExample/appsettings.json b/src/Examples/JsonApiDotNetCoreExample/appsettings.json index ceb4a1ed73..c468439079 100755 --- a/src/Examples/JsonApiDotNetCoreExample/appsettings.json +++ b/src/Examples/JsonApiDotNetCoreExample/appsettings.json @@ -1,14 +1,13 @@ { - "Data": { - "DefaultConnection": - "Host=localhost;Port=5432;Database=JsonApiDotNetCoreExample;User ID=postgres;Password=password" - }, - "Logging": { - "IncludeScopes": false, - "LogLevel": { - "Default": "Trace", - "System": "Trace", - "Microsoft": "Trace" + "Data": { + "DefaultConnection": "Host=localhost;Port=5432;Database=JsonApiDotNetCoreExample;User ID=postgres;Password=postgres" + }, + "Logging": { + "IncludeScopes": false, + "LogLevel": { + "Default": "Warning", + "System": "Warning", + "Microsoft": "Warning" + } } - } } diff --git a/src/Examples/NoEntityFrameworkExample/NoEntityFrameworkExample.csproj b/src/Examples/NoEntityFrameworkExample/NoEntityFrameworkExample.csproj index afaf0e7cff..efdaa68e5b 100755 --- a/src/Examples/NoEntityFrameworkExample/NoEntityFrameworkExample.csproj +++ b/src/Examples/NoEntityFrameworkExample/NoEntityFrameworkExample.csproj @@ -1,5 +1,4 @@  - $(NetCoreAppVersion) @@ -19,7 +18,7 @@ - + diff --git a/src/Examples/NoEntityFrameworkExample/Program.cs b/src/Examples/NoEntityFrameworkExample/Program.cs index 5606e8e9f4..76f3020c52 100755 --- a/src/Examples/NoEntityFrameworkExample/Program.cs +++ b/src/Examples/NoEntityFrameworkExample/Program.cs @@ -1,4 +1,4 @@ -using System.IO; +using Microsoft.AspNetCore; using Microsoft.AspNetCore.Hosting; namespace NoEntityFrameworkExample @@ -7,14 +7,12 @@ public class Program { public static void Main(string[] args) { - var host = new WebHostBuilder() - .UseKestrel() - .UseContentRoot(Directory.GetCurrentDirectory()) - .UseIISIntegration() + BuildWebHost(args).Run(); + } + + public static IWebHost BuildWebHost(string[] args) => + WebHost.CreateDefaultBuilder(args) .UseStartup() .Build(); - - host.Run(); - } } } diff --git a/src/Examples/NoEntityFrameworkExample/Startup.cs b/src/Examples/NoEntityFrameworkExample/Startup.cs index fdea4fc582..711b54cfa3 100755 --- a/src/Examples/NoEntityFrameworkExample/Startup.cs +++ b/src/Examples/NoEntityFrameworkExample/Startup.cs @@ -1,4 +1,4 @@ -using JsonApiDotNetCore.Extensions; +using JsonApiDotNetCore.Extensions; using JsonApiDotNetCore.Services; using JsonApiDotNetCoreExample.Data; using JsonApiDotNetCoreExample.Models; @@ -9,6 +9,7 @@ using Microsoft.Extensions.Logging; using NoEntityFrameworkExample.Services; using Microsoft.EntityFrameworkCore; +using System; namespace NoEntityFrameworkExample { @@ -18,7 +19,7 @@ public Startup(IHostingEnvironment env) { var builder = new ConfigurationBuilder() .SetBasePath(env.ContentRootPath) - .AddJsonFile("appsettings.json", optional: false, reloadOnChange: true) + .AddJsonFile("appsettings.json", optional: false, reloadOnChange: false) .AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true) .AddEnvironmentVariables(); Configuration = builder.Build(); @@ -27,10 +28,10 @@ public Startup(IHostingEnvironment env) public IConfigurationRoot Configuration { get; } // This method gets called by the runtime. Use this method to add services to the container. - public void ConfigureServices(IServiceCollection services) + public virtual IServiceProvider ConfigureServices(IServiceCollection services) { // Add framework services. - var mvcBuilder = services.AddMvc(); + var mvcBuilder = services.AddMvcCore(); services.AddJsonApi(options => { options.Namespace = "api/v1"; @@ -46,13 +47,14 @@ public void ConfigureServices(IServiceCollection services) services.AddSingleton(Configuration); services.AddSingleton>(optionsBuilder.Options); services.AddScoped(); + + return services.BuildServiceProvider(); } // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory, AppDbContext context) { loggerFactory.AddConsole(Configuration.GetSection("Logging")); - loggerFactory.AddDebug(); context.Database.EnsureCreated(); diff --git a/src/Examples/OperationsExample/.gitignore b/src/Examples/OperationsExample/.gitignore new file mode 100644 index 0000000000..0f552f400b --- /dev/null +++ b/src/Examples/OperationsExample/.gitignore @@ -0,0 +1,236 @@ +_data/ + +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. + +# User-specific files +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +build/ +bld/ +[Bb]in/ +[Oo]bj/ + +# Visual Studio 2015 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUNIT +*.VisualState.xml +TestResult.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# DNX +project.lock.json +artifacts/ + +*_i.c +*_p.c +*_i.h +*.ilk +*.meta +*.obj +*.pch +*.pdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# JustCode is a .NET coding add-in +.JustCode + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# TODO: Comment the next line if you want to checkin your web deploy settings +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# NuGet Packages +*.nupkg +# The packages folder can be ignored because of Package Restore +**/packages/* +# except build/, which is used as an MSBuild target. +!**/packages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/packages/repositories.config + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Microsoft Azure ApplicationInsights config file +ApplicationInsights.config + +# Windows Store app package directory +AppPackages/ +BundleArtifacts/ + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.pfx +*.publishsettings +node_modules/ +orleans.codegen.cs + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm + +# SQL Server files +*.mdf +*.ldf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe + +# FAKE - F# Make +.fake/ diff --git a/src/Examples/OperationsExample/Controllers/OperationsController.cs b/src/Examples/OperationsExample/Controllers/OperationsController.cs new file mode 100644 index 0000000000..6e56791f9c --- /dev/null +++ b/src/Examples/OperationsExample/Controllers/OperationsController.cs @@ -0,0 +1,14 @@ +using JsonApiDotNetCore.Controllers; +using JsonApiDotNetCore.Services.Operations; +using Microsoft.AspNetCore.Mvc; + +namespace OperationsExample.Controllers +{ + [Route("api/bulk")] + public class OperationsController : JsonApiOperationsController + { + public OperationsController(IOperationsProcessor processor) + : base(processor) + { } + } +} diff --git a/src/Examples/OperationsExample/OperationsExample.csproj b/src/Examples/OperationsExample/OperationsExample.csproj new file mode 100644 index 0000000000..efb3f2b3d4 --- /dev/null +++ b/src/Examples/OperationsExample/OperationsExample.csproj @@ -0,0 +1,30 @@ + + + $(NetCoreAppVersion) + true + OperationsExample + Exe + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Examples/OperationsExample/Program.cs b/src/Examples/OperationsExample/Program.cs new file mode 100644 index 0000000000..1c2b6b267a --- /dev/null +++ b/src/Examples/OperationsExample/Program.cs @@ -0,0 +1,15 @@ +using Microsoft.AspNetCore; +using Microsoft.AspNetCore.Hosting; + +namespace OperationsExample +{ + public class Program + { + public static void Main(string[] args) => BuildWebHost(args).Run(); + + public static IWebHost BuildWebHost(string[] args) => + WebHost.CreateDefaultBuilder(args) + .UseStartup() + .Build(); + } +} diff --git a/src/Examples/OperationsExample/Properties/launchSettings.json b/src/Examples/OperationsExample/Properties/launchSettings.json new file mode 100644 index 0000000000..b0d8e5bd4b --- /dev/null +++ b/src/Examples/OperationsExample/Properties/launchSettings.json @@ -0,0 +1,27 @@ +{ + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:53656/", + "sslPort": 0 + } + }, + "profiles": { + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "OperationsExample": { + "commandName": "Project", + "launchBrowser": true, + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + }, + "applicationUrl": "http://localhost:53657/" + } + } +} \ No newline at end of file diff --git a/src/Examples/OperationsExample/Startup.cs b/src/Examples/OperationsExample/Startup.cs new file mode 100644 index 0000000000..a889ad85d6 --- /dev/null +++ b/src/Examples/OperationsExample/Startup.cs @@ -0,0 +1,55 @@ +using System; +using JsonApiDotNetCore.Extensions; +using JsonApiDotNetCoreExample.Data; +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Hosting; +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Logging; + +namespace OperationsExample +{ + public class Startup + { + public readonly IConfiguration Config; + + public Startup(IHostingEnvironment env) + { + var builder = new ConfigurationBuilder() + .SetBasePath(env.ContentRootPath) + .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true) + .AddEnvironmentVariables(); + + Config = builder.Build(); + } + + public virtual IServiceProvider ConfigureServices(IServiceCollection services) + { + var loggerFactory = new LoggerFactory(); + loggerFactory.AddConsole(LogLevel.Warning); + + services.AddSingleton(loggerFactory); + + services.AddDbContext(options => options.UseNpgsql(GetDbConnectionString()), ServiceLifetime.Scoped); + + services.AddJsonApi(opt => opt.EnableOperations = true); + + return services.BuildServiceProvider(); + } + + public virtual void Configure( + IApplicationBuilder app, + IHostingEnvironment env, + ILoggerFactory loggerFactory, + AppDbContext context) + { + context.Database.EnsureCreated(); + + loggerFactory.AddConsole(Config.GetSection("Logging")); + app.UseJsonApi(); + } + + public string GetDbConnectionString() => Config["Data:DefaultConnection"]; + } +} diff --git a/src/Examples/OperationsExample/appsettings.json b/src/Examples/OperationsExample/appsettings.json new file mode 100644 index 0000000000..73030b1743 --- /dev/null +++ b/src/Examples/OperationsExample/appsettings.json @@ -0,0 +1,13 @@ +{ + "Data": { + "DefaultConnection": "Host=localhost;Port=5432;Database=JsonApiDotNetCoreExample;User ID=postgres;Password=postgres" + }, + "Logging": { + "IncludeScopes": false, + "LogLevel": { + "Default": "Warning", + "System": "Warning", + "Microsoft": "Warning" + } + } +} diff --git a/src/Examples/ReportsExample/Controllers/ReportsController.cs b/src/Examples/ReportsExample/Controllers/ReportsController.cs index 523ad417bd..6f431d9291 100644 --- a/src/Examples/ReportsExample/Controllers/ReportsController.cs +++ b/src/Examples/ReportsExample/Controllers/ReportsController.cs @@ -1,7 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; +using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; using JsonApiDotNetCore.Controllers; using JsonApiDotNetCore.Services; diff --git a/src/Examples/ReportsExample/Program.cs b/src/Examples/ReportsExample/Program.cs index 41d4c37780..f3ce6c81b0 100644 --- a/src/Examples/ReportsExample/Program.cs +++ b/src/Examples/ReportsExample/Program.cs @@ -1,4 +1,4 @@ -using System.IO; +using Microsoft.AspNetCore; using Microsoft.AspNetCore.Hosting; namespace ReportsExample @@ -7,14 +7,12 @@ public class Program { public static void Main(string[] args) { - var host = new WebHostBuilder() - .UseKestrel() - .UseContentRoot(Directory.GetCurrentDirectory()) - .UseIISIntegration() + BuildWebHost(args).Run(); + } + + public static IWebHost BuildWebHost(string[] args) => + WebHost.CreateDefaultBuilder(args) .UseStartup() .Build(); - - host.Run(); - } } } diff --git a/src/Examples/ReportsExample/ReportsExample.csproj b/src/Examples/ReportsExample/ReportsExample.csproj index 2131c545a4..24c01b9a8d 100644 --- a/src/Examples/ReportsExample/ReportsExample.csproj +++ b/src/Examples/ReportsExample/ReportsExample.csproj @@ -1,24 +1,23 @@ - - - - $(NetCoreAppVersion) - - - - - - - - - - - - - - - - - - - - + + + $(NetCoreAppVersion) + + + + + + + + + + + + + + + + + + + + diff --git a/src/Examples/ReportsExample/Services/ReportService.cs b/src/Examples/ReportsExample/Services/ReportService.cs index 7baffc6174..9e5348a612 100644 --- a/src/Examples/ReportsExample/Services/ReportService.cs +++ b/src/Examples/ReportsExample/Services/ReportService.cs @@ -1,4 +1,3 @@ -using System; using System.Collections.Generic; using System.Threading.Tasks; using JsonApiDotNetCore.Services; diff --git a/src/Examples/ReportsExample/Startup.cs b/src/Examples/ReportsExample/Startup.cs index 39d740da84..43a910a0e6 100644 --- a/src/Examples/ReportsExample/Startup.cs +++ b/src/Examples/ReportsExample/Startup.cs @@ -1,15 +1,9 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; using JsonApiDotNetCore.Extensions; -using JsonApiDotNetCore.Services; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; -using Microsoft.Extensions.Options; namespace ReportsExample { @@ -21,25 +15,20 @@ public Startup(IHostingEnvironment env) { var builder = new ConfigurationBuilder() .SetBasePath(env.ContentRootPath) - .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true) + .AddJsonFile("appsettings.json", optional: true, reloadOnChange: false) .AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true) .AddEnvironmentVariables(); Config = builder.Build(); } - public void ConfigureServices(IServiceCollection services) + public virtual void ConfigureServices(IServiceCollection services) { - var mvcBuilder = services.AddMvc(); - services.AddJsonApi(opt => - { - opt.BuildContextGraph(builder => { - builder.AddResource("reports"); - }); - opt.Namespace = "api"; - }, mvcBuilder); - - services.AddScoped, ReportService>(); + var mvcBuilder = services.AddMvcCore(); + services.AddJsonApi( + opt => opt.Namespace = "api", + mvcBuilder, + discovery => discovery.AddCurrentAssemblyServices()); } public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) diff --git a/src/Examples/ReportsExample/appsettings.json b/src/Examples/ReportsExample/appsettings.json index 125f7a4ae9..5766595e6d 100644 --- a/src/Examples/ReportsExample/appsettings.json +++ b/src/Examples/ReportsExample/appsettings.json @@ -2,7 +2,7 @@ "Logging": { "IncludeScopes": false, "LogLevel": { - "Default": "Information" + "Default": "Warning" } } } diff --git a/src/JsonApiDotNetCore/AssemblyInfo.cs b/src/JsonApiDotNetCore/AssemblyInfo.cs new file mode 100644 index 0000000000..47e8eee668 --- /dev/null +++ b/src/JsonApiDotNetCore/AssemblyInfo.cs @@ -0,0 +1,6 @@ +using System.Runtime.CompilerServices; +[assembly: InternalsVisibleTo("OperationsExampleTests")] +[assembly:InternalsVisibleTo("UnitTests")] +[assembly:InternalsVisibleTo("JsonApiDotNetCoreExampleTests")] +[assembly:InternalsVisibleTo("NoEntityFrameworkTests")] +[assembly:InternalsVisibleTo("Benchmarks")] \ No newline at end of file diff --git a/src/JsonApiDotNetCore/Builders/ContextGraphBuilder.cs b/src/JsonApiDotNetCore/Builders/ContextGraphBuilder.cs index e47dec2065..ba71dbce06 100644 --- a/src/JsonApiDotNetCore/Builders/ContextGraphBuilder.cs +++ b/src/JsonApiDotNetCore/Builders/ContextGraphBuilder.cs @@ -1,18 +1,73 @@ using System; using System.Collections.Generic; +using System.Linq; using System.Reflection; -using Microsoft.EntityFrameworkCore; +using JsonApiDotNetCore.Extensions; +using JsonApiDotNetCore.Graph; using JsonApiDotNetCore.Internal; using JsonApiDotNetCore.Models; -using JsonApiDotNetCore.Extensions; -using System.Linq; +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.Logging; namespace JsonApiDotNetCore.Builders { + public interface IContextGraphBuilder + { + /// + /// Construct the + /// + IContextGraph Build(); + + /// + /// Add a json:api resource + /// + /// The resource model type + /// The pluralized name that should be exposed by the API + IContextGraphBuilder AddResource(string pluralizedTypeName) where TResource : class, IIdentifiable; + + /// + /// Add a json:api resource + /// + /// The resource model type + /// The resource model identifier type + /// The pluralized name that should be exposed by the API + IContextGraphBuilder AddResource(string pluralizedTypeName) where TResource : class, IIdentifiable; + + /// + /// Add a json:api resource + /// + /// The resource model type + /// The resource model identifier type + /// The pluralized name that should be exposed by the API + IContextGraphBuilder AddResource(Type entityType, Type idType, string pluralizedTypeName); + + /// + /// Add all the models that are part of the provided + /// that also implement + /// + /// The implementation type. + IContextGraphBuilder AddDbContext() where T : DbContext; + + /// + /// Specify the used to format resource names. + /// + /// Formatter used to define exposed resource names by convention. + IContextGraphBuilder UseNameFormatter(IResourceNameFormatter resourceNameFormatter); + + /// + /// Which links to include. Defaults to . + /// + Link DocumentLinks { get; set; } + } + public class ContextGraphBuilder : IContextGraphBuilder { private List _entities = new List(); + private List _validationResults = new List(); + private bool _usesDbContext; + private IResourceNameFormatter _resourceNameFormatter = new DefaultResourceNameFormatter(); + public Link DocumentLinks { get; set; } = Link.All; public IContextGraph Build() @@ -20,29 +75,38 @@ public IContextGraph Build() // this must be done at build so that call order doesn't matter _entities.ForEach(e => e.Links = GetLinkFlags(e.EntityType)); - var graph = new ContextGraph() - { - Entities = _entities, - UsesDbContext = _usesDbContext - }; + var graph = new ContextGraph(_entities, _usesDbContext, _validationResults); return graph; } - public void AddResource(string pluralizedTypeName) where TResource : class + /// + public IContextGraphBuilder AddResource(string pluralizedTypeName) where TResource : class, IIdentifiable + => AddResource(pluralizedTypeName); + + /// + public IContextGraphBuilder AddResource(string pluralizedTypeName) where TResource : class, IIdentifiable + => AddResource(typeof(TResource), typeof(TId), pluralizedTypeName); + + /// + public IContextGraphBuilder AddResource(Type entityType, Type idType, string pluralizedTypeName) { - var entityType = typeof(TResource); + AssertEntityIsNotAlreadyDefined(entityType); - VerifyEntityIsNotAlreadyDefined(entityType); + _entities.Add(GetEntity(pluralizedTypeName, entityType, idType)); - _entities.Add(new ContextEntity - { - EntityName = pluralizedTypeName, - EntityType = entityType, - Attributes = GetAttributes(entityType), - Relationships = GetRelationships(entityType) - }); + return this; } + private ContextEntity GetEntity(string pluralizedTypeName, Type entityType, Type idType) => new ContextEntity + { + EntityName = pluralizedTypeName, + EntityType = entityType, + IdentityType = idType, + Attributes = GetAttributes(entityType), + Relationships = GetRelationships(entityType), + ResourceType = GetResourceDefinitionType(entityType) + }; + private Link GetLinkFlags(Type entityType) { var attribute = (LinksAttribute)entityType.GetTypeInfo().GetCustomAttribute(typeof(LinksAttribute)); @@ -61,8 +125,12 @@ protected virtual List GetAttributes(Type entityType) foreach (var prop in properties) { var attribute = (AttrAttribute)prop.GetCustomAttribute(typeof(AttrAttribute)); - if (attribute == null) continue; + if (attribute == null) + continue; + attribute.InternalAttributeName = prop.Name; + attribute.PropertyInfo = prop; + attributes.Add(attribute); } return attributes; @@ -93,7 +161,10 @@ protected virtual Type GetRelationshipType(RelationshipAttribute relation, Prope return prop.PropertyType; } - public void AddDbContext() where T : DbContext + private Type GetResourceDefinitionType(Type entityType) => typeof(ResourceDefinition<>).MakeGenericType(entityType); + + /// + public IContextGraphBuilder AddDbContext() where T : DbContext { _usesDbContext = true; @@ -110,32 +181,60 @@ public void AddDbContext() where T : DbContext { var entityType = dbSetType.GetGenericArguments()[0]; - VerifyEntityIsNotAlreadyDefined(entityType); + AssertEntityIsNotAlreadyDefined(entityType); - _entities.Add(new ContextEntity - { - EntityName = GetResourceName(property), - EntityType = entityType, - Attributes = GetAttributes(entityType), - Relationships = GetRelationships(entityType) - }); + var (isJsonApiResource, idType) = GetIdType(entityType); + + if (isJsonApiResource) + _entities.Add(GetEntity(GetResourceNameFromDbSetProperty(property, entityType), entityType, idType)); } } + + return this; } - private string GetResourceName(PropertyInfo property) + private string GetResourceNameFromDbSetProperty(PropertyInfo property, Type resourceType) { - var resourceAttribute = property.GetCustomAttribute(typeof(ResourceAttribute)); - if (resourceAttribute == null) - return property.Name.Dasherize(); + // this check is actually duplicated in the DefaultResourceNameFormatter + // however, we perform it here so that we allow class attributes to be prioritized over + // the DbSet attribute. Eventually, the DbSet attribute should be deprecated. + // + // check the class definition first + // [Resource("models"] public class Model : Identifiable { /* ... */ } + if (resourceType.GetCustomAttribute(typeof(ResourceAttribute)) is ResourceAttribute classResourceAttribute) + return classResourceAttribute.ResourceName; + + // check the DbContext member next + // [Resource("models")] public DbSet Models { get; set; } + if (property.GetCustomAttribute(typeof(ResourceAttribute)) is ResourceAttribute resourceAttribute) + return resourceAttribute.ResourceName; + + // fallback to dsherized...this should actually check for a custom IResourceNameFormatter + return _resourceNameFormatter.FormatResourceName(resourceType); + } + + private (bool isJsonApiResource, Type idType) GetIdType(Type resourceType) + { + var possible = TypeLocator.GetIdType(resourceType); + if (possible.isJsonApiResource) + return possible; + + _validationResults.Add(new ValidationResult(LogLevel.Warning, $"{resourceType} does not implement 'IIdentifiable<>'. ")); - return ((ResourceAttribute)resourceAttribute).ResourceName; + return (false, null); } - private void VerifyEntityIsNotAlreadyDefined(Type entityType) + private void AssertEntityIsNotAlreadyDefined(Type entityType) { if (_entities.Any(e => e.EntityType == entityType)) throw new InvalidOperationException($"Cannot add entity type {entityType} to context graph, there is already an entity of that type configured."); } + + /// + public IContextGraphBuilder UseNameFormatter(IResourceNameFormatter resourceNameFormatter) + { + _resourceNameFormatter = resourceNameFormatter; + return this; + } } } diff --git a/src/JsonApiDotNetCore/Builders/DocumentBuilder.cs b/src/JsonApiDotNetCore/Builders/DocumentBuilder.cs index d8d38390d8..c6f5f999b4 100644 --- a/src/JsonApiDotNetCore/Builders/DocumentBuilder.cs +++ b/src/JsonApiDotNetCore/Builders/DocumentBuilder.cs @@ -1,6 +1,8 @@ +using System; using System.Collections; using System.Collections.Generic; using System.Linq; +using JsonApiDotNetCore.Extensions; using JsonApiDotNetCore.Internal; using JsonApiDotNetCore.Models; using JsonApiDotNetCore.Services; @@ -12,31 +14,34 @@ public class DocumentBuilder : IDocumentBuilder private readonly IJsonApiContext _jsonApiContext; private readonly IContextGraph _contextGraph; private readonly IRequestMeta _requestMeta; - - public DocumentBuilder(IJsonApiContext jsonApiContext) - { - _jsonApiContext = jsonApiContext; - _contextGraph = jsonApiContext.ContextGraph; - } - - public DocumentBuilder(IJsonApiContext jsonApiContext, IRequestMeta requestMeta) + private readonly DocumentBuilderOptions _documentBuilderOptions; + private readonly IScopedServiceProvider _scopedServiceProvider; + + public DocumentBuilder( + IJsonApiContext jsonApiContext, + IRequestMeta requestMeta = null, + IDocumentBuilderOptionsProvider documentBuilderOptionsProvider = null, + IScopedServiceProvider scopedServiceProvider = null) { _jsonApiContext = jsonApiContext; _contextGraph = jsonApiContext.ContextGraph; _requestMeta = requestMeta; + _documentBuilderOptions = documentBuilderOptionsProvider?.GetDocumentBuilderOptions() ?? new DocumentBuilderOptions(); + _scopedServiceProvider = scopedServiceProvider; } public Document Build(IIdentifiable entity) { var contextEntity = _contextGraph.GetContextEntity(entity.GetType()); + var resourceDefinition = _scopedServiceProvider?.GetService(contextEntity.ResourceType) as IResourceDefinition; var document = new Document { - Data = GetData(contextEntity, entity), + Data = GetData(contextEntity, entity, resourceDefinition), Meta = GetMeta(entity) }; - if(ShouldIncludePageLinks(contextEntity)) + if (ShouldIncludePageLinks(contextEntity)) document.Links = _jsonApiContext.PageManager.GetPageLinks(new LinkBuilder(_jsonApiContext)); document.Included = AppendIncludedObject(document.Included, contextEntity, entity); @@ -46,11 +51,9 @@ public Document Build(IIdentifiable entity) public Documents Build(IEnumerable entities) { - var entityType = entities - .GetType() - .GenericTypeArguments[0]; - + var entityType = entities.GetElementType(); var contextEntity = _contextGraph.GetContextEntity(entityType); + var resourceDefinition = _scopedServiceProvider?.GetService(contextEntity.ResourceType) as IResourceDefinition; var enumeratedEntities = entities as IList ?? entities.ToList(); var documents = new Documents @@ -59,12 +62,12 @@ public Documents Build(IEnumerable entities) Meta = GetMeta(enumeratedEntities.FirstOrDefault()) }; - if(ShouldIncludePageLinks(contextEntity)) + if (ShouldIncludePageLinks(contextEntity)) documents.Links = _jsonApiContext.PageManager.GetPageLinks(new LinkBuilder(_jsonApiContext)); foreach (var entity in enumeratedEntities) { - documents.Data.Add(GetData(contextEntity, entity)); + documents.Data.Add(GetData(contextEntity, entity, resourceDefinition)); documents.Included = AppendIncludedObject(documents.Included, contextEntity, entity); } @@ -73,21 +76,20 @@ public Documents Build(IEnumerable entities) private Dictionary GetMeta(IIdentifiable entity) { - if (entity == null) return null; - var builder = _jsonApiContext.MetaBuilder; - - if(entity is IHasMeta metaEntity) - builder.Add(metaEntity.GetMeta(_jsonApiContext)); - - if(_jsonApiContext.Options.IncludeTotalRecordCount) + if (_jsonApiContext.Options.IncludeTotalRecordCount && _jsonApiContext.PageManager.TotalRecords != null) builder.Add("total-records", _jsonApiContext.PageManager.TotalRecords); - - if(_requestMeta != null) + + if (_requestMeta != null) builder.Add(_requestMeta.GetMeta()); + if (entity != null && entity is IHasMeta metaEntity) + builder.Add(metaEntity.GetMeta(_jsonApiContext)); + var meta = builder.Build(); - if(meta.Count > 0) return meta; + if (meta.Count > 0) + return meta; + return null; } @@ -104,7 +106,11 @@ private List AppendIncludedObject(List includedObjec return includedObject; } - private DocumentData GetData(ContextEntity contextEntity, IIdentifiable entity) + [Obsolete("You should specify an IResourceDefinition implementation using the GetData/3 overload.")] + public DocumentData GetData(ContextEntity contextEntity, IIdentifiable entity) + => GetData(contextEntity, entity, resourceDefinition: null); + + public DocumentData GetData(ContextEntity contextEntity, IIdentifiable entity, IResourceDefinition resourceDefinition = null) { var data = new DocumentData { @@ -112,15 +118,19 @@ private DocumentData GetData(ContextEntity contextEntity, IIdentifiable entity) Id = entity.StringId }; - if (_jsonApiContext.IsRelationshipData) + if (_jsonApiContext.IsRelationshipPath) return data; data.Attributes = new Dictionary(); - contextEntity.Attributes.ForEach(attr => + var resourceAttributes = resourceDefinition?.GetOutputAttrs(entity) ?? contextEntity.Attributes; + resourceAttributes.ForEach(attr => { - if(ShouldIncludeAttribute(attr)) - data.Attributes.Add(attr.PublicAttributeName, attr.GetValue(entity)); + var attributeValue = attr.GetValue(entity); + if (ShouldIncludeAttribute(attr, attributeValue)) + { + data.Attributes.Add(attr.PublicAttributeName, attributeValue); + } }); if (contextEntity.Relationships.Count > 0) @@ -129,47 +139,58 @@ private DocumentData GetData(ContextEntity contextEntity, IIdentifiable entity) return data; } - private bool ShouldIncludeAttribute(AttrAttribute attr) + private bool ShouldIncludeAttribute(AttrAttribute attr, object attributeValue) { - return (_jsonApiContext.QuerySet == null - || _jsonApiContext.QuerySet.Fields.Count == 0 - || _jsonApiContext.QuerySet.Fields.Contains(attr.InternalAttributeName)); + return OmitNullValuedAttribute(attr, attributeValue) == false + && ((_jsonApiContext.QuerySet == null + || _jsonApiContext.QuerySet.Fields.Count == 0) + || _jsonApiContext.QuerySet.Fields.Contains(attr.InternalAttributeName)); + } + + private bool OmitNullValuedAttribute(AttrAttribute attr, object attributeValue) + { + return attributeValue == null && _documentBuilderOptions.OmitNullValuedAttributes; } private void AddRelationships(DocumentData data, ContextEntity contextEntity, IIdentifiable entity) { data.Relationships = new Dictionary(); + contextEntity.Relationships.ForEach(r => + data.Relationships.Add( + r.PublicRelationshipName, + GetRelationshipData(r, contextEntity, entity) + ) + ); + } + + private RelationshipData GetRelationshipData(RelationshipAttribute attr, ContextEntity contextEntity, IIdentifiable entity) + { var linkBuilder = new LinkBuilder(_jsonApiContext); - contextEntity.Relationships.ForEach(r => - { - var relationshipData = new RelationshipData(); + var relationshipData = new RelationshipData(); - if(r.DocumentLinks.HasFlag(Link.None) == false) - { - relationshipData.Links = new Links(); - if(r.DocumentLinks.HasFlag(Link.Self)) - relationshipData.Links.Self = linkBuilder.GetSelfRelationLink(contextEntity.EntityName, entity.StringId, r.PublicRelationshipName); - - if(r.DocumentLinks.HasFlag(Link.Related)) - relationshipData.Links.Related = linkBuilder.GetRelatedRelationLink(contextEntity.EntityName, entity.StringId, r.PublicRelationshipName); - } + if (attr.DocumentLinks.HasFlag(Link.None) == false) + { + relationshipData.Links = new Links(); + if (attr.DocumentLinks.HasFlag(Link.Self)) + relationshipData.Links.Self = linkBuilder.GetSelfRelationLink(contextEntity.EntityName, entity.StringId, attr.PublicRelationshipName); - if (RelationshipIsIncluded(r.PublicRelationshipName)) - { - var navigationEntity = _jsonApiContext.ContextGraph - .GetRelationship(entity, r.InternalRelationshipName); - - if(navigationEntity == null) - relationshipData.SingleData = null; - else if (navigationEntity is IEnumerable) - relationshipData.ManyData = GetRelationships((IEnumerable)navigationEntity); - else - relationshipData.SingleData = GetRelationship(navigationEntity); - } + if (attr.DocumentLinks.HasFlag(Link.Related)) + relationshipData.Links.Related = linkBuilder.GetRelatedRelationLink(contextEntity.EntityName, entity.StringId, attr.PublicRelationshipName); + } - data.Relationships.Add(r.PublicRelationshipName, relationshipData); - }); + // this only includes the navigation property, we need to actually check the navigation property Id + var navigationEntity = _jsonApiContext.ContextGraph.GetRelationship(entity, attr.InternalRelationshipName); + if (navigationEntity == null) + relationshipData.SingleData = attr.IsHasOne + ? GetIndependentRelationshipIdentifier((HasOneAttribute)attr, entity) + : null; + else if (navigationEntity is IEnumerable) + relationshipData.ManyData = GetRelationships((IEnumerable)navigationEntity); + else + relationshipData.SingleData = GetRelationship(navigationEntity); + + return relationshipData; } private List GetIncludedEntities(List included, ContextEntity contextEntity, IIdentifiable entity) @@ -194,22 +215,26 @@ private List AddIncludedEntity(List entities, IIdent { var includedEntity = GetIncludedEntity(entity); - if(entities == null) + if (entities == null) entities = new List(); - if(includedEntity != null && !entities.Any(doc => doc.Id == includedEntity.Id && doc.Type == includedEntity.Type)) + if (includedEntity != null && entities.Any(doc => + string.Equals(doc.Id, includedEntity.Id) && string.Equals(doc.Type, includedEntity.Type)) == false) + { entities.Add(includedEntity); + } return entities; } private DocumentData GetIncludedEntity(IIdentifiable entity) { - if(entity == null) return null; - + if (entity == null) return null; + var contextEntity = _jsonApiContext.ContextGraph.GetContextEntity(entity.GetType()); + var resourceDefinition = _scopedServiceProvider.GetService(contextEntity.ResourceType) as IResourceDefinition; - var data = GetData(contextEntity, entity); + var data = GetData(contextEntity, entity, resourceDefinition); data.Attributes = new Dictionary(); @@ -227,32 +252,54 @@ private bool RelationshipIsIncluded(string relationshipName) _jsonApiContext.IncludedRelationships.Contains(relationshipName); } - private List> GetRelationships(IEnumerable entities) + private List GetRelationships(IEnumerable entities) { - var objType = entities.GetType().GenericTypeArguments[0]; + var objType = entities.GetElementType(); var typeName = _jsonApiContext.ContextGraph.GetContextEntity(objType); - var relationships = new List>(); + var relationships = new List(); foreach (var entity in entities) { - relationships.Add(new Dictionary { - {"type", typeName.EntityName }, - {"id", ((IIdentifiable)entity).StringId } + relationships.Add(new ResourceIdentifierObject + { + Type = typeName.EntityName, + Id = ((IIdentifiable)entity).StringId }); } return relationships; } - private Dictionary GetRelationship(object entity) + + private ResourceIdentifierObject GetRelationship(object entity) { var objType = entity.GetType(); + var contextEntity = _jsonApiContext.ContextGraph.GetContextEntity(objType); - var typeName = _jsonApiContext.ContextGraph.GetContextEntity(objType); - - return new Dictionary { - {"type", typeName.EntityName }, - {"id", ((IIdentifiable)entity).StringId } + if(entity is IIdentifiable identifiableEntity) + return new ResourceIdentifierObject + { + Type = contextEntity.EntityName, + Id = identifiableEntity.StringId }; + + return null; + } + + private ResourceIdentifierObject GetIndependentRelationshipIdentifier(HasOneAttribute hasOne, IIdentifiable entity) + { + var independentRelationshipIdentifier = hasOne.GetIdentifiablePropertyValue(entity); + if (independentRelationshipIdentifier == null) + return null; + + var relatedContextEntity = _jsonApiContext.ContextGraph.GetContextEntity(hasOne.Type); + if (relatedContextEntity == null) // TODO: this should probably be a debug log at minimum + return null; + + return new ResourceIdentifierObject + { + Type = relatedContextEntity.EntityName, + Id = independentRelationshipIdentifier.ToString() + }; } } } diff --git a/src/JsonApiDotNetCore/Builders/DocumentBuilderOptions.cs b/src/JsonApiDotNetCore/Builders/DocumentBuilderOptions.cs new file mode 100644 index 0000000000..0596d8ce3c --- /dev/null +++ b/src/JsonApiDotNetCore/Builders/DocumentBuilderOptions.cs @@ -0,0 +1,12 @@ +namespace JsonApiDotNetCore.Builders +{ + public struct DocumentBuilderOptions + { + public DocumentBuilderOptions(bool omitNullValuedAttributes = false) + { + this.OmitNullValuedAttributes = omitNullValuedAttributes; + } + + public bool OmitNullValuedAttributes { get; private set; } + } +} diff --git a/src/JsonApiDotNetCore/Builders/DocumentBuilderOptionsProvider.cs b/src/JsonApiDotNetCore/Builders/DocumentBuilderOptionsProvider.cs new file mode 100644 index 0000000000..37c5d51273 --- /dev/null +++ b/src/JsonApiDotNetCore/Builders/DocumentBuilderOptionsProvider.cs @@ -0,0 +1,30 @@ +using JsonApiDotNetCore.Services; +using Microsoft.AspNetCore.Http; + +namespace JsonApiDotNetCore.Builders +{ + public class DocumentBuilderOptionsProvider : IDocumentBuilderOptionsProvider + { + private readonly IJsonApiContext _jsonApiContext; + private readonly IHttpContextAccessor _httpContextAccessor; + + public DocumentBuilderOptionsProvider(IJsonApiContext jsonApiContext, IHttpContextAccessor httpContextAccessor) + { + _jsonApiContext = jsonApiContext; + _httpContextAccessor = httpContextAccessor; + } + + public DocumentBuilderOptions GetDocumentBuilderOptions() + { + var nullAttributeResponseBehaviorConfig = this._jsonApiContext.Options.NullAttributeResponseBehavior; + if (nullAttributeResponseBehaviorConfig.AllowClientOverride && _httpContextAccessor.HttpContext.Request.Query.TryGetValue("omitNullValuedAttributes", out var omitNullValuedAttributesQs)) + { + if (bool.TryParse(omitNullValuedAttributesQs, out var omitNullValuedAttributes)) + { + return new DocumentBuilderOptions(omitNullValuedAttributes); + } + } + return new DocumentBuilderOptions(this._jsonApiContext.Options.NullAttributeResponseBehavior.OmitNullValuedAttributes); + } + } +} diff --git a/src/JsonApiDotNetCore/Builders/IContextGraphBuilder.cs b/src/JsonApiDotNetCore/Builders/IContextGraphBuilder.cs deleted file mode 100644 index bab62cca64..0000000000 --- a/src/JsonApiDotNetCore/Builders/IContextGraphBuilder.cs +++ /dev/null @@ -1,14 +0,0 @@ -using JsonApiDotNetCore.Internal; -using JsonApiDotNetCore.Models; -using Microsoft.EntityFrameworkCore; - -namespace JsonApiDotNetCore.Builders -{ - public interface IContextGraphBuilder - { - Link DocumentLinks { get; set; } - IContextGraph Build(); - void AddResource(string pluralizedTypeName) where TResource : class; - void AddDbContext() where T : DbContext; - } -} diff --git a/src/JsonApiDotNetCore/Builders/IDocumentBuilder.cs b/src/JsonApiDotNetCore/Builders/IDocumentBuilder.cs index 8fe5c65ae9..dccd6f753a 100644 --- a/src/JsonApiDotNetCore/Builders/IDocumentBuilder.cs +++ b/src/JsonApiDotNetCore/Builders/IDocumentBuilder.cs @@ -1,4 +1,6 @@ +using System; using System.Collections.Generic; +using JsonApiDotNetCore.Internal; using JsonApiDotNetCore.Models; namespace JsonApiDotNetCore.Builders @@ -7,5 +9,9 @@ public interface IDocumentBuilder { Document Build(IIdentifiable entity); Documents Build(IEnumerable entities); + + [Obsolete("You should specify an IResourceDefinition implementation using the GetData/3 overload.")] + DocumentData GetData(ContextEntity contextEntity, IIdentifiable entity); + DocumentData GetData(ContextEntity contextEntity, IIdentifiable entity, IResourceDefinition resourceDefinition = null); } -} \ No newline at end of file +} diff --git a/src/JsonApiDotNetCore/Builders/IDocumentBuilderOptionsProvider.cs b/src/JsonApiDotNetCore/Builders/IDocumentBuilderOptionsProvider.cs new file mode 100644 index 0000000000..fe014bced5 --- /dev/null +++ b/src/JsonApiDotNetCore/Builders/IDocumentBuilderOptionsProvider.cs @@ -0,0 +1,7 @@ +namespace JsonApiDotNetCore.Builders +{ + public interface IDocumentBuilderOptionsProvider + { + DocumentBuilderOptions GetDocumentBuilderOptions(); + } +} diff --git a/src/JsonApiDotNetCore/Builders/LinkBuilder.cs b/src/JsonApiDotNetCore/Builders/LinkBuilder.cs index 83b77c169c..3de45558c4 100644 --- a/src/JsonApiDotNetCore/Builders/LinkBuilder.cs +++ b/src/JsonApiDotNetCore/Builders/LinkBuilder.cs @@ -1,3 +1,4 @@ +using System; using JsonApiDotNetCore.Services; using Microsoft.AspNetCore.Http; @@ -9,29 +10,46 @@ public class LinkBuilder public LinkBuilder(IJsonApiContext context) { - _context = context; + _context = context; } public string GetBasePath(HttpContext context, string entityName) { var r = context.Request; - return $"{r.Scheme}://{r.Host}{GetNamespaceFromPath(r.Path, entityName)}"; + return (_context.Options.RelativeLinks) + ? GetNamespaceFromPath(r.Path, entityName) + : $"{r.Scheme}://{r.Host}{GetNamespaceFromPath(r.Path, entityName)}"; } - private string GetNamespaceFromPath(string path, string entityName) + internal static string GetNamespaceFromPath(string path, string entityName) { - var nSpace = string.Empty; - var segments = path.Split('/'); - - for(var i = 1; i < segments.Length; i++) + var entityNameSpan = entityName.AsSpan(); + var pathSpan = path.AsSpan(); + const char delimiter = '/'; + for (var i = 0; i < pathSpan.Length; i++) { - if(segments[i].ToLower() == entityName) - break; + if(pathSpan[i].Equals(delimiter)) + { + var nextPosition = i + 1; + if(pathSpan.Length > i + entityNameSpan.Length) + { + var possiblePathSegment = pathSpan.Slice(nextPosition, entityNameSpan.Length); + if (entityNameSpan.SequenceEqual(possiblePathSegment)) + { + // check to see if it's the last position in the string + // or if the next character is a / + var lastCharacterPosition = nextPosition + entityNameSpan.Length; - nSpace += $"/{segments[i]}"; + if(lastCharacterPosition == pathSpan.Length || pathSpan.Length >= lastCharacterPosition + 2 && pathSpan[lastCharacterPosition].Equals(delimiter)) + { + return pathSpan.Slice(0, i).ToString(); + } + } + } + } } - - return nSpace; + + return string.Empty; } public string GetSelfRelationLink(string parent, string parentId, string child) @@ -46,7 +64,9 @@ public string GetRelatedRelationLink(string parent, string parentId, string chil public string GetPageLink(int pageOffset, int pageSize) { - return $"{_context.BasePath}/{_context.RequestEntity.EntityName}?page[size]={pageSize}&page[number]={pageOffset}"; + var filterQueryComposer = new QueryComposer(); + var filters = filterQueryComposer.Compose(_context); + return $"{_context.BasePath}/{_context.RequestEntity.EntityName}?page[size]={pageSize}&page[number]={pageOffset}{filters}"; } } } diff --git a/src/JsonApiDotNetCore/Configuration/JsonApiOptions.cs b/src/JsonApiDotNetCore/Configuration/JsonApiOptions.cs index d651845773..54fcf5afaf 100644 --- a/src/JsonApiDotNetCore/Configuration/JsonApiOptions.cs +++ b/src/JsonApiDotNetCore/Configuration/JsonApiOptions.cs @@ -1,24 +1,153 @@ using System; +using System.Collections.Generic; using JsonApiDotNetCore.Builders; using JsonApiDotNetCore.Internal; +using JsonApiDotNetCore.Models; using JsonApiDotNetCore.Serialization; using Microsoft.EntityFrameworkCore; +using Newtonsoft.Json; using Newtonsoft.Json.Serialization; namespace JsonApiDotNetCore.Configuration { + /// + /// Global options. + /// https://json-api-dotnet.github.io/#/global-options + /// public class JsonApiOptions { + /// + /// Whether or not stack traces should be serialized in Error objects + /// + public static bool DisableErrorStackTraces { get; set; } + + /// + /// Whether or not source URLs should be serialized in Error objects + /// + public static bool DisableErrorSource { get; set; } + + /// + /// The base URL Namespace + /// + /// + /// options.Namespace = "api/v1"; + /// public string Namespace { get; set; } + + /// + /// The default page size for all resources + /// + /// + /// options.DefaultPageSize = 10; + /// public int DefaultPageSize { get; set; } + + /// + /// Whether or not the total-record count should be included in all document + /// level meta objects. + /// Defaults to false. + /// + /// + /// options.IncludeTotalRecordCount = true; + /// public bool IncludeTotalRecordCount { get; set; } + + /// + /// Whether or not clients can provide ids when creating resources. + /// Defaults to false. When disabled the application will respond + /// with a 403 Forbidden respponse if a client attempts to create a + /// resource with a defined id. + /// + /// + /// options.AllowClientGeneratedIds = true; + /// public bool AllowClientGeneratedIds { get; set; } + + /// + /// The graph of all resources exposed by this application. + /// public IContextGraph ContextGraph { get; set; } - public IContractResolver JsonContractResolver { get; set; } = new DasherizedResolver(); - internal IContextGraphBuilder ContextGraphBuilder { get; } = new ContextGraphBuilder(); - public void BuildContextGraph(Action builder) - where TContext : DbContext + /// + /// Use relative links for all resources. + /// + /// + /// + /// options.RelativeLinks = true; + /// + /// + /// { + /// "type": "articles", + /// "id": "4309", + /// "relationships": { + /// "author": { + /// "links": { + /// "self": "/api/v1/articles/4309/relationships/author", + /// "related": "/api/v1/articles/4309/author" + /// } + /// } + /// } + /// } + /// + /// + public bool RelativeLinks { get; set; } + + /// + /// Whether or not to allow all custom query parameters. + /// + /// + /// + /// options.AllowCustomQueryParameters = true; + /// + /// + public bool AllowCustomQueryParameters { get; set; } + + /// + /// The default behavior for serializing null attributes. + /// + /// + /// + /// options.NullAttributeResponseBehavior = new NullAttributeResponseBehavior { + /// // ... + ///}; + /// + /// + public NullAttributeResponseBehavior NullAttributeResponseBehavior { get; set; } + + /// + /// Whether or not to allow json:api v1.1 operation requests. + /// This is a beta feature and there may be breaking changes + /// in subsequent releases. For now, it should be considered + /// experimental. + /// + /// + /// This will be enabled by default in a subsequent patch JsonApiDotNetCore v2.2.x + /// + public bool EnableOperations { get; set; } + + /// + /// Whether or not to validate model state. + /// + /// + /// + /// options.ValidateModelState = true; + /// + /// + public bool ValidateModelState { get; set; } + + [Obsolete("JsonContract resolver can now be set on SerializerSettings.")] + public IContractResolver JsonContractResolver + { + get => SerializerSettings.ContractResolver; + set => SerializerSettings.ContractResolver = value; + } + public JsonSerializerSettings SerializerSettings { get; } = new JsonSerializerSettings() + { + NullValueHandling = NullValueHandling.Ignore, + ContractResolver = new DasherizedResolver() + }; + + public void BuildContextGraph(Action builder) where TContext : DbContext { BuildContextGraph(builder); @@ -35,5 +164,11 @@ public void BuildContextGraph(Action builder) ContextGraph = ContextGraphBuilder.Build(); } + + public void EnableExtension(JsonApiExtension extension) + => EnabledExtensions.Add(extension); + + internal IContextGraphBuilder ContextGraphBuilder { get; } = new ContextGraphBuilder(); + internal List EnabledExtensions { get; set; } = new List(); } } diff --git a/src/JsonApiDotNetCore/Configuration/NullAttributeResponseBehavior.cs b/src/JsonApiDotNetCore/Configuration/NullAttributeResponseBehavior.cs new file mode 100644 index 0000000000..125d38b5fc --- /dev/null +++ b/src/JsonApiDotNetCore/Configuration/NullAttributeResponseBehavior.cs @@ -0,0 +1,34 @@ +namespace JsonApiDotNetCore.Configuration +{ + /// + /// Allows null attributes to be ommitted from the response payload + /// + public struct NullAttributeResponseBehavior + { + /// Do not serialize null attributes + /// + /// Allow clients to override the serialization behavior through a query parmeter. + /// + /// ``` + /// GET /articles?omitNullValuedAttributes=true + /// ``` + /// + /// + public NullAttributeResponseBehavior(bool omitNullValuedAttributes = false, bool allowClientOverride = false) + { + OmitNullValuedAttributes = omitNullValuedAttributes; + AllowClientOverride = allowClientOverride; + } + + /// + /// Do not include null attributes in the response payload. + /// + public bool OmitNullValuedAttributes { get; } + + /// + /// Allows clients to specify a `omitNullValuedAttributes` boolean query param to control + /// serialization behavior. + /// + public bool AllowClientOverride { get; } + } +} diff --git a/src/JsonApiDotNetCore/Controllers/BaseJsonApiController.cs b/src/JsonApiDotNetCore/Controllers/BaseJsonApiController.cs index a10ea381de..fd6ec8947a 100644 --- a/src/JsonApiDotNetCore/Controllers/BaseJsonApiController.cs +++ b/src/JsonApiDotNetCore/Controllers/BaseJsonApiController.cs @@ -1,10 +1,10 @@ using System.Collections.Generic; using System.Threading.Tasks; +using JsonApiDotNetCore.Extensions; using JsonApiDotNetCore.Internal; using JsonApiDotNetCore.Models; using JsonApiDotNetCore.Services; using Microsoft.AspNetCore.Mvc; -using Microsoft.Extensions.Logging; namespace JsonApiDotNetCore.Controllers { @@ -105,7 +105,7 @@ public BaseJsonApiController( public virtual async Task GetAsync() { - if (_getAll == null) throw new JsonApiException(405, "Get requests are not supported"); + if (_getAll == null) throw Exceptions.UnSupportedRequestMethod; var entities = await _getAll.GetAsync(); @@ -114,7 +114,7 @@ public virtual async Task GetAsync() public virtual async Task GetAsync(TId id) { - if (_getById == null) throw new JsonApiException(405, "Get by Id requests are not supported"); + if (_getById == null) throw Exceptions.UnSupportedRequestMethod; var entity = await _getById.GetAsync(id); @@ -126,7 +126,7 @@ public virtual async Task GetAsync(TId id) public virtual async Task GetRelationshipsAsync(TId id, string relationshipName) { - if (_getRelationships == null) throw new JsonApiException(405, "Get Relationships requests are not supported"); + if (_getRelationships == null) throw Exceptions.UnSupportedRequestMethod; var relationship = await _getRelationships.GetRelationshipsAsync(id, relationshipName); if (relationship == null) @@ -137,7 +137,7 @@ public virtual async Task GetRelationshipsAsync(TId id, string re public virtual async Task GetRelationshipAsync(TId id, string relationshipName) { - if (_getRelationship == null) throw new JsonApiException(405, "Get Relationship requests are not supported"); + if (_getRelationship == null) throw Exceptions.UnSupportedRequestMethod; var relationship = await _getRelationship.GetRelationshipAsync(id, relationshipName); @@ -146,7 +146,8 @@ public virtual async Task GetRelationshipAsync(TId id, string rel public virtual async Task PostAsync([FromBody] T entity) { - if (_create == null) throw new JsonApiException(405, "Post requests are not supported"); + if (_create == null) + throw Exceptions.UnSupportedRequestMethod; if (entity == null) return UnprocessableEntity(); @@ -154,6 +155,9 @@ public virtual async Task PostAsync([FromBody] T entity) if (!_jsonApiContext.Options.AllowClientGeneratedIds && !string.IsNullOrEmpty(entity.StringId)) return Forbidden(); + if (_jsonApiContext.Options.ValidateModelState && !ModelState.IsValid) + return BadRequest(ModelState.ConvertToErrorCollection()); + entity = await _create.CreateAsync(entity); return Created($"{HttpContext.Request.Path}/{entity.Id}", entity); @@ -161,10 +165,12 @@ public virtual async Task PostAsync([FromBody] T entity) public virtual async Task PatchAsync(TId id, [FromBody] T entity) { - if (_update == null) throw new JsonApiException(405, "Patch requests are not supported"); + if (_update == null) throw Exceptions.UnSupportedRequestMethod; if (entity == null) return UnprocessableEntity(); + if (_jsonApiContext.Options.ValidateModelState && !ModelState.IsValid) + return BadRequest(ModelState.ConvertToErrorCollection()); var updatedEntity = await _update.UpdateAsync(id, entity); @@ -176,7 +182,7 @@ public virtual async Task PatchAsync(TId id, [FromBody] T entity) public virtual async Task PatchRelationshipsAsync(TId id, string relationshipName, [FromBody] List relationships) { - if (_updateRelationships == null) throw new JsonApiException(405, "Relationship Patch requests are not supported"); + if (_updateRelationships == null) throw Exceptions.UnSupportedRequestMethod; await _updateRelationships.UpdateRelationshipsAsync(id, relationshipName, relationships); @@ -185,7 +191,7 @@ public virtual async Task PatchRelationshipsAsync(TId id, string public virtual async Task DeleteAsync(TId id) { - if (_delete == null) throw new JsonApiException(405, "Delete requests are not supported"); + if (_delete == null) throw Exceptions.UnSupportedRequestMethod; var wasDeleted = await _delete.DeleteAsync(id); diff --git a/src/JsonApiDotNetCore/Controllers/HttpMethodRestrictionFilter.cs b/src/JsonApiDotNetCore/Controllers/HttpMethodRestrictionFilter.cs index 9bf533502a..ca9a2ff138 100644 --- a/src/JsonApiDotNetCore/Controllers/HttpMethodRestrictionFilter.cs +++ b/src/JsonApiDotNetCore/Controllers/HttpMethodRestrictionFilter.cs @@ -1,8 +1,5 @@ -using System; using System.Linq; -using System.Reflection; using System.Threading.Tasks; -using JsonApiDotNetCore.Controllers; using JsonApiDotNetCore.Internal; using Microsoft.AspNetCore.Mvc.Filters; @@ -17,15 +14,15 @@ public override async Task OnActionExecutionAsync( ActionExecutionDelegate next) { var method = context.HttpContext.Request.Method; - - if(CanExecuteAction(method) == false) + + if (CanExecuteAction(method) == false) throw new JsonApiException(405, $"This resource does not support {method} requests."); await next(); } private bool CanExecuteAction(string requestMethod) - { + { return Methods.Contains(requestMethod) == false; } } diff --git a/src/JsonApiDotNetCore/Controllers/JsonApiCmdController.cs b/src/JsonApiDotNetCore/Controllers/JsonApiCmdController.cs index 20e5445ebb..82c0fe40c4 100644 --- a/src/JsonApiDotNetCore/Controllers/JsonApiCmdController.cs +++ b/src/JsonApiDotNetCore/Controllers/JsonApiCmdController.cs @@ -3,7 +3,6 @@ using JsonApiDotNetCore.Models; using JsonApiDotNetCore.Services; using Microsoft.AspNetCore.Mvc; -using Microsoft.Extensions.Logging; namespace JsonApiDotNetCore.Controllers { diff --git a/src/JsonApiDotNetCore/Controllers/JsonApiController.cs b/src/JsonApiDotNetCore/Controllers/JsonApiController.cs index bea2105482..929e76e5aa 100644 --- a/src/JsonApiDotNetCore/Controllers/JsonApiController.cs +++ b/src/JsonApiDotNetCore/Controllers/JsonApiController.cs @@ -16,6 +16,24 @@ public JsonApiController( ILoggerFactory loggerFactory) : base(jsonApiContext, resourceService, loggerFactory) { } + + public JsonApiController( + IJsonApiContext jsonApiContext, + IResourceService resourceService) + : base(jsonApiContext, resourceService) + { } + + public JsonApiController( + IJsonApiContext jsonApiContext, + IGetAllService getAll = null, + IGetByIdService getById = null, + IGetRelationshipService getRelationship = null, + IGetRelationshipsService getRelationships = null, + ICreateService create = null, + IUpdateService update = null, + IUpdateRelationshipService updateRelationships = null, + IDeleteService delete = null + ) : base(jsonApiContext, getAll, getById, getRelationship, getRelationships, create, update, updateRelationships, delete) { } } public class JsonApiController @@ -34,6 +52,18 @@ public JsonApiController( : base(jsonApiContext, resourceService) { } + public JsonApiController( + IJsonApiContext jsonApiContext, + IGetAllService getAll = null, + IGetByIdService getById = null, + IGetRelationshipService getRelationship = null, + IGetRelationshipsService getRelationships = null, + ICreateService create = null, + IUpdateService update = null, + IUpdateRelationshipService updateRelationships = null, + IDeleteService delete = null + ) : base(jsonApiContext, getAll, getById, getRelationship, getRelationships, create, update, updateRelationships, delete) { } + [HttpGet] public override async Task GetAsync() => await base.GetAsync(); diff --git a/src/JsonApiDotNetCore/Controllers/JsonApiControllerMixin.cs b/src/JsonApiDotNetCore/Controllers/JsonApiControllerMixin.cs index fafc70f161..8c3099dde1 100644 --- a/src/JsonApiDotNetCore/Controllers/JsonApiControllerMixin.cs +++ b/src/JsonApiDotNetCore/Controllers/JsonApiControllerMixin.cs @@ -5,13 +5,8 @@ namespace JsonApiDotNetCore.Controllers { - public abstract class JsonApiControllerMixin : Controller + public abstract class JsonApiControllerMixin : ControllerBase { - protected IActionResult UnprocessableEntity() - { - return new StatusCodeResult(422); - } - protected IActionResult Forbidden() { return new StatusCodeResult(403); @@ -19,33 +14,35 @@ protected IActionResult Forbidden() protected IActionResult Error(Error error) { - var errorCollection = new ErrorCollection { + var errorCollection = new ErrorCollection + { Errors = new List { error } }; - var result = new ObjectResult(errorCollection); - result.StatusCode = error.StatusCode; - return result; + return new ObjectResult(errorCollection) + { + StatusCode = error.StatusCode + }; } protected IActionResult Errors(ErrorCollection errors) { - var result = new ObjectResult(errors); - result.StatusCode = GetErrorStatusCode(errors); - - return result; + return new ObjectResult(errors) + { + StatusCode = GetErrorStatusCode(errors) + }; } - private int GetErrorStatusCode(ErrorCollection errors) + private int GetErrorStatusCode(ErrorCollection errors) { var statusCodes = errors.Errors .Select(e => e.StatusCode) .Distinct() .ToList(); - if(statusCodes.Count == 1) + if (statusCodes.Count == 1) return statusCodes[0]; - + return int.Parse(statusCodes.Max().ToString()[0] + "00"); } } diff --git a/src/JsonApiDotNetCore/Controllers/JsonApiOperationsController.cs b/src/JsonApiDotNetCore/Controllers/JsonApiOperationsController.cs new file mode 100644 index 0000000000..f6db9f0d06 --- /dev/null +++ b/src/JsonApiDotNetCore/Controllers/JsonApiOperationsController.cs @@ -0,0 +1,60 @@ +using System.Threading.Tasks; +using JsonApiDotNetCore.Models.Operations; +using JsonApiDotNetCore.Services.Operations; +using Microsoft.AspNetCore.Mvc; + +namespace JsonApiDotNetCore.Controllers +{ + /// + /// A controller to be used for bulk operations as defined in the json:api 1.1 specification + /// + public class JsonApiOperationsController : ControllerBase + { + private readonly IOperationsProcessor _operationsProcessor; + + /// + /// The processor to handle bulk operations. + /// + public JsonApiOperationsController(IOperationsProcessor operationsProcessor) + { + _operationsProcessor = operationsProcessor; + } + + /// + /// Bulk endpoint for json:api operations + /// + /// + /// A json:api operations request document + /// + /// + /// + /// PATCH /api/bulk HTTP/1.1 + /// Content-Type: application/vnd.api+json + /// + /// { + /// "operations": [{ + /// "op": "add", + /// "ref": { + /// "type": "authors" + /// }, + /// "data": { + /// "type": "authors", + /// "attributes": { + /// "name": "jaredcnance" + /// } + /// } + /// }] + /// } + /// + /// + [HttpPatch] + public virtual async Task PatchAsync([FromBody] OperationsDocument doc) + { + if (doc == null) return new StatusCodeResult(422); + + var results = await _operationsProcessor.ProcessAsync(doc.Operations); + + return Ok(new OperationsDocument(results)); + } + } +} diff --git a/src/JsonApiDotNetCore/Controllers/JsonApiQueryController.cs b/src/JsonApiDotNetCore/Controllers/JsonApiQueryController.cs index 3e78bc4f8f..5211e5fa3b 100644 --- a/src/JsonApiDotNetCore/Controllers/JsonApiQueryController.cs +++ b/src/JsonApiDotNetCore/Controllers/JsonApiQueryController.cs @@ -1,9 +1,7 @@ -using System.Collections.Generic; using System.Threading.Tasks; using JsonApiDotNetCore.Models; using JsonApiDotNetCore.Services; using Microsoft.AspNetCore.Mvc; -using Microsoft.Extensions.Logging; namespace JsonApiDotNetCore.Controllers { diff --git a/src/JsonApiDotNetCore/Controllers/QueryParams.cs b/src/JsonApiDotNetCore/Controllers/QueryParams.cs index 7e59f976c5..4c963098ad 100644 --- a/src/JsonApiDotNetCore/Controllers/QueryParams.cs +++ b/src/JsonApiDotNetCore/Controllers/QueryParams.cs @@ -1,5 +1,3 @@ -using System; - namespace JsonApiDotNetCore.Controllers { public enum QueryParams diff --git a/src/JsonApiDotNetCore/Data/DbContextResolver.cs b/src/JsonApiDotNetCore/Data/DbContextResolver.cs index 8aedee0f4e..e681e660bb 100644 --- a/src/JsonApiDotNetCore/Data/DbContextResolver.cs +++ b/src/JsonApiDotNetCore/Data/DbContextResolver.cs @@ -1,14 +1,14 @@ -using System; using JsonApiDotNetCore.Extensions; using Microsoft.EntityFrameworkCore; namespace JsonApiDotNetCore.Data { - public class DbContextResolver : IDbContextResolver + public class DbContextResolver : IDbContextResolver + where TContext : DbContext { - private readonly DbContext _context; + private readonly TContext _context; - public DbContextResolver(DbContext context) + public DbContextResolver(TContext context) { _context = context; } diff --git a/src/JsonApiDotNetCore/Data/DefaultEntityRepository.cs b/src/JsonApiDotNetCore/Data/DefaultEntityRepository.cs index bc2d9b0661..d1b82e30bc 100644 --- a/src/JsonApiDotNetCore/Data/DefaultEntityRepository.cs +++ b/src/JsonApiDotNetCore/Data/DefaultEntityRepository.cs @@ -13,20 +13,21 @@ namespace JsonApiDotNetCore.Data { - public class DefaultEntityRepository + public class DefaultEntityRepository : DefaultEntityRepository, - IEntityRepository + IEntityRepository where TEntity : class, IIdentifiable { public DefaultEntityRepository( ILoggerFactory loggerFactory, - IJsonApiContext jsonApiContext) - : base(loggerFactory, jsonApiContext) + IJsonApiContext jsonApiContext, + IDbContextResolver contextResolver) + : base(loggerFactory, jsonApiContext, contextResolver) { } } - public class DefaultEntityRepository - : IEntityRepository + public class DefaultEntityRepository + : IEntityRepository where TEntity : class, IIdentifiable { private readonly DbContext _context; @@ -35,24 +36,11 @@ public class DefaultEntityRepository private readonly IJsonApiContext _jsonApiContext; private readonly IGenericProcessorFactory _genericProcessorFactory; - [Obsolete("DbContext is no longer directly injected into the ctor. Use JsonApiContext.GetDbContextResolver() instead")] public DefaultEntityRepository( - DbContext context, ILoggerFactory loggerFactory, - IJsonApiContext jsonApiContext) + IJsonApiContext jsonApiContext, + IDbContextResolver contextResolver) { - _context = context; - _dbSet = context.GetDbSet(); - _jsonApiContext = jsonApiContext; - _logger = loggerFactory.CreateLogger>(); - _genericProcessorFactory = _jsonApiContext.GenericProcessorFactory; - } - - public DefaultEntityRepository( - ILoggerFactory loggerFactory, - IJsonApiContext jsonApiContext) - { - var contextResolver = jsonApiContext.GetDbContextResolver(); _context = contextResolver.GetContext(); _dbSet = contextResolver.GetDbSet(); _jsonApiContext = jsonApiContext; @@ -62,36 +50,20 @@ public DefaultEntityRepository( public virtual IQueryable Get() { - if(_jsonApiContext.QuerySet?.Fields != null && _jsonApiContext.QuerySet.Fields.Any()) + if (_jsonApiContext.QuerySet?.Fields != null && _jsonApiContext.QuerySet.Fields.Count > 0) return _dbSet.Select(_jsonApiContext.QuerySet?.Fields); - + return _dbSet; } - public virtual IQueryable Filter(IQueryable entities, FilterQuery filterQuery) + public virtual IQueryable Filter(IQueryable entities, FilterQuery filterQuery) { - if(filterQuery == null) - return entities; - - if(filterQuery.IsAttributeOfRelationship) - return entities.Filter(new RelatedAttrFilterQuery(_jsonApiContext, filterQuery)); - - return entities.Filter(new AttrFilterQuery(_jsonApiContext, filterQuery)); + return entities.Filter(_jsonApiContext, filterQuery); } public virtual IQueryable Sort(IQueryable entities, List sortQueries) { - if(sortQueries == null || sortQueries.Count == 0) - return entities; - - var orderedEntities = entities.Sort(sortQueries[0]); - - if (sortQueries.Count <= 1) return orderedEntities; - - for(var i=1; i < sortQueries.Count; i++) - orderedEntities = orderedEntities.Sort(sortQueries[i]); - - return orderedEntities; + return entities.Sort(sortQueries); } public virtual async Task GetAsync(TId id) @@ -112,11 +84,47 @@ public virtual async Task GetAndIncludeAsync(TId id, string relationshi public virtual async Task CreateAsync(TEntity entity) { + AttachRelationships(); _dbSet.Add(entity); + await _context.SaveChangesAsync(); return entity; } + protected virtual void AttachRelationships() + { + AttachHasManyPointers(); + AttachHasOnePointers(); + } + + /// + /// This is used to allow creation of HasMany relationships when the + /// dependent side of the relationship already exists. + /// + private void AttachHasManyPointers() + { + var relationships = _jsonApiContext.HasManyRelationshipPointers.Get(); + foreach(var relationship in relationships) + { + foreach(var pointer in relationship.Value) + { + _context.Entry(pointer).State = EntityState.Unchanged; + } + } + } + + /// + /// This is used to allow creation of HasOne relationships when the + /// independent side of the relationship already exists. + /// + private void AttachHasOnePointers() + { + var relationships = _jsonApiContext.HasOneRelationshipPointers.Get(); + foreach (var relationship in relationships) + if (_context.Entry(relationship.Value).State == EntityState.Detached && _context.EntityIsTracked(relationship.Value) == false) + _context.Entry(relationship.Value).State = EntityState.Unchanged; + } + public virtual async Task UpdateAsync(TId id, TEntity entity) { var oldEntity = await GetAsync(id); @@ -124,10 +132,10 @@ public virtual async Task UpdateAsync(TId id, TEntity entity) if (oldEntity == null) return null; - foreach(var attr in _jsonApiContext.AttributesToUpdate) + foreach (var attr in _jsonApiContext.AttributesToUpdate) attr.Key.SetValue(oldEntity, attr.Value); - foreach(var relationship in _jsonApiContext.RelationshipsToUpdate) + foreach (var relationship in _jsonApiContext.RelationshipsToUpdate) relationship.Key.SetValue(oldEntity, relationship.Value); await _context.SaveChangesAsync(); @@ -137,7 +145,7 @@ public virtual async Task UpdateAsync(TId id, TEntity entity) public async Task UpdateRelationshipsAsync(object parent, RelationshipAttribute relationship, IEnumerable relationshipIds) { - var genericProcessor = _genericProcessorFactory.GetProcessor(relationship.Type); + var genericProcessor = _genericProcessorFactory.GetProcessor(typeof(GenericProcessor<>), relationship.Type); await genericProcessor.UpdateRelationshipsAsync(parent, relationship, relationshipIds); } @@ -159,22 +167,59 @@ public virtual IQueryable Include(IQueryable entities, string { var entity = _jsonApiContext.RequestEntity; var relationship = entity.Relationships.FirstOrDefault(r => r.PublicRelationshipName == relationshipName); - if(relationship != null) - return entities.Include(relationship.InternalRelationshipName); - - throw new JsonApiException(400, $"Invalid relationship {relationshipName} on {entity.EntityName}", - $"{entity.EntityName} does not have a relationship named {relationshipName}"); + if (relationship == null) + { + throw new JsonApiException(400, $"Invalid relationship {relationshipName} on {entity.EntityName}", + $"{entity.EntityName} does not have a relationship named {relationshipName}"); + } + + if (!relationship.CanInclude) + { + throw new JsonApiException(400, $"Including the relationship {relationshipName} on {entity.EntityName} is not allowed"); + } + return entities.Include(relationship.InternalRelationshipName); + } public virtual async Task> PageAsync(IQueryable entities, int pageSize, int pageNumber) { - if(pageSize > 0) - return await entities - .Skip((pageNumber - 1) * pageSize) - .Take(pageSize) + if (pageNumber >= 0) + { + return await entities.PageForward(pageSize, pageNumber).ToListAsync(); + } + + // since EntityFramework does not support IQueryable.Reverse(), we need to know the number of queried entities + int numberOfEntities = await this.CountAsync(entities); + + // may be negative + int virtualFirstIndex = numberOfEntities - pageSize * Math.Abs(pageNumber); + int numberOfElementsInPage = Math.Min(pageSize, virtualFirstIndex + pageSize); + + return await entities + .Skip(virtualFirstIndex) + .Take(numberOfElementsInPage) .ToListAsync(); + } + + public async Task CountAsync(IQueryable entities) + { + return (entities is IAsyncEnumerable) + ? await entities.CountAsync() + : entities.Count(); + } - return await entities.ToListAsync(); + public async Task FirstOrDefaultAsync(IQueryable entities) + { + return (entities is IAsyncEnumerable) + ? await entities.FirstOrDefaultAsync() + : entities.FirstOrDefault(); + } + + public async Task> ToListAsync(IQueryable entities) + { + return (entities is IAsyncEnumerable) + ? await entities.ToListAsync() + : entities.ToList(); } } } diff --git a/src/JsonApiDotNetCore/Data/IEntityReadRepository.cs b/src/JsonApiDotNetCore/Data/IEntityReadRepository.cs index aad16a9efc..a86b7334a9 100644 --- a/src/JsonApiDotNetCore/Data/IEntityReadRepository.cs +++ b/src/JsonApiDotNetCore/Data/IEntityReadRepository.cs @@ -27,5 +27,11 @@ public interface IEntityReadRepository Task GetAsync(TId id); Task GetAndIncludeAsync(TId id, string relationshipName); + + Task CountAsync(IQueryable entities); + + Task FirstOrDefaultAsync(IQueryable entities); + + Task> ToListAsync(IQueryable entities); } } diff --git a/src/JsonApiDotNetCore/Data/IEntityRepository.cs b/src/JsonApiDotNetCore/Data/IEntityRepository.cs index 4c35d6ea3f..e8bb68ef90 100644 --- a/src/JsonApiDotNetCore/Data/IEntityRepository.cs +++ b/src/JsonApiDotNetCore/Data/IEntityRepository.cs @@ -1,7 +1,3 @@ -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using JsonApiDotNetCore.Internal.Query; using JsonApiDotNetCore.Models; namespace JsonApiDotNetCore.Data diff --git a/src/JsonApiDotNetCore/DependencyInjection/ServiceLocator.cs b/src/JsonApiDotNetCore/DependencyInjection/ServiceLocator.cs new file mode 100644 index 0000000000..31164ee3b9 --- /dev/null +++ b/src/JsonApiDotNetCore/DependencyInjection/ServiceLocator.cs @@ -0,0 +1,18 @@ +using System; +using System.Threading; + +namespace JsonApiDotNetCore.DependencyInjection +{ + internal class ServiceLocator + { + public static AsyncLocal _scopedProvider = new AsyncLocal(); + public static void Initialize(IServiceProvider serviceProvider) => _scopedProvider.Value = serviceProvider; + + public static object GetService(Type type) + => _scopedProvider.Value != null + ? _scopedProvider.Value.GetService(type) + : throw new InvalidOperationException( + $"Service locator has not been initialized for the current asynchronous flow. Call {nameof(Initialize)} first." + ); + } +} diff --git a/src/JsonApiDotNetCore/Extensions/DbContextExtensions.cs b/src/JsonApiDotNetCore/Extensions/DbContextExtensions.cs index e8b4e3d601..9176474548 100644 --- a/src/JsonApiDotNetCore/Extensions/DbContextExtensions.cs +++ b/src/JsonApiDotNetCore/Extensions/DbContextExtensions.cs @@ -1,21 +1,32 @@ -using Microsoft.EntityFrameworkCore; -using System.Reflection; using System; +using System.Linq; +using JsonApiDotNetCore.Models; +using Microsoft.EntityFrameworkCore; namespace JsonApiDotNetCore.Extensions { public static class DbContextExtensions { - public static DbSet GetDbSet(this DbContext context) where T : class + [Obsolete("This is no longer required since the introduction of context.Set", error: false)] + public static DbSet GetDbSet(this DbContext context) where T : class + => context.Set(); + + /// + /// Determines whether or not EF is already tracking an entity of the same Type and Id + /// + public static bool EntityIsTracked(this DbContext context, IIdentifiable entity) { - var contextProperties = context.GetType().GetProperties(); - foreach(var property in contextProperties) - { - if (property.PropertyType == typeof(DbSet)) - return (DbSet)property.GetValue(context); - } + if (entity == null) + throw new ArgumentNullException(nameof(entity)); + + var trackedEntries = context.ChangeTracker + .Entries() + .FirstOrDefault(entry => + entry.Entity.GetType() == entity.GetType() + && ((IIdentifiable)entry.Entity).StringId == entity.StringId + ); - throw new ArgumentException($"DbSet of type {typeof(T).FullName} not found on the DbContext", nameof(T)); + return trackedEntries != null; } } } diff --git a/src/JsonApiDotNetCore/Extensions/IApplicationBuilderExtensions.cs b/src/JsonApiDotNetCore/Extensions/IApplicationBuilderExtensions.cs index c3d7ba2ee7..996d7eb9de 100644 --- a/src/JsonApiDotNetCore/Extensions/IApplicationBuilderExtensions.cs +++ b/src/JsonApiDotNetCore/Extensions/IApplicationBuilderExtensions.cs @@ -1,5 +1,10 @@ +using JsonApiDotNetCore.Builders; +using JsonApiDotNetCore.Configuration; +using JsonApiDotNetCore.Internal; using JsonApiDotNetCore.Middleware; using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Hosting; +using Microsoft.Extensions.Logging; namespace JsonApiDotNetCore.Extensions { @@ -8,6 +13,9 @@ public static class IApplicationBuilderExtensions { public static IApplicationBuilder UseJsonApi(this IApplicationBuilder app, bool useMvc = true) { + DisableDetailedErrorsIfProduction(app); + LogContextGraphValidations(app); + app.UseMiddleware(); if (useMvc) @@ -15,5 +23,33 @@ public static IApplicationBuilder UseJsonApi(this IApplicationBuilder app, bool return app; } + + private static void DisableDetailedErrorsIfProduction(IApplicationBuilder app) + { + var environment = (IHostingEnvironment)app.ApplicationServices.GetService(typeof(IHostingEnvironment)); + + if (environment.IsProduction()) + { + JsonApiOptions.DisableErrorStackTraces = true; + JsonApiOptions.DisableErrorSource = true; + } + } + + private static void LogContextGraphValidations(IApplicationBuilder app) + { + var logger = app.ApplicationServices.GetService(typeof(ILogger)) as ILogger; + var contextGraph = app.ApplicationServices.GetService(typeof(IContextGraph)) as ContextGraph; + + if (logger != null && contextGraph != null) + { + contextGraph.ValidationResults.ForEach((v) => + logger.Log( + v.LogLevel, + new EventId(), + v.Message, + exception: null, + formatter: (m, e) => m)); + } + } } } diff --git a/src/JsonApiDotNetCore/Extensions/IQueryableExtensions.cs b/src/JsonApiDotNetCore/Extensions/IQueryableExtensions.cs index c40d61b517..994fc08070 100644 --- a/src/JsonApiDotNetCore/Extensions/IQueryableExtensions.cs +++ b/src/JsonApiDotNetCore/Extensions/IQueryableExtensions.cs @@ -5,23 +5,56 @@ using System.Reflection; using JsonApiDotNetCore.Internal; using JsonApiDotNetCore.Internal.Query; +using JsonApiDotNetCore.Services; namespace JsonApiDotNetCore.Extensions { // ReSharper disable once InconsistentNaming public static class IQueryableExtensions { + private static MethodInfo _containsMethod; + private static MethodInfo ContainsMethod + { + get + { + if (_containsMethod == null) + { + _containsMethod = typeof(Enumerable) + .GetMethods(BindingFlags.Static | BindingFlags.Public) + .Where(m => m.Name == nameof(Enumerable.Contains) && m.GetParameters().Count() == 2) + .First(); + } + return _containsMethod; + } + } + + + public static IQueryable Sort(this IQueryable source, List sortQueries) + { + if (sortQueries == null || sortQueries.Count == 0) + return source; + + var orderedEntities = source.Sort(sortQueries[0]); + + if (sortQueries.Count <= 1) return orderedEntities; + + for (var i = 1; i < sortQueries.Count; i++) + orderedEntities = orderedEntities.Sort(sortQueries[i]); + + return orderedEntities; + } + public static IOrderedQueryable Sort(this IQueryable source, SortQuery sortQuery) { - return sortQuery.Direction == SortDirection.Descending - ? source.OrderByDescending(sortQuery.SortedAttribute.InternalAttributeName) + return sortQuery.Direction == SortDirection.Descending + ? source.OrderByDescending(sortQuery.SortedAttribute.InternalAttributeName) : source.OrderBy(sortQuery.SortedAttribute.InternalAttributeName); } public static IOrderedQueryable Sort(this IOrderedQueryable source, SortQuery sortQuery) { - return sortQuery.Direction == SortDirection.Descending - ? source.ThenByDescending(sortQuery.SortedAttribute.InternalAttributeName) + return sortQuery.Direction == SortDirection.Descending + ? source.ThenByDescending(sortQuery.SortedAttribute.InternalAttributeName) : source.ThenBy(sortQuery.SortedAttribute.InternalAttributeName); } @@ -62,6 +95,17 @@ private static IOrderedQueryable CallGenericOrderMethod(IQuery return (IOrderedQueryable)result; } + public static IQueryable Filter(this IQueryable source, IJsonApiContext jsonApiContext, FilterQuery filterQuery) + { + if (filterQuery == null) + return source; + + if (filterQuery.IsAttributeOfRelationship) + return source.Filter(new RelatedAttrFilterQuery(jsonApiContext, filterQuery)); + + return source.Filter(new AttrFilterQuery(jsonApiContext, filterQuery)); + } + public static IQueryable Filter(this IQueryable source, AttrFilterQuery filterQuery) { if (filterQuery == null) @@ -75,21 +119,30 @@ public static IQueryable Filter(this IQueryable sourc try { - // convert the incoming value to the target value type - // "1" -> 1 - var convertedValue = TypeHelper.ConvertType(filterQuery.PropertyValue, property.PropertyType); - // {model} - var parameter = Expression.Parameter(concreteType, "model"); - // {model.Id} - var left = Expression.PropertyOrField(parameter, property.Name); - // {1} - var right = Expression.Constant(convertedValue, property.PropertyType); - - var body = GetFilterExpressionLambda(left, right, filterQuery.FilterOperation); - - var lambda = Expression.Lambda>(body, parameter); - - return source.Where(lambda); + if (filterQuery.FilterOperation == FilterOperations.@in ) + { + string[] propertyValues = filterQuery.PropertyValue.Split(','); + var lambdaIn = ArrayContainsPredicate(propertyValues, property.Name); + + return source.Where(lambdaIn); + } + else + { // convert the incoming value to the target value type + // "1" -> 1 + var convertedValue = TypeHelper.ConvertType(filterQuery.PropertyValue, property.PropertyType); + // {model} + var parameter = Expression.Parameter(concreteType, "model"); + // {model.Id} + var left = Expression.PropertyOrField(parameter, property.Name); + // {1} + var right = Expression.Constant(convertedValue, property.PropertyType); + + var body = GetFilterExpressionLambda(left, right, filterQuery.FilterOperation); + + var lambda = Expression.Lambda>(body, parameter); + + return source.Where(lambda); + } } catch (FormatException) { @@ -114,26 +167,36 @@ public static IQueryable Filter(this IQueryable sourc try { - // convert the incoming value to the target value type - // "1" -> 1 - var convertedValue = TypeHelper.ConvertType(filterQuery.PropertyValue, relatedAttr.PropertyType); - // {model} - var parameter = Expression.Parameter(concreteType, "model"); + if (filterQuery.FilterOperation == FilterOperations.@in) + { + string[] propertyValues = filterQuery.PropertyValue.Split(','); + var lambdaIn = ArrayContainsPredicate(propertyValues, relatedAttr.Name, relation.Name); - // {model.Relationship} - var leftRelationship = Expression.PropertyOrField(parameter, relation.Name); + return source.Where(lambdaIn); + } + else + { + // convert the incoming value to the target value type + // "1" -> 1 + var convertedValue = TypeHelper.ConvertType(filterQuery.PropertyValue, relatedAttr.PropertyType); + // {model} + var parameter = Expression.Parameter(concreteType, "model"); - // {model.Relationship.Attr} - var left = Expression.PropertyOrField(leftRelationship, relatedAttr.Name); + // {model.Relationship} + var leftRelationship = Expression.PropertyOrField(parameter, relation.Name); - // {1} - var right = Expression.Constant(convertedValue, relatedAttr.PropertyType); + // {model.Relationship.Attr} + var left = Expression.PropertyOrField(leftRelationship, relatedAttr.Name); - var body = GetFilterExpressionLambda(left, right, filterQuery.FilterOperation); + // {1} + var right = Expression.Constant(convertedValue, relatedAttr.PropertyType); - var lambda = Expression.Lambda>(body, parameter); + var body = GetFilterExpressionLambda(left, right, filterQuery.FilterOperation); - return source.Where(lambda); + var lambda = Expression.Lambda>(body, parameter); + + return source.Where(lambda); + } } catch (FormatException) { @@ -163,13 +226,16 @@ private static Expression GetFilterExpressionLambda(Expression left, Expression body = Expression.LessThanOrEqual(left, right); break; case FilterOperations.ge: - // {model.Id <= 1} + // {model.Id >= 1} body = Expression.GreaterThanOrEqual(left, right); break; case FilterOperations.like: - // {model.Id <= 1} body = Expression.Call(left, "Contains", null, right); break; + // {model.Id != 1} + case FilterOperations.ne: + body = Expression.NotEqual(left, right); + break; default: throw new JsonApiException(500, $"Unknown filter operation {operation}"); } @@ -177,9 +243,28 @@ private static Expression GetFilterExpressionLambda(Expression left, Expression return body; } + private static Expression> ArrayContainsPredicate(string[] propertyValues, string fieldname, string relationName = null) + { + ParameterExpression entity = Expression.Parameter(typeof(TSource), "entity"); + MemberExpression member; + if (!string.IsNullOrEmpty(relationName)) + { + var relation = Expression.PropertyOrField(entity, relationName); + member = Expression.Property(relation, fieldname); + } + else + member = Expression.Property(entity, fieldname); + + var method = ContainsMethod.MakeGenericMethod(member.Type); + var obj = TypeHelper.ConvertListType(propertyValues, member.Type); + + var exprContains = Expression.Call(method, new Expression[] { Expression.Constant(obj), member }); + return Expression.Lambda>(exprContains, entity); + } + public static IQueryable Select(this IQueryable source, List columns) { - if (columns == null || columns.Any() == false) + if (columns == null || columns.Count == 0) return source; var sourceType = source.ElementType; @@ -202,5 +287,21 @@ public static IQueryable Select(this IQueryable sourc Expression.Call(typeof(Queryable), "Select", new[] { sourceType, resultType }, source.Expression, Expression.Quote(selector))); } + + public static IQueryable PageForward(this IQueryable source, int pageSize, int pageNumber) + { + if (pageSize > 0) + { + if (pageNumber == 0) + pageNumber = 1; + + if (pageNumber > 0) + return source + .Skip((pageNumber - 1) * pageSize) + .Take(pageSize); + } + + return source; + } } } diff --git a/src/JsonApiDotNetCore/Extensions/IServiceCollectionExtensions.cs b/src/JsonApiDotNetCore/Extensions/IServiceCollectionExtensions.cs index 3d2b14704a..ea597ef011 100644 --- a/src/JsonApiDotNetCore/Extensions/IServiceCollectionExtensions.cs +++ b/src/JsonApiDotNetCore/Extensions/IServiceCollectionExtensions.cs @@ -3,11 +3,14 @@ using JsonApiDotNetCore.Configuration; using JsonApiDotNetCore.Data; using JsonApiDotNetCore.Formatters; +using JsonApiDotNetCore.Graph; using JsonApiDotNetCore.Internal; using JsonApiDotNetCore.Internal.Generics; using JsonApiDotNetCore.Middleware; using JsonApiDotNetCore.Serialization; using JsonApiDotNetCore.Services; +using JsonApiDotNetCore.Services.Operations; +using JsonApiDotNetCore.Services.Operations.Processors; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; @@ -18,23 +21,24 @@ namespace JsonApiDotNetCore.Extensions // ReSharper disable once InconsistentNaming public static class IServiceCollectionExtensions { - public static void AddJsonApi(this IServiceCollection services) + public static IServiceCollection AddJsonApi(this IServiceCollection services) where TContext : DbContext { - var mvcBuilder = services.AddMvc(); - AddJsonApi(services, (opt) => { }, mvcBuilder); + var mvcBuilder = services.AddMvcCore(); + return AddJsonApi(services, opt => { }, mvcBuilder); } - public static void AddJsonApi(this IServiceCollection services, Action options) + public static IServiceCollection AddJsonApi(this IServiceCollection services, Action options) where TContext : DbContext { - var mvcBuilder = services.AddMvc(); - AddJsonApi(services, options, mvcBuilder); + var mvcBuilder = services.AddMvcCore(); + return AddJsonApi(services, options, mvcBuilder); } - public static void AddJsonApi(this IServiceCollection services, - Action options, - IMvcBuilder mvcBuilder) where TContext : DbContext + public static IServiceCollection AddJsonApi( + this IServiceCollection services, + Action options, + IMvcCoreBuilder mvcBuilder) where TContext : DbContext { var config = new JsonApiOptions(); @@ -42,32 +46,39 @@ public static void AddJsonApi(this IServiceCollection services, config.BuildContextGraph(builder => builder.AddDbContext()); - mvcBuilder - .AddMvcOptions(opt => + mvcBuilder.AddMvcOptions(opt => { opt.Filters.Add(typeof(JsonApiExceptionFilter)); opt.SerializeAsJsonApi(config); }); AddJsonApiInternals(services, config); + return services; } - public static void AddJsonApi(this IServiceCollection services, - Action options, - IMvcBuilder mvcBuilder) + public static IServiceCollection AddJsonApi( + this IServiceCollection services, + Action configureOptions, + IMvcCoreBuilder mvcBuilder, + Action autoDiscover = null) { - var config = new JsonApiOptions(); + var options = new JsonApiOptions(); + configureOptions(options); - options(config); + if(autoDiscover != null) + { + var facade = new ServiceDiscoveryFacade(services, options.ContextGraphBuilder); + autoDiscover(facade); + } - mvcBuilder - .AddMvcOptions(opt => + mvcBuilder.AddMvcOptions(opt => { opt.Filters.Add(typeof(JsonApiExceptionFilter)); - opt.SerializeAsJsonApi(config); + opt.SerializeAsJsonApi(options); }); - AddJsonApiInternals(services, config); + AddJsonApiInternals(services, options); + return services; } public static void AddJsonApiInternals( @@ -77,7 +88,8 @@ public static void AddJsonApiInternals( if (jsonApiOptions.ContextGraph == null) jsonApiOptions.BuildContextGraph(null); - services.AddScoped(typeof(DbContext), typeof(TContext)); + services.AddScoped>(); + AddJsonApiInternals(services, jsonApiOptions); } @@ -85,21 +97,47 @@ public static void AddJsonApiInternals( this IServiceCollection services, JsonApiOptions jsonApiOptions) { - if (!jsonApiOptions.ContextGraph.UsesDbContext) + if (jsonApiOptions.ContextGraph == null) + jsonApiOptions.ContextGraph = jsonApiOptions.ContextGraphBuilder.Build(); + + if (jsonApiOptions.ContextGraph.UsesDbContext == false) { services.AddScoped(); services.AddSingleton(new DbContextOptionsBuilder().Options); } - services.AddScoped(); + if (jsonApiOptions.EnableOperations) + AddOperationServices(services); + services.AddScoped(typeof(IEntityRepository<>), typeof(DefaultEntityRepository<>)); services.AddScoped(typeof(IEntityRepository<,>), typeof(DefaultEntityRepository<,>)); + + services.AddScoped(typeof(ICreateService<>), typeof(EntityResourceService<>)); + services.AddScoped(typeof(ICreateService<,>), typeof(EntityResourceService<,>)); + + services.AddScoped(typeof(IGetAllService<>), typeof(EntityResourceService<>)); + services.AddScoped(typeof(IGetAllService<,>), typeof(EntityResourceService<,>)); + + services.AddScoped(typeof(IGetByIdService<>), typeof(EntityResourceService<>)); + services.AddScoped(typeof(IGetByIdService<,>), typeof(EntityResourceService<,>)); + + services.AddScoped(typeof(IGetRelationshipService<,>), typeof(EntityResourceService<>)); + services.AddScoped(typeof(IGetRelationshipService<,>), typeof(EntityResourceService<,>)); + + services.AddScoped(typeof(IUpdateService<>), typeof(EntityResourceService<>)); + services.AddScoped(typeof(IUpdateService<,>), typeof(EntityResourceService<,>)); + + services.AddScoped(typeof(IDeleteService<>), typeof(EntityResourceService<>)); + services.AddScoped(typeof(IDeleteService<,>), typeof(EntityResourceService<,>)); + services.AddScoped(typeof(IResourceService<>), typeof(EntityResourceService<>)); services.AddScoped(typeof(IResourceService<,>), typeof(EntityResourceService<,>)); + services.AddSingleton(jsonApiOptions); services.AddSingleton(jsonApiOptions.ContextGraph); services.AddScoped(); services.AddSingleton(); + services.AddScoped(); services.AddScoped(); services.AddScoped(); services.AddScoped(); @@ -110,6 +148,29 @@ public static void AddJsonApiInternals( services.AddScoped(); services.AddScoped(typeof(GenericProcessor<>)); services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + } + + private static void AddOperationServices(IServiceCollection services) + { + services.AddScoped(); + + services.AddScoped(typeof(ICreateOpProcessor<>), typeof(CreateOpProcessor<>)); + services.AddScoped(typeof(ICreateOpProcessor<,>), typeof(CreateOpProcessor<,>)); + + services.AddScoped(typeof(IGetOpProcessor<>), typeof(GetOpProcessor<>)); + services.AddScoped(typeof(IGetOpProcessor<,>), typeof(GetOpProcessor<,>)); + + services.AddScoped(typeof(IRemoveOpProcessor<>), typeof(RemoveOpProcessor<>)); + services.AddScoped(typeof(IRemoveOpProcessor<,>), typeof(RemoveOpProcessor<,>)); + + services.AddScoped(typeof(IUpdateOpProcessor<>), typeof(UpdateOpProcessor<>)); + services.AddScoped(typeof(IUpdateOpProcessor<,>), typeof(UpdateOpProcessor<,>)); + + services.AddSingleton(); + services.AddSingleton(); } public static void SerializeAsJsonApi(this MvcOptions options, JsonApiOptions jsonApiOptions) diff --git a/src/JsonApiDotNetCore/Extensions/ModelStateExtensions.cs b/src/JsonApiDotNetCore/Extensions/ModelStateExtensions.cs new file mode 100644 index 0000000000..d67f7e66c4 --- /dev/null +++ b/src/JsonApiDotNetCore/Extensions/ModelStateExtensions.cs @@ -0,0 +1,29 @@ +using JsonApiDotNetCore.Internal; +using Microsoft.AspNetCore.Mvc.ModelBinding; +using Microsoft.EntityFrameworkCore.Internal; + +namespace JsonApiDotNetCore.Extensions +{ + public static class ModelStateExtensions + { + public static ErrorCollection ConvertToErrorCollection(this ModelStateDictionary modelState) + { + ErrorCollection collection = new ErrorCollection(); + foreach (var entry in modelState) + { + if (entry.Value.Errors.Any() == false) + continue; + + foreach (var modelError in entry.Value.Errors) + { + if (modelError.Exception is JsonApiException jex) + collection.Errors.AddRange(jex.GetError().Errors); + else + collection.Errors.Add(new Error(400, entry.Key, modelError.ErrorMessage, modelError.Exception != null ? ErrorMeta.FromException(modelError.Exception) : null)); + } + } + + return collection; + } + } +} diff --git a/src/JsonApiDotNetCore/Extensions/TypeExtensions.cs b/src/JsonApiDotNetCore/Extensions/TypeExtensions.cs new file mode 100644 index 0000000000..74c390e8d5 --- /dev/null +++ b/src/JsonApiDotNetCore/Extensions/TypeExtensions.cs @@ -0,0 +1,71 @@ +using JsonApiDotNetCore.Internal; +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; + +namespace JsonApiDotNetCore.Extensions +{ + internal static class TypeExtensions + { + public static Type GetElementType(this IEnumerable enumerable) + { + var enumerableTypes = enumerable.GetType() + .GetInterfaces() + .Where(t => t.IsGenericType == true && t.GetGenericTypeDefinition() == typeof(IEnumerable<>)) + .ToList(); + + var numberOfEnumerableTypes = enumerableTypes.Count; + + if (numberOfEnumerableTypes == 0) + { + throw new ArgumentException($"{nameof(enumerable)} of type {enumerable.GetType().FullName} does not implement a generic variant of {nameof(IEnumerable)}"); + } + + if (numberOfEnumerableTypes > 1) + { + throw new ArgumentException($"{nameof(enumerable)} of type {enumerable.GetType().FullName} implements more than one generic variant of {nameof(IEnumerable)}:\n" + + $"{string.Join("\n", enumerableTypes.Select(t => t.FullName))}"); + } + + var elementType = enumerableTypes[0].GenericTypeArguments[0]; + + return elementType; + } + + /// + /// Creates a List{TInterface} where TInterface is the generic for type specified by t + /// + public static IEnumerable GetEmptyCollection(this Type t) + { + if (t == null) throw new ArgumentNullException(nameof(t)); + + var listType = typeof(List<>).MakeGenericType(t); + var list = (IEnumerable)Activator.CreateInstance(listType); + return list; + } + + /// + /// Creates a new instance of type t, casting it to the specified TInterface + /// + public static TInterface New(this Type t) + { + if (t == null) throw new ArgumentNullException(nameof(t)); + + var instance = (TInterface)CreateNewInstance(t); + return instance; + } + + private static object CreateNewInstance(Type type) + { + try + { + return Activator.CreateInstance(type); + } + catch (Exception e) + { + throw new JsonApiException(500, $"Type '{type}' cannot be instantiated using the default constructor.", e); + } + } + } +} diff --git a/src/JsonApiDotNetCore/Formatters/JsonApiInputFormatter.cs b/src/JsonApiDotNetCore/Formatters/JsonApiInputFormatter.cs index 12e57deadf..f556b7433d 100644 --- a/src/JsonApiDotNetCore/Formatters/JsonApiInputFormatter.cs +++ b/src/JsonApiDotNetCore/Formatters/JsonApiInputFormatter.cs @@ -1,5 +1,6 @@ using System; using System.Threading.Tasks; +using JsonApiDotNetCore.Internal; using Microsoft.AspNetCore.Mvc.Formatters; using Microsoft.Extensions.DependencyInjection; @@ -14,7 +15,7 @@ public bool CanRead(InputFormatterContext context) var contentTypeString = context.HttpContext.Request.ContentType; - return contentTypeString == "application/vnd.api+json"; + return contentTypeString == Constants.ContentType; } public async Task ReadAsync(InputFormatterContext context) diff --git a/src/JsonApiDotNetCore/Formatters/JsonApiOutputFormatter.cs b/src/JsonApiDotNetCore/Formatters/JsonApiOutputFormatter.cs index 2431055d1d..b456932fc5 100644 --- a/src/JsonApiDotNetCore/Formatters/JsonApiOutputFormatter.cs +++ b/src/JsonApiDotNetCore/Formatters/JsonApiOutputFormatter.cs @@ -1,5 +1,6 @@ using System; using System.Threading.Tasks; +using JsonApiDotNetCore.Internal; using Microsoft.AspNetCore.Mvc.Formatters; using Microsoft.Extensions.DependencyInjection; @@ -14,7 +15,7 @@ public bool CanWriteResult(OutputFormatterCanWriteContext context) var contentTypeString = context.HttpContext.Request.ContentType; - return string.IsNullOrEmpty(contentTypeString) || contentTypeString == "application/vnd.api+json"; + return string.IsNullOrEmpty(contentTypeString) || contentTypeString == Constants.ContentType; } public async Task WriteAsync(OutputFormatterWriteContext context) diff --git a/src/JsonApiDotNetCore/Formatters/JsonApiReader.cs b/src/JsonApiDotNetCore/Formatters/JsonApiReader.cs index 274d14bc15..e10a3f31c2 100644 --- a/src/JsonApiDotNetCore/Formatters/JsonApiReader.cs +++ b/src/JsonApiDotNetCore/Formatters/JsonApiReader.cs @@ -36,6 +36,7 @@ public Task ReadAsync(InputFormatterContext context) try { var body = GetRequestBody(context.HttpContext.Request.Body); + var model = _jsonApiContext.IsRelationshipPath ? _deSerializer.DeserializeRelationship(body) : _deSerializer.Deserialize(body); @@ -51,11 +52,9 @@ public Task ReadAsync(InputFormatterContext context) context.ModelState.AddModelError(context.ModelName, ex, context.Metadata); return InputFormatterResult.FailureAsync(); } - catch (JsonApiException jex) + catch (JsonApiException) { - _logger?.LogError(new EventId(), jex, "An error occurred while de-serializing the payload"); - context.ModelState.AddModelError(context.ModelName, jex, context.Metadata); - return InputFormatterResult.FailureAsync(); + throw; } } @@ -67,4 +66,4 @@ private string GetRequestBody(Stream body) } } } -} \ No newline at end of file +} diff --git a/src/JsonApiDotNetCore/Formatters/JsonApiWriter.cs b/src/JsonApiDotNetCore/Formatters/JsonApiWriter.cs index 730a88f13e..fcf0ac7850 100644 --- a/src/JsonApiDotNetCore/Formatters/JsonApiWriter.cs +++ b/src/JsonApiDotNetCore/Formatters/JsonApiWriter.cs @@ -13,7 +13,8 @@ public class JsonApiWriter : IJsonApiWriter private readonly ILogger _logger; private readonly IJsonApiSerializer _serializer; - public JsonApiWriter(IJsonApiSerializer serializer, + public JsonApiWriter( + IJsonApiSerializer serializer, ILoggerFactory loggerFactory) { _serializer = serializer; @@ -25,12 +26,10 @@ public async Task WriteAsync(OutputFormatterWriteContext context) if (context == null) throw new ArgumentNullException(nameof(context)); - _logger?.LogInformation("Formatting response as JSONAPI"); - var response = context.HttpContext.Response; using (var writer = context.WriterFactory(response.Body, Encoding.UTF8)) { - response.ContentType = "application/vnd.api+json"; + response.ContentType = Constants.ContentType; string responseContent; try { @@ -39,9 +38,7 @@ public async Task WriteAsync(OutputFormatterWriteContext context) catch (Exception e) { _logger?.LogError(new EventId(), e, "An error ocurred while formatting the response"); - var errors = new ErrorCollection(); - errors.Add(new Error("400", e.Message)); - responseContent = errors.GetJson(); + responseContent = GetErrorResponse(e); response.StatusCode = 400; } @@ -50,9 +47,12 @@ public async Task WriteAsync(OutputFormatterWriteContext context) } } - private string GetResponseBody(object responseObject) + private string GetResponseBody(object responseObject) => _serializer.Serialize(responseObject); + private string GetErrorResponse(Exception e) { - return _serializer.Serialize(responseObject); - } + var errors = new ErrorCollection(); + errors.Add(new Error(400, e.Message, ErrorMeta.FromException(e))); + return errors.GetJson(); + } } -} \ No newline at end of file +} diff --git a/src/JsonApiDotNetCore/Graph/IResourceNameFormatter.cs b/src/JsonApiDotNetCore/Graph/IResourceNameFormatter.cs new file mode 100644 index 0000000000..57baca0901 --- /dev/null +++ b/src/JsonApiDotNetCore/Graph/IResourceNameFormatter.cs @@ -0,0 +1,51 @@ +using System; +using System.Linq; +using System.Reflection; +using Humanizer; +using JsonApiDotNetCore.Models; +using str = JsonApiDotNetCore.Extensions.StringExtensions; + + +namespace JsonApiDotNetCore.Graph +{ + /// + /// Provides an interface for formatting resource names by convention + /// + public interface IResourceNameFormatter + { + /// + /// Get the publicly visible resource name from the internal type name + /// + string FormatResourceName(Type resourceType); + } + + public class DefaultResourceNameFormatter : IResourceNameFormatter + { + /// + /// Uses the internal type name to determine the external resource name. + /// By default we us Humanizer for pluralization and then we dasherize the name. + /// + /// + /// + /// _default.FormatResourceName(typeof(TodoItem)).Dump(); + /// // > "todo-items" + /// + /// + public string FormatResourceName(Type type) + { + try + { + // check the class definition first + // [Resource("models"] public class Model : Identifiable { /* ... */ } + if (type.GetCustomAttribute(typeof(ResourceAttribute)) is ResourceAttribute attribute) + return attribute.ResourceName; + + return str.Dasherize(type.Name.Pluralize()); + } + catch (InvalidOperationException e) + { + throw new InvalidOperationException($"Cannot define multiple {nameof(ResourceAttribute)}s on type '{type}'.", e); + } + } + } +} diff --git a/src/JsonApiDotNetCore/Graph/ResourceDescriptor.cs b/src/JsonApiDotNetCore/Graph/ResourceDescriptor.cs new file mode 100644 index 0000000000..e90bcdc22c --- /dev/null +++ b/src/JsonApiDotNetCore/Graph/ResourceDescriptor.cs @@ -0,0 +1,16 @@ +using System; + +namespace JsonApiDotNetCore.Graph +{ + internal struct ResourceDescriptor + { + public ResourceDescriptor(Type resourceType, Type idType) + { + ResourceType = resourceType; + IdType = idType; + } + + public Type ResourceType { get; set; } + public Type IdType { get; set; } + } +} diff --git a/src/JsonApiDotNetCore/Graph/ServiceDiscoveryFacade.cs b/src/JsonApiDotNetCore/Graph/ServiceDiscoveryFacade.cs new file mode 100644 index 0000000000..ca156718fe --- /dev/null +++ b/src/JsonApiDotNetCore/Graph/ServiceDiscoveryFacade.cs @@ -0,0 +1,141 @@ +using JsonApiDotNetCore.Builders; +using JsonApiDotNetCore.Data; +using JsonApiDotNetCore.Internal; +using JsonApiDotNetCore.Models; +using JsonApiDotNetCore.Services; +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.DependencyInjection; +using System; +using System.Linq; +using System.Reflection; + +namespace JsonApiDotNetCore.Graph +{ + public class ServiceDiscoveryFacade + { + private readonly IServiceCollection _services; + private readonly IContextGraphBuilder _graphBuilder; + + public ServiceDiscoveryFacade(IServiceCollection services, IContextGraphBuilder graphBuilder) + { + _services = services; + _graphBuilder = graphBuilder; + } + + /// + /// Add resources, services and repository implementations to the container. + /// + /// The type name formatter used to get the string representation of resource names. + public ServiceDiscoveryFacade AddCurrentAssemblyServices(IResourceNameFormatter resourceNameFormatter = null) + => AddAssemblyServices(Assembly.GetCallingAssembly(), resourceNameFormatter); + + /// + /// Add resources, services and repository implementations to the container. + /// + /// The assembly to search for resources in. + /// The type name formatter used to get the string representation of resource names. + public ServiceDiscoveryFacade AddAssemblyServices(Assembly assembly, IResourceNameFormatter resourceNameFormatter = null) + { + AddDbContextResolvers(assembly); + AddAssemblyResources(assembly, resourceNameFormatter); + AddAssemblyServices(assembly); + AddAssemblyRepositories(assembly); + + return this; + } + + private void AddDbContextResolvers(Assembly assembly) + { + var dbContextTypes = TypeLocator.GetDerivedTypes(assembly, typeof(DbContext)); + foreach(var dbContextType in dbContextTypes) + { + var resolverType = typeof(DbContextResolver<>).MakeGenericType(dbContextType); + _services.AddScoped(typeof(IDbContextResolver), resolverType); + } + } + + /// + /// Adds resources to the graph and registers types on the container. + /// + /// The assembly to search for resources in. + /// The type name formatter used to get the string representation of resource names. + public ServiceDiscoveryFacade AddAssemblyResources(Assembly assembly, IResourceNameFormatter resourceNameFormatter = null) + { + var identifiables = TypeLocator.GetIdentifableTypes(assembly); + foreach (var identifiable in identifiables) + { + RegisterResourceDefinition(assembly, identifiable); + AddResourceToGraph(identifiable, resourceNameFormatter); + } + + return this; + } + + private void RegisterResourceDefinition(Assembly assembly, ResourceDescriptor identifiable) + { + try + { + var resourceDefinition = TypeLocator.GetDerivedGenericTypes(assembly, typeof(ResourceDefinition<>), identifiable.ResourceType) + .SingleOrDefault(); + + if (resourceDefinition != null) + _services.AddScoped(typeof(ResourceDefinition<>).MakeGenericType(identifiable.ResourceType), resourceDefinition); + } + catch (InvalidOperationException e) + { + // TODO: need a better way to communicate failure since this is unlikely to occur during a web request + throw new JsonApiException(500, + $"Cannot define multiple ResourceDefinition<> implementations for '{identifiable.ResourceType}'", e); + } + } + + private void AddResourceToGraph(ResourceDescriptor identifiable, IResourceNameFormatter resourceNameFormatter = null) + { + var resourceName = FormatResourceName(identifiable.ResourceType, resourceNameFormatter); + _graphBuilder.AddResource(identifiable.ResourceType, identifiable.IdType, resourceName); + } + + private string FormatResourceName(Type resourceType, IResourceNameFormatter resourceNameFormatter) + { + resourceNameFormatter = resourceNameFormatter ?? new DefaultResourceNameFormatter(); + return resourceNameFormatter.FormatResourceName(resourceType); + } + + /// + /// Add implementations to container. + /// + /// The assembly to search for resources in. + public ServiceDiscoveryFacade AddAssemblyServices(Assembly assembly) + { + RegisterServiceImplementations(assembly, typeof(IResourceService<,>)); + RegisterServiceImplementations(assembly, typeof(ICreateService<,>)); + RegisterServiceImplementations(assembly, typeof(IGetAllService<,>)); + RegisterServiceImplementations(assembly, typeof(IGetByIdService<,>)); + RegisterServiceImplementations(assembly, typeof(IGetRelationshipService<,>)); + RegisterServiceImplementations(assembly, typeof(IUpdateService<,>)); + RegisterServiceImplementations(assembly, typeof(IDeleteService<,>)); + + return this; + } + + /// + /// Add implementations to container. + /// + /// The assembly to search for resources in. + public ServiceDiscoveryFacade AddAssemblyRepositories(Assembly assembly) + => RegisterServiceImplementations(assembly, typeof(IEntityRepository<,>)); + + private ServiceDiscoveryFacade RegisterServiceImplementations(Assembly assembly, Type interfaceType) + { + var identifiables = TypeLocator.GetIdentifableTypes(assembly); + foreach (var identifiable in identifiables) + { + var service = TypeLocator.GetGenericInterfaceImplementation(assembly, interfaceType, identifiable.ResourceType, identifiable.IdType); + if (service.implementation != null) + _services.AddScoped(service.registrationInterface, service.implementation); + } + + return this; + } + } +} diff --git a/src/JsonApiDotNetCore/Graph/TypeLocator.cs b/src/JsonApiDotNetCore/Graph/TypeLocator.cs new file mode 100644 index 0000000000..5bdb029e50 --- /dev/null +++ b/src/JsonApiDotNetCore/Graph/TypeLocator.cs @@ -0,0 +1,133 @@ +using JsonApiDotNetCore.Models; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; + +namespace JsonApiDotNetCore.Graph +{ + /// + /// Used to locate types and facilitate auto-resource discovery + /// + internal static class TypeLocator + { + private static Dictionary _typeCache = new Dictionary(); + private static Dictionary> _identifiableTypeCache = new Dictionary>(); + + + /// + /// Determine whether or not this is a json:api resource by checking if it implements . + /// Returns the status and the resultant id type, either `(true, Type)` OR `(false, null)` + /// + public static (bool isJsonApiResource, Type idType) GetIdType(Type resourceType) + { + var identitifableType = GetIdentifiableIdType(resourceType); + return (identitifableType != null) + ? (true, identitifableType) + : (false, null); + } + + private static Type GetIdentifiableIdType(Type identifiableType) + => GetIdentifiableInterface(identifiableType)?.GetGenericArguments()[0]; + + private static Type GetIdentifiableInterface(Type type) + => type.GetInterfaces().FirstOrDefault(i => i.IsGenericType && i.GetGenericTypeDefinition() == typeof(IIdentifiable<>)); + + // TODO: determine if this optimization is even helpful... + private static Type[] GetAssemblyTypes(Assembly assembly) + { + if (_typeCache.TryGetValue(assembly, out var types) == false) + { + types = assembly.GetTypes(); + _typeCache[assembly] = types; + } + + return types; + } + + + /// + /// Get all implementations of . in the assembly + /// + public static List GetIdentifableTypes(Assembly assembly) + { + if (_identifiableTypeCache.TryGetValue(assembly, out var descriptors) == false) + { + descriptors = new List(); + _identifiableTypeCache[assembly] = descriptors; + + foreach (var type in assembly.GetTypes()) + { + var possible = GetIdType(type); + if (possible.isJsonApiResource) + descriptors.Add(new ResourceDescriptor(type, possible.idType)); + } + } + + return descriptors; + } + + /// + /// Get all implementations of the generic interface + /// + /// The assembly to search + /// The open generic type, e.g. `typeof(IResourceService<>)` + /// Parameters to the generic type + /// + /// + /// GetGenericInterfaceImplementation(assembly, typeof(IResourceService<>), typeof(Article), typeof(Guid)); + /// + /// + public static (Type implementation, Type registrationInterface) GetGenericInterfaceImplementation(Assembly assembly, Type openGenericInterfaceType, params Type[] genericInterfaceArguments) + { + foreach (var type in assembly.GetTypes()) + { + var interfaces = type.GetInterfaces(); + foreach (var interfaceType in interfaces) + if (interfaceType.GetTypeInfo().IsGenericType && interfaceType.GetGenericTypeDefinition() == openGenericInterfaceType) + return ( + type, + interfaceType.MakeGenericType(genericInterfaceArguments) + ); + } + + return (null, null); + } + + /// + /// Get all derivitives of the concrete, generic type. + /// + /// The assembly to search + /// The open generic type, e.g. `typeof(ResourceDefinition<>)` + /// Parameters to the generic type + /// + /// + /// GetDerivedGenericTypes(assembly, typeof(ResourceDefinition<>), typeof(Article)) + /// + /// + public static IEnumerable GetDerivedGenericTypes(Assembly assembly, Type openGenericType, params Type[] genericArguments) + { + var genericType = openGenericType.MakeGenericType(genericArguments); + return GetDerivedTypes(assembly, genericType); + } + + /// + /// Get all derivitives of the specified type. + /// + /// The assembly to search + /// The inherited type + /// + /// + /// GetDerivedGenericTypes(assembly, typeof(DbContext)) + /// + /// + public static IEnumerable GetDerivedTypes(Assembly assembly, Type inheritedType) + { + foreach (var type in assembly.GetTypes()) + { + if(inheritedType.IsAssignableFrom(type)) + yield return type; + } + } + } +} diff --git a/src/JsonApiDotNetCore/Internal/Constants.cs b/src/JsonApiDotNetCore/Internal/Constants.cs new file mode 100644 index 0000000000..750d94ba07 --- /dev/null +++ b/src/JsonApiDotNetCore/Internal/Constants.cs @@ -0,0 +1,8 @@ +namespace JsonApiDotNetCore.Internal +{ + public static class Constants + { + public const string AcceptHeader = "Accept"; + public const string ContentType = "application/vnd.api+json"; + } +} diff --git a/src/JsonApiDotNetCore/Internal/ContextEntity.cs b/src/JsonApiDotNetCore/Internal/ContextEntity.cs index 4843d245c1..867a04350c 100644 --- a/src/JsonApiDotNetCore/Internal/ContextEntity.cs +++ b/src/JsonApiDotNetCore/Internal/ContextEntity.cs @@ -6,10 +6,42 @@ namespace JsonApiDotNetCore.Internal { public class ContextEntity { - public string EntityName { get; set; } + /// + /// The exposed resource name + /// + public string EntityName { + get; + set; } + + /// + /// The data model type + /// public Type EntityType { get; set; } + + /// + /// The identity member type + /// + public Type IdentityType { get; set; } + + /// + /// The concrete type. + /// We store this so that we don't need to re-compute the generic type. + /// + public Type ResourceType { get; set; } + + /// + /// Exposed resource attributes + /// public List Attributes { get; set; } + + /// + /// Exposed resource relationships + /// public List Relationships { get; set; } + + /// + /// Links to include in resource responses + /// public Link Links { get; set; } = Link.All; } } diff --git a/src/JsonApiDotNetCore/Internal/ContextGraph.cs b/src/JsonApiDotNetCore/Internal/ContextGraph.cs index aae5c2179b..9c62ae4d94 100644 --- a/src/JsonApiDotNetCore/Internal/ContextGraph.cs +++ b/src/JsonApiDotNetCore/Internal/ContextGraph.cs @@ -1,38 +1,62 @@ -using System.Reflection; +using System; using System.Collections.Generic; using System.Linq; -using System; namespace JsonApiDotNetCore.Internal { + public interface IContextGraph + { + object GetRelationship(TParent entity, string relationshipName); + string GetRelationshipName(string relationshipName); + ContextEntity GetContextEntity(string dbSetName); + ContextEntity GetContextEntity(Type entityType); + bool UsesDbContext { get; } + } + public class ContextGraph : IContextGraph { - public List Entities { get; set; } - public bool UsesDbContext { get; set; } + internal List Entities { get; } + internal List ValidationResults { get; } + internal static IContextGraph Instance { get; set; } - public ContextEntity GetContextEntity(string entityName) + public ContextGraph() { } + public ContextGraph(List entities, bool usesDbContext) { - return Entities - .FirstOrDefault(e => - e.EntityName.ToLower() == entityName.ToLower()); + Entities = entities; + UsesDbContext = usesDbContext; + ValidationResults = new List(); + Instance = this; } - public ContextEntity GetContextEntity(Type entityType) + // eventually, this is the planned public constructor + // to avoid breaking changes, we will be leaving the original constructor in place + // until the context graph validation process is completed + // you can track progress on this issue here: https://github.com/json-api-dotnet/JsonApiDotNetCore/issues/170 + internal ContextGraph(List entities, bool usesDbContext, List validationResults) { - return Entities - .FirstOrDefault(e => - e.EntityType == entityType); + Entities = entities; + UsesDbContext = usesDbContext; + ValidationResults = validationResults; + Instance = this; } + public bool UsesDbContext { get; } + + public ContextEntity GetContextEntity(string entityName) + => Entities.SingleOrDefault(e => string.Equals(e.EntityName, entityName, StringComparison.OrdinalIgnoreCase)); + + public ContextEntity GetContextEntity(Type entityType) + => Entities.SingleOrDefault(e => e.EntityType == entityType); + public object GetRelationship(TParent entity, string relationshipName) { var parentEntityType = entity.GetType(); var navigationProperty = parentEntityType .GetProperties() - .FirstOrDefault(p => p.Name.ToLower() == relationshipName.ToLower()); + .SingleOrDefault(p => string.Equals(p.Name, relationshipName, StringComparison.OrdinalIgnoreCase)); - if(navigationProperty == null) + if (navigationProperty == null) throw new JsonApiException(400, $"{parentEntityType} does not contain a relationship named {relationshipName}"); return navigationProperty.GetValue(entity); @@ -42,11 +66,9 @@ public string GetRelationshipName(string relationshipName) { var entityType = typeof(TParent); return Entities - .FirstOrDefault(e => - e.EntityType == entityType) - .Relationships - .FirstOrDefault(r => - r.PublicRelationshipName.ToLower() == relationshipName.ToLower()) + .SingleOrDefault(e => e.EntityType == entityType) + ?.Relationships + .SingleOrDefault(r => r.Is(relationshipName)) ?.InternalRelationshipName; } } diff --git a/src/JsonApiDotNetCore/Internal/Error.cs b/src/JsonApiDotNetCore/Internal/Error.cs index 0443e1edb7..999611d79e 100644 --- a/src/JsonApiDotNetCore/Internal/Error.cs +++ b/src/JsonApiDotNetCore/Internal/Error.cs @@ -1,4 +1,6 @@ using System; +using System.Diagnostics; +using JsonApiDotNetCore.Configuration; using Newtonsoft.Json; namespace JsonApiDotNetCore.Internal @@ -8,30 +10,40 @@ public class Error public Error() { } - public Error(string status, string title) + [Obsolete("Use Error constructors with int typed status")] + public Error(string status, string title, ErrorMeta meta = null, string source = null) { Status = status; Title = title; + Meta = meta; + Source = source; } - public Error(int status, string title) + public Error(int status, string title, ErrorMeta meta = null, string source = null) { Status = status.ToString(); Title = title; + Meta = meta; + Source = source; } - public Error(string status, string title, string detail) + [Obsolete("Use Error constructors with int typed status")] + public Error(string status, string title, string detail, ErrorMeta meta = null, string source = null) { Status = status; Title = title; Detail = detail; + Meta = meta; + Source = source; } - public Error(int status, string title, string detail) + public Error(int status, string title, string detail, ErrorMeta meta = null, string source = null) { Status = status.ToString(); Title = title; Detail = detail; + Meta = meta; + Source = source; } [JsonProperty("title")] @@ -45,5 +57,25 @@ public Error(int status, string title, string detail) [JsonIgnore] public int StatusCode => int.Parse(Status); + + [JsonProperty("source")] + public string Source { get; set; } + + [JsonProperty("meta")] + public ErrorMeta Meta { get; set; } + + public bool ShouldSerializeMeta() => (JsonApiOptions.DisableErrorStackTraces == false); + public bool ShouldSerializeSource() => (JsonApiOptions.DisableErrorSource == false); + } + + public class ErrorMeta + { + [JsonProperty("stackTrace")] + public string[] StackTrace { get; set; } + + public static ErrorMeta FromException(Exception e) + => new ErrorMeta { + StackTrace = e.Demystify().ToString().Split(new[] { "\n"}, int.MaxValue, StringSplitOptions.RemoveEmptyEntries) + }; } } diff --git a/src/JsonApiDotNetCore/Internal/Exceptions.cs b/src/JsonApiDotNetCore/Internal/Exceptions.cs new file mode 100644 index 0000000000..6c510e562b --- /dev/null +++ b/src/JsonApiDotNetCore/Internal/Exceptions.cs @@ -0,0 +1,11 @@ +namespace JsonApiDotNetCore.Internal +{ + internal static class Exceptions + { + private const string DOCUMENTATION_URL = "https://json-api-dotnet.github.io/#/errors/"; + private static string BuildUrl(string title) => DOCUMENTATION_URL + title; + + public static JsonApiException UnSupportedRequestMethod { get; } + = new JsonApiException(405, "Request method is not supported.", BuildUrl(nameof(UnSupportedRequestMethod))); + } +} diff --git a/src/JsonApiDotNetCore/Internal/Generics/GenericProcessor.cs b/src/JsonApiDotNetCore/Internal/Generics/GenericProcessor.cs index ce76b47dae..0a56fdfd4a 100644 --- a/src/JsonApiDotNetCore/Internal/Generics/GenericProcessor.cs +++ b/src/JsonApiDotNetCore/Internal/Generics/GenericProcessor.cs @@ -1,18 +1,24 @@ using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; -using JsonApiDotNetCore.Extensions; +using JsonApiDotNetCore.Data; using JsonApiDotNetCore.Models; using Microsoft.EntityFrameworkCore; namespace JsonApiDotNetCore.Internal.Generics { + public interface IGenericProcessor + { + Task UpdateRelationshipsAsync(object parent, RelationshipAttribute relationship, IEnumerable relationshipIds); + void SetRelationships(object parent, RelationshipAttribute relationship, IEnumerable relationshipIds); + } + public class GenericProcessor : IGenericProcessor where T : class, IIdentifiable { private readonly DbContext _context; - public GenericProcessor(DbContext context) + public GenericProcessor(IDbContextResolver contextResolver) { - _context = context; + _context = contextResolver.GetContext(); } public async Task UpdateRelationshipsAsync(object parent, RelationshipAttribute relationship, IEnumerable relationshipIds) @@ -26,12 +32,12 @@ public void SetRelationships(object parent, RelationshipAttribute relationship, { if (relationship.IsHasMany) { - var entities = _context.GetDbSet().Where(x => relationshipIds.Contains(x.StringId)).ToList(); + var entities = _context.Set().Where(x => relationshipIds.Contains(x.StringId)).ToList(); relationship.SetValue(parent, entities); } else { - var entity = _context.GetDbSet().SingleOrDefault(x => relationshipIds.First() == x.StringId); + var entity = _context.Set().SingleOrDefault(x => relationshipIds.First() == x.StringId); relationship.SetValue(parent, entity); } } diff --git a/src/JsonApiDotNetCore/Internal/Generics/GenericProcessorFactory.cs b/src/JsonApiDotNetCore/Internal/Generics/GenericProcessorFactory.cs index a238e4ef9f..5baa9615bb 100644 --- a/src/JsonApiDotNetCore/Internal/Generics/GenericProcessorFactory.cs +++ b/src/JsonApiDotNetCore/Internal/Generics/GenericProcessorFactory.cs @@ -1,24 +1,56 @@ +using JsonApiDotNetCore.Services; using System; -using Microsoft.EntityFrameworkCore; namespace JsonApiDotNetCore.Internal.Generics { + /// + /// Used to generate a generic operations processor when the types + /// are not known until runtime. The typical use case would be for + /// accessing relationship data or resolving operations processors. + /// + public interface IGenericProcessorFactory + { + /// + /// Constructs the generic type and locates the service, then casts to TInterface + /// + /// + /// + /// GetProcessor<IGenericProcessor>(typeof(GenericProcessor<>), typeof(TResource)); + /// + /// + TInterface GetProcessor(Type openGenericType, Type resourceType); + + /// + /// Constructs the generic type and locates the service, then casts to TInterface + /// + /// + /// + /// GetProcessor<IGenericProcessor>(typeof(GenericProcessor<,>), typeof(TResource), typeof(TId)); + /// + /// + TInterface GetProcessor(Type openGenericType, Type resourceType, Type keyType); + } + public class GenericProcessorFactory : IGenericProcessorFactory { - private readonly DbContext _dbContext; private readonly IServiceProvider _serviceProvider; - public GenericProcessorFactory(DbContext dbContext, - IServiceProvider serviceProvider) + public GenericProcessorFactory(IScopedServiceProvider serviceProvider) { - _dbContext = dbContext; _serviceProvider = serviceProvider; } - public IGenericProcessor GetProcessor(Type type) + public TInterface GetProcessor(Type openGenericType, Type resourceType) + => _getProcessor(openGenericType, resourceType); + + public TInterface GetProcessor(Type openGenericType, Type resourceType, Type keyType) + => _getProcessor(openGenericType, resourceType, keyType); + + private TInterface _getProcessor(Type openGenericType, params Type[] types) { - var processorType = typeof(GenericProcessor<>).MakeGenericType(type); - return (IGenericProcessor)_serviceProvider.GetService(processorType); + var concreteType = openGenericType.MakeGenericType(types); + + return (TInterface)_serviceProvider.GetService(concreteType); } } } diff --git a/src/JsonApiDotNetCore/Internal/Generics/IGenericProcessor.cs b/src/JsonApiDotNetCore/Internal/Generics/IGenericProcessor.cs deleted file mode 100644 index d05e47cb6c..0000000000 --- a/src/JsonApiDotNetCore/Internal/Generics/IGenericProcessor.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System.Collections.Generic; -using System.Threading.Tasks; -using JsonApiDotNetCore.Models; - -namespace JsonApiDotNetCore.Internal.Generics -{ - public interface IGenericProcessor - { - Task UpdateRelationshipsAsync(object parent, RelationshipAttribute relationship, IEnumerable relationshipIds); - void SetRelationships(object parent, RelationshipAttribute relationship, IEnumerable relationshipIds); - } -} diff --git a/src/JsonApiDotNetCore/Internal/Generics/IGenericProcessorFactory.cs b/src/JsonApiDotNetCore/Internal/Generics/IGenericProcessorFactory.cs deleted file mode 100644 index 83e794a12b..0000000000 --- a/src/JsonApiDotNetCore/Internal/Generics/IGenericProcessorFactory.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System; - -namespace JsonApiDotNetCore.Internal.Generics -{ - /// - /// Used to generate a generic operations processor when the types - /// are not know until runtime. The typical use case would be for - /// accessing relationship data. - /// - public interface IGenericProcessorFactory - { - IGenericProcessor GetProcessor(Type type); - } -} diff --git a/src/JsonApiDotNetCore/Internal/IContextGraph.cs b/src/JsonApiDotNetCore/Internal/IContextGraph.cs deleted file mode 100644 index 707d6fd32d..0000000000 --- a/src/JsonApiDotNetCore/Internal/IContextGraph.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System; - -namespace JsonApiDotNetCore.Internal -{ - public interface IContextGraph - { - object GetRelationship(TParent entity, string relationshipName); - string GetRelationshipName(string relationshipName); - ContextEntity GetContextEntity(string dbSetName); - ContextEntity GetContextEntity(Type entityType); - bool UsesDbContext { get; set; } - } -} diff --git a/src/JsonApiDotNetCore/Internal/JsonApiException.cs b/src/JsonApiDotNetCore/Internal/JsonApiException.cs index 9ce12fe428..8918d07c6c 100644 --- a/src/JsonApiDotNetCore/Internal/JsonApiException.cs +++ b/src/JsonApiDotNetCore/Internal/JsonApiException.cs @@ -8,50 +8,52 @@ public class JsonApiException : Exception private readonly ErrorCollection _errors = new ErrorCollection(); public JsonApiException(ErrorCollection errorCollection) - { + { _errors = errorCollection; } public JsonApiException(Error error) - : base(error.Title) - => _errors.Add(error); + : base(error.Title) => _errors.Add(error); [Obsolete("Use int statusCode overload instead")] - public JsonApiException(string statusCode, string message) + public JsonApiException(string statusCode, string message, string source = null) : base(message) - => _errors.Add(new Error(statusCode, message, null)); + => _errors.Add(new Error(statusCode, message, null, GetMeta(), source)); [Obsolete("Use int statusCode overload instead")] - public JsonApiException(string statusCode, string message, string detail) + public JsonApiException(string statusCode, string message, string detail, string source = null) : base(message) - => _errors.Add(new Error(statusCode, message, detail)); + => _errors.Add(new Error(statusCode, message, detail, GetMeta(), source)); - public JsonApiException(int statusCode, string message) + public JsonApiException(int statusCode, string message, string source = null) : base(message) - => _errors.Add(new Error(statusCode, message, null)); + => _errors.Add(new Error(statusCode, message, null, GetMeta(), source)); - public JsonApiException(int statusCode, string message, string detail) + public JsonApiException(int statusCode, string message, string detail, string source = null) : base(message) - => _errors.Add(new Error(statusCode, message, detail)); + => _errors.Add(new Error(statusCode, message, detail, GetMeta(), source)); public JsonApiException(int statusCode, string message, Exception innerException) : base(message, innerException) - => _errors.Add(new Error(statusCode, message, innerException.Message)); + => _errors.Add(new Error(statusCode, message, innerException.Message, GetMeta(innerException))); public ErrorCollection GetError() => _errors; public int GetStatusCode() { - if(_errors.Errors.Count == 1) + if (_errors.Errors.Count == 1) return _errors.Errors[0].StatusCode; - if(_errors.Errors.FirstOrDefault(e => e.StatusCode >= 500) != null) + if (_errors.Errors.FirstOrDefault(e => e.StatusCode >= 500) != null) return 500; - - if(_errors.Errors.FirstOrDefault(e => e.StatusCode >= 400) != null) + + if (_errors.Errors.FirstOrDefault(e => e.StatusCode >= 400) != null) return 400; - + return 500; } + + private ErrorMeta GetMeta() => ErrorMeta.FromException(this); + private ErrorMeta GetMeta(Exception e) => ErrorMeta.FromException(e); } } diff --git a/src/JsonApiDotNetCore/Internal/JsonApiExceptionFactory.cs b/src/JsonApiDotNetCore/Internal/JsonApiExceptionFactory.cs index 42f3037f89..159c9abc70 100644 --- a/src/JsonApiDotNetCore/Internal/JsonApiExceptionFactory.cs +++ b/src/JsonApiDotNetCore/Internal/JsonApiExceptionFactory.cs @@ -1,5 +1,4 @@ using System; -using System.Linq; namespace JsonApiDotNetCore.Internal { @@ -7,27 +6,20 @@ public static class JsonApiExceptionFactory { public static JsonApiException GetException(Exception exception) { - var exceptionType = exception.GetType().ToString().Split('.').Last(); - switch(exceptionType) - { - case "JsonApiException": - return (JsonApiException)exception; - case "InvalidCastException": - return new JsonApiException(409, exception.Message); - default: - return new JsonApiException(500, exception.Message, GetExceptionDetail(exception.InnerException)); - } - } + var exceptionType = exception.GetType(); - private static string GetExceptionDetail(Exception exception) - { - string detail = null; - while(exception != null) - { - detail = $"{detail}{exception.Message}; "; - exception = exception.InnerException; - } - return detail; + if (exceptionType == typeof(JsonApiException)) + return (JsonApiException)exception; + + // TODO: this is for mismatching type requests (e.g. posting an author to articles endpoint) + // however, we can't actually guarantee that this is the source of this exception + // we should probably use an action filter or when we improve the ContextGraph + // we might be able to skip most of deserialization entirely by checking the JToken + // directly + if (exceptionType == typeof(InvalidCastException)) + return new JsonApiException(409, exception.Message, exception); + + return new JsonApiException(500, exceptionType.Name, exception); } } } diff --git a/src/JsonApiDotNetCore/Internal/JsonApiRouteHandler.cs b/src/JsonApiDotNetCore/Internal/JsonApiRouteHandler.cs index 6675fc2879..132f8d2042 100644 --- a/src/JsonApiDotNetCore/Internal/JsonApiRouteHandler.cs +++ b/src/JsonApiDotNetCore/Internal/JsonApiRouteHandler.cs @@ -4,7 +4,6 @@ using JsonApiDotNetCore.Extensions; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.Infrastructure; -using Microsoft.AspNetCore.Mvc.Internal; using Microsoft.AspNetCore.Routing; namespace JsonApiDotNetCore.Internal diff --git a/src/JsonApiDotNetCore/Internal/PageManager.cs b/src/JsonApiDotNetCore/Internal/PageManager.cs index 124aaad6dd..d27fc158fd 100644 --- a/src/JsonApiDotNetCore/Internal/PageManager.cs +++ b/src/JsonApiDotNetCore/Internal/PageManager.cs @@ -6,33 +6,35 @@ namespace JsonApiDotNetCore.Internal { public class PageManager { - public int TotalRecords { get; set; } + public int? TotalRecords { get; set; } public int PageSize { get; set; } public int DefaultPageSize { get; set; } public int CurrentPage { get; set; } public bool IsPaginated => PageSize > 0; - public int TotalPages => (TotalRecords == 0) ? -1: (int)Math.Ceiling(decimal.Divide(TotalRecords, PageSize)); + public int TotalPages => (TotalRecords == null) ? -1 : (int)Math.Ceiling(decimal.Divide(TotalRecords.Value, PageSize)); public RootLinks GetPageLinks(LinkBuilder linkBuilder) - { - if(!IsPaginated || (CurrentPage == 1 && TotalPages <= 0)) + { + if (ShouldIncludeLinksObject()) return null; - + var rootLinks = new RootLinks(); - if(CurrentPage > 1) + if (CurrentPage > 1) rootLinks.First = linkBuilder.GetPageLink(1, PageSize); - if(CurrentPage > 1) + if (CurrentPage > 1) rootLinks.Prev = linkBuilder.GetPageLink(CurrentPage - 1, PageSize); - - if(CurrentPage < TotalPages) + + if (CurrentPage < TotalPages) rootLinks.Next = linkBuilder.GetPageLink(CurrentPage + 1, PageSize); - - if(TotalPages > 0) + + if (TotalPages > 0) rootLinks.Last = linkBuilder.GetPageLink(TotalPages, PageSize); return rootLinks; } + + private bool ShouldIncludeLinksObject() => (!IsPaginated || ((CurrentPage == 1 || CurrentPage == 0) && TotalPages <= 0)); } } diff --git a/src/JsonApiDotNetCore/Internal/Query/AttrFilterQuery.cs b/src/JsonApiDotNetCore/Internal/Query/AttrFilterQuery.cs index 8af2fe95e1..a914fea3a7 100644 --- a/src/JsonApiDotNetCore/Internal/Query/AttrFilterQuery.cs +++ b/src/JsonApiDotNetCore/Internal/Query/AttrFilterQuery.cs @@ -9,28 +9,29 @@ public class AttrFilterQuery : BaseFilterQuery private readonly IJsonApiContext _jsonApiContext; public AttrFilterQuery( - IJsonApiContext jsonApiCopntext, + IJsonApiContext jsonApiContext, FilterQuery filterQuery) { - _jsonApiContext = jsonApiCopntext; + _jsonApiContext = jsonApiContext; - var attribute = GetAttribute(filterQuery.Key); + var attribute = GetAttribute(filterQuery.Attribute); - FilteredAttribute = attribute ?? throw new JsonApiException(400, $"{filterQuery.Key} is not a valid property."); + if (attribute == null) + throw new JsonApiException(400, $"'{filterQuery.Attribute}' is not a valid attribute."); + + if (attribute.IsFilterable == false) + throw new JsonApiException(400, $"Filter is not allowed for attribute '{attribute.PublicAttributeName}'."); + + FilteredAttribute = attribute; PropertyValue = filterQuery.Value; FilterOperation = GetFilterOperation(filterQuery.Operation); } - public AttrAttribute FilteredAttribute { get; set; } - public string PropertyValue { get; set; } - public FilterOperations FilterOperation { get; set; } + public AttrAttribute FilteredAttribute { get; } + public string PropertyValue { get; } + public FilterOperations FilterOperation { get; } - private AttrAttribute GetAttribute(string propertyName) - { - return _jsonApiContext.RequestEntity.Attributes - .FirstOrDefault(attr => - attr.InternalAttributeName.ToLower() == propertyName.ToLower() - ); - } + private AttrAttribute GetAttribute(string attribute) => + _jsonApiContext.RequestEntity.Attributes.FirstOrDefault(attr => attr.Is(attribute)); } -} \ No newline at end of file +} diff --git a/src/JsonApiDotNetCore/Internal/Query/BaseFilterQuery.cs b/src/JsonApiDotNetCore/Internal/Query/BaseFilterQuery.cs index 527b842ca8..1c43d84254 100644 --- a/src/JsonApiDotNetCore/Internal/Query/BaseFilterQuery.cs +++ b/src/JsonApiDotNetCore/Internal/Query/BaseFilterQuery.cs @@ -8,10 +8,10 @@ protected FilterOperations GetFilterOperation(string prefix) { if (prefix.Length == 0) return FilterOperations.eq; - if (!Enum.TryParse(prefix, out FilterOperations opertion)) + if (Enum.TryParse(prefix, out FilterOperations opertion) == false) throw new JsonApiException(400, $"Invalid filter prefix '{prefix}'"); return opertion; } } -} \ No newline at end of file +} diff --git a/src/JsonApiDotNetCore/Internal/Query/FilterOperations.cs b/src/JsonApiDotNetCore/Internal/Query/FilterOperations.cs index 260dc32655..88a2da2ee8 100644 --- a/src/JsonApiDotNetCore/Internal/Query/FilterOperations.cs +++ b/src/JsonApiDotNetCore/Internal/Query/FilterOperations.cs @@ -8,6 +8,8 @@ public enum FilterOperations gt = 2, le = 3, ge = 4, - like = 5 + like = 5, + ne = 6, + @in = 7, // prefix with @ to use keyword } -} \ No newline at end of file +} diff --git a/src/JsonApiDotNetCore/Internal/Query/FilterQuery.cs b/src/JsonApiDotNetCore/Internal/Query/FilterQuery.cs index 7f4f1a40c6..dd72e827ff 100644 --- a/src/JsonApiDotNetCore/Internal/Query/FilterQuery.cs +++ b/src/JsonApiDotNetCore/Internal/Query/FilterQuery.cs @@ -1,17 +1,23 @@ +using System; +using JsonApiDotNetCore.Extensions; + namespace JsonApiDotNetCore.Internal.Query { public class FilterQuery { - public FilterQuery(string key, string value, string operation) + public FilterQuery(string attribute, string value, string operation) { - Key = key; + Attribute = attribute; + Key = attribute.ToProperCase(); Value = value; Operation = operation; } + [Obsolete("Key has been replaced by '" + nameof(Attribute) + "'. Members should be located by their public name, not by coercing the provided value to the internal name.")] public string Key { get; set; } + public string Attribute { get; } public string Value { get; set; } public string Operation { get; set; } - public bool IsAttributeOfRelationship => Key.Contains("."); + public bool IsAttributeOfRelationship => Attribute.Contains("."); } -} \ No newline at end of file +} diff --git a/src/JsonApiDotNetCore/Internal/Query/PageQuery.cs b/src/JsonApiDotNetCore/Internal/Query/PageQuery.cs index 8fe66d7d67..7c09d4c386 100644 --- a/src/JsonApiDotNetCore/Internal/Query/PageQuery.cs +++ b/src/JsonApiDotNetCore/Internal/Query/PageQuery.cs @@ -3,6 +3,6 @@ namespace JsonApiDotNetCore.Internal.Query public class PageQuery { public int PageSize { get; set; } - public int PageOffset { get; set; } + public int PageOffset { get; set; } = 1; } } \ No newline at end of file diff --git a/src/JsonApiDotNetCore/Internal/Query/QueryConstants.cs b/src/JsonApiDotNetCore/Internal/Query/QueryConstants.cs new file mode 100644 index 0000000000..3117ff7cb3 --- /dev/null +++ b/src/JsonApiDotNetCore/Internal/Query/QueryConstants.cs @@ -0,0 +1,15 @@ +namespace JsonApiDotNetCore.Internal.Query{ + public static class QueryConstants { + public const string FILTER = "filter"; + public const string SORT = "sort"; + public const string INCLUDE = "include"; + public const string PAGE = "page"; + public const string FIELDS = "fields"; + public const char OPEN_BRACKET = '['; + public const char CLOSE_BRACKET = ']'; + public const char COMMA = ','; + public const char COLON = ':'; + public const string COLON_STR = ":"; + + } +} \ No newline at end of file diff --git a/src/JsonApiDotNetCore/Internal/Query/QuerySet.cs b/src/JsonApiDotNetCore/Internal/Query/QuerySet.cs index acf448d69d..88aac1e67b 100644 --- a/src/JsonApiDotNetCore/Internal/Query/QuerySet.cs +++ b/src/JsonApiDotNetCore/Internal/Query/QuerySet.cs @@ -1,192 +1,13 @@ -using System; using System.Collections.Generic; -using System.Linq; -using JsonApiDotNetCore.Extensions; -using JsonApiDotNetCore.Services; -using Microsoft.AspNetCore.Http; -using JsonApiDotNetCore.Models; -using JsonApiDotNetCore.Controllers; namespace JsonApiDotNetCore.Internal.Query { public class QuerySet { - private readonly IJsonApiContext _jsonApiContext; - - public QuerySet( - IJsonApiContext jsonApiContext, - IQueryCollection query) - { - _jsonApiContext = jsonApiContext; - BuildQuerySet(query); - } - public List Filters { get; set; } = new List(); public PageQuery PageQuery { get; set; } = new PageQuery(); public List SortParameters { get; set; } = new List(); public List IncludedRelationships { get; set; } = new List(); public List Fields { get; set; } = new List(); - - private void BuildQuerySet(IQueryCollection query) - { - var disabledQueries = _jsonApiContext.GetControllerAttribute()?.QueryParams ?? QueryParams.None; - - foreach (var pair in query) - { - if (pair.Key.StartsWith("filter")) - { - if (disabledQueries.HasFlag(QueryParams.Filter) == false) - Filters.AddRange(ParseFilterQuery(pair.Key, pair.Value)); - continue; - } - - if (pair.Key.StartsWith("sort")) - { - if (disabledQueries.HasFlag(QueryParams.Sort) == false) - SortParameters = ParseSortParameters(pair.Value); - continue; - } - - if (pair.Key.StartsWith("include")) - { - if (disabledQueries.HasFlag(QueryParams.Include) == false) - IncludedRelationships = ParseIncludedRelationships(pair.Value); - continue; - } - - if (pair.Key.StartsWith("page")) - { - if (disabledQueries.HasFlag(QueryParams.Page) == false) - PageQuery = ParsePageQuery(pair.Key, pair.Value); - continue; - } - - if (pair.Key.StartsWith("fields")) - { - if (disabledQueries.HasFlag(QueryParams.Fields) == false) - Fields = ParseFieldsQuery(pair.Key, pair.Value); - continue; - } - - throw new JsonApiException(400, $"{pair} is not a valid query."); - } - } - - private List ParseFilterQuery(string key, string value) - { - // expected input = filter[id]=1 - // expected input = filter[id]=eq:1 - var queries = new List(); - - var propertyName = key.Split('[', ']')[1].ToProperCase(); - - var values = value.Split(','); - foreach (var val in values) - { - (var operation, var filterValue) = ParseFilterOperation(val); - queries.Add(new FilterQuery(propertyName, filterValue, operation)); - } - - return queries; - } - - private (string operation, string value) ParseFilterOperation(string value) - { - if (value.Length < 3) - return (string.Empty, value); - - var operation = value.Split(':'); - - if (operation.Length == 1) - return (string.Empty, value); - - // remove prefix from value - if(Enum.TryParse(operation[0], out FilterOperations op) == false) - return (string.Empty, value); - - var prefix = operation[0]; - value = string.Join(":", operation.Skip(1)); - - return (prefix, value); - } - - private PageQuery ParsePageQuery(string key, string value) - { - // expected input = page[size]=10 - // page[number]=1 - PageQuery = PageQuery ?? new PageQuery(); - - var propertyName = key.Split('[', ']')[1]; - - if (propertyName == "size") - PageQuery.PageSize = Convert.ToInt32(value); - else if (propertyName == "number") - PageQuery.PageOffset = Convert.ToInt32(value); - - return PageQuery; - } - - // sort=id,name - // sort=-id - private List ParseSortParameters(string value) - { - var sortParameters = new List(); - value.Split(',').ToList().ForEach(p => - { - var direction = SortDirection.Ascending; - if (p[0] == '-') - { - direction = SortDirection.Descending; - p = p.Substring(1); - } - - var attribute = GetAttribute(p.ToProperCase()); - - sortParameters.Add(new SortQuery(direction, attribute)); - }); - - return sortParameters; - } - - private List ParseIncludedRelationships(string value) - { - if (value.Contains(".")) - throw new JsonApiException(400, "Deeply nested relationships are not supported"); - - return value - .Split(',') - .ToList(); - } - - private List ParseFieldsQuery(string key, string value) - { - // expected: fields[TYPE]=prop1,prop2 - var typeName = key.Split('[', ']')[1]; - - var includedFields = new List { "Id" }; - - if (typeName != _jsonApiContext.RequestEntity.EntityName) - return includedFields; - - var fields = value.Split(','); - foreach (var field in fields) - { - var internalAttrName = _jsonApiContext.RequestEntity - .Attributes - .SingleOrDefault(attr => attr.PublicAttributeName == field) - .InternalAttributeName; - includedFields.Add(internalAttrName); - } - - return includedFields; - } - - private AttrAttribute GetAttribute(string propertyName) - { - return _jsonApiContext.RequestEntity.Attributes - .FirstOrDefault(attr => - attr.InternalAttributeName.ToLower() == propertyName.ToLower() - ); - } } } \ No newline at end of file diff --git a/src/JsonApiDotNetCore/Internal/Query/RelatedAttrFilterQuery.cs b/src/JsonApiDotNetCore/Internal/Query/RelatedAttrFilterQuery.cs index dc633c5302..9b117c0913 100644 --- a/src/JsonApiDotNetCore/Internal/Query/RelatedAttrFilterQuery.cs +++ b/src/JsonApiDotNetCore/Internal/Query/RelatedAttrFilterQuery.cs @@ -7,23 +7,27 @@ namespace JsonApiDotNetCore.Internal.Query public class RelatedAttrFilterQuery : BaseFilterQuery { private readonly IJsonApiContext _jsonApiContext; - + public RelatedAttrFilterQuery( - IJsonApiContext jsonApiCopntext, + IJsonApiContext jsonApiContext, FilterQuery filterQuery) { - _jsonApiContext = jsonApiCopntext; - - var relationshipArray = filterQuery.Key.Split('.'); + _jsonApiContext = jsonApiContext; + var relationshipArray = filterQuery.Attribute.Split('.'); var relationship = GetRelationship(relationshipArray[0]); if (relationship == null) - throw new JsonApiException(400, $"{relationshipArray[0]} is not a valid relationship."); + throw new JsonApiException(400, $"{relationshipArray[1]} is not a valid relationship on {relationshipArray[0]}."); var attribute = GetAttribute(relationship, relationshipArray[1]); + if (attribute == null) + throw new JsonApiException(400, $"'{filterQuery.Attribute}' is not a valid attribute."); + + if (attribute.IsFilterable == false) + throw new JsonApiException(400, $"Filter is not allowed for attribute '{attribute.PublicAttributeName}'."); FilteredRelationship = relationship; - FilteredAttribute = attribute ?? throw new JsonApiException(400, $"{relationshipArray[1]} is not a valid attribute on {relationshipArray[0]}."); + FilteredAttribute = attribute; PropertyValue = filterQuery.Value; FilterOperation = GetFilterOperation(filterQuery.Operation); } @@ -34,16 +38,13 @@ public RelatedAttrFilterQuery( public RelationshipAttribute FilteredRelationship { get; } private RelationshipAttribute GetRelationship(string propertyName) - { - return _jsonApiContext.RequestEntity.Relationships - .FirstOrDefault(r => r.InternalRelationshipName.ToLower() == propertyName.ToLower()); - } + => _jsonApiContext.RequestEntity.Relationships.FirstOrDefault(r => r.Is(propertyName)); private AttrAttribute GetAttribute(RelationshipAttribute relationship, string attribute) { var relatedContextExntity = _jsonApiContext.ContextGraph.GetContextEntity(relationship.Type); return relatedContextExntity.Attributes - .FirstOrDefault(a => a.InternalAttributeName.ToLower() == attribute.ToLower()); + .FirstOrDefault(a => a.Is(attribute)); } } -} \ No newline at end of file +} diff --git a/src/JsonApiDotNetCore/Internal/TypeHelper.cs b/src/JsonApiDotNetCore/Internal/TypeHelper.cs index cc64b398dd..0a3e01d0d1 100644 --- a/src/JsonApiDotNetCore/Internal/TypeHelper.cs +++ b/src/JsonApiDotNetCore/Internal/TypeHelper.cs @@ -1,10 +1,20 @@ using System; +using System.Collections; +using System.Collections.Generic; using System.Reflection; namespace JsonApiDotNetCore.Internal { public static class TypeHelper { + public static IList ConvertCollection(IEnumerable collection, Type targetType) + { + var list = Activator.CreateInstance(typeof(List<>).MakeGenericType(targetType)) as IList; + foreach(var item in collection) + list.Add(ConvertType(item, targetType)); + return list; + } + public static object ConvertType(object value, Type type) { if (value == null) @@ -54,5 +64,23 @@ public static T ConvertType(object value) { return (T)ConvertType(value, typeof(T)); } + + /// + /// Convert collection of query string params to Collection of concrete Type + /// + /// Collection like ["10","20","30"] + /// Non array type. For e.g. int + /// Collection of concrete type + public static IList ConvertListType(IEnumerable values, Type type) + { + var listType = typeof(List<>).MakeGenericType(type); + IList list = (IList)Activator.CreateInstance(listType); + foreach (var value in values) + { + list.Add(ConvertType(value, type)); + } + + return list; + } } } diff --git a/src/JsonApiDotNetCore/Internal/ValidationResults.cs b/src/JsonApiDotNetCore/Internal/ValidationResults.cs new file mode 100644 index 0000000000..fbaa6eb462 --- /dev/null +++ b/src/JsonApiDotNetCore/Internal/ValidationResults.cs @@ -0,0 +1,16 @@ +using Microsoft.Extensions.Logging; + +namespace JsonApiDotNetCore.Internal +{ + internal class ValidationResult + { + public ValidationResult(LogLevel logLevel, string message) + { + LogLevel = logLevel; + Message = message; + } + + public LogLevel LogLevel { get; set; } + public string Message { get; set; } + } +} diff --git a/src/JsonApiDotNetCore/JsonApiDotNetCore.csproj b/src/JsonApiDotNetCore/JsonApiDotNetCore.csproj index 26e3d12ed3..7ec6a0bf87 100755 --- a/src/JsonApiDotNetCore/JsonApiDotNetCore.csproj +++ b/src/JsonApiDotNetCore/JsonApiDotNetCore.csproj @@ -1,23 +1,48 @@ - + - 2.2.0 + 3.0.0 $(NetStandardVersion) JsonApiDotNetCore JsonApiDotNetCore + 7.2 + jsonapi;dotnet core;emberjs;ember - https://github.com/Research-Institute/json-api-dotnet-core - https://raw.githubusercontent.com/Research-Institute/json-api-dotnet-core/master/LICENSE + https://github.com/json-api-dotnet/JsonApiDotNetCore + https://github.com/json-api-dotnet/JsonApiDotNetCore/master/LICENSE false git - https://github.com/Research-Institute/json-api-dotnet-core + https://github.com/json-api-dotnet/JsonApiDotNetCore + true + true + $(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb + + + - + + + + + + + + true + true + bin\Release\netstandard2.0\JsonApiDotNetCore.xml + + + + + + diff --git a/src/JsonApiDotNetCore/Middleware/RequestMiddleware.cs b/src/JsonApiDotNetCore/Middleware/RequestMiddleware.cs index 670def21d6..ab472a8dba 100644 --- a/src/JsonApiDotNetCore/Middleware/RequestMiddleware.cs +++ b/src/JsonApiDotNetCore/Middleware/RequestMiddleware.cs @@ -1,4 +1,7 @@ +using System; using System.Threading.Tasks; +using JsonApiDotNetCore.Internal; +using JsonApiDotNetCore.Services; using Microsoft.AspNetCore.Http; using Microsoft.Extensions.Primitives; @@ -7,16 +10,23 @@ namespace JsonApiDotNetCore.Middleware public class RequestMiddleware { private readonly RequestDelegate _next; - + public RequestMiddleware(RequestDelegate next) { _next = next; } - public async Task Invoke(HttpContext context) + public async Task Invoke(HttpContext context, IJsonApiContext jsonApiContext) { if (IsValid(context)) + { + // HACK: this currently results in allocation of + // objects that may or may not be used and even double allocation + // since the JsonApiContext is using field initializers + // Need to work on finding a better solution. + jsonApiContext.BeginOperation(); await _next(context); + } } private static bool IsValid(HttpContext context) @@ -37,7 +47,7 @@ private static bool IsValidContentTypeHeader(HttpContext context) private static bool IsValidAcceptHeader(HttpContext context) { - if (context.Request.Headers.TryGetValue("Accept", out StringValues acceptHeaders) == false) + if (context.Request.Headers.TryGetValue(Constants.AcceptHeader, out StringValues acceptHeaders) == false) return true; foreach (var acceptHeader in acceptHeaders) @@ -51,10 +61,23 @@ private static bool IsValidAcceptHeader(HttpContext context) return true; } - private static bool ContainsMediaTypeParameters(string mediaType) + internal static bool ContainsMediaTypeParameters(string mediaType) { - var mediaTypeArr = mediaType.Split(';'); - return (mediaTypeArr[0] == "application/vnd.api+json" && mediaTypeArr.Length == 2); + var incomingMediaTypeSpan = mediaType.AsSpan(); + + // if the content type is not application/vnd.api+json then continue on + if (incomingMediaTypeSpan.Length < Constants.ContentType.Length) + return false; + + var incomingContentType = incomingMediaTypeSpan.Slice(0, Constants.ContentType.Length); + if (incomingContentType.SequenceEqual(Constants.ContentType.AsSpan()) == false) + return false; + + // anything appended to "application/vnd.api+json;" will be considered a media type param + return ( + incomingMediaTypeSpan.Length >= Constants.ContentType.Length + 2 + && incomingMediaTypeSpan[Constants.ContentType.Length] == ';' + ); } private static void FlushResponse(HttpContext context, int statusCode) diff --git a/src/JsonApiDotNetCore/Models/AttrAttribute.cs b/src/JsonApiDotNetCore/Models/AttrAttribute.cs index f84fd229ef..d5a30221bb 100644 --- a/src/JsonApiDotNetCore/Models/AttrAttribute.cs +++ b/src/JsonApiDotNetCore/Models/AttrAttribute.cs @@ -6,10 +6,32 @@ namespace JsonApiDotNetCore.Models { public class AttrAttribute : Attribute { - public AttrAttribute(string publicName, bool isImmutable = false) + /// + /// Defines a public attribute exposed by the API + /// + /// + /// How this attribute is exposed through the API + /// Prevent PATCH requests from updating the value + /// Prevent filters on this attribute + /// Prevent this attribute from being sorted by + /// + /// + /// + /// + /// public class Author : Identifiable + /// { + /// [Attr("name")] + /// public string Name { get; set; } + /// } + /// + /// + /// + public AttrAttribute(string publicName, bool isImmutable = false, bool isFilterable = true, bool isSortable = true) { PublicAttributeName = publicName; IsImmutable = isImmutable; + IsFilterable = isFilterable; + IsSortable = isSortable; } public AttrAttribute(string publicName, string internalName, bool isImmutable = false) @@ -19,30 +41,99 @@ public AttrAttribute(string publicName, string internalName, bool isImmutable = IsImmutable = isImmutable; } - public string PublicAttributeName { get; set; } - public string InternalAttributeName { get; set; } - public bool IsImmutable { get; set; } + /// + /// How this attribute is exposed through the API + /// + public string PublicAttributeName { get; } + /// + /// The internal property name this attribute belongs to. + /// + public string InternalAttributeName { get; internal set; } + + /// + /// Prevents PATCH requests from updating the value. + /// + public bool IsImmutable { get; } + + /// + /// Whether or not this attribute can be filtered on via a query string filters. + /// Attempts to filter on an attribute with `IsFilterable == false` will return + /// an HTTP 400 response. + /// + public bool IsFilterable { get; } + + /// + /// Whether or not this attribute can be sorted on via a query string sort. + /// Attempts to filter on an attribute with `IsSortable == false` will return + /// an HTTP 400 response. + /// + public bool IsSortable { get; } + + /// + /// The member property info + /// + internal PropertyInfo PropertyInfo { get; set; } + + /// + /// Get the value of the attribute for the given object. + /// Returns null if the attribute does not belong to the + /// provided object. + /// public object GetValue(object entity) { - return entity - .GetType() - .GetProperty(InternalAttributeName) - .GetValue(entity); + if (entity == null) + throw new InvalidOperationException("Cannot GetValue from null object."); + + var prop = GetResourceProperty(entity); + return prop?.GetValue(entity); } + /// + /// Sets the value of the attribute on the given object. + /// public void SetValue(object entity, object newValue) { - var propertyInfo = entity - .GetType() - .GetProperty(InternalAttributeName); + if (entity == null) + throw new InvalidOperationException("Cannot SetValue on null object."); - if (propertyInfo != null) + var prop = GetResourceProperty(entity); + if(prop != null) { - var convertedValue = TypeHelper.ConvertType(newValue, propertyInfo.PropertyType); + var convertedValue = TypeHelper.ConvertType(newValue, prop.PropertyType); + prop.SetValue(entity, convertedValue); + } + } - propertyInfo.SetValue(entity, convertedValue); + private PropertyInfo GetResourceProperty(object resource) + { + // There are some scenarios, especially ones where users are using a different + // data model than view model, where they may use a repository implmentation + // that does not match the deserialized type. For now, we will continue to support + // this use case. + var targetType = resource.GetType(); + if (targetType != PropertyInfo.DeclaringType) + { + var propertyInfo = resource + .GetType() + .GetProperty(InternalAttributeName); + + return propertyInfo; + + // TODO: this should throw but will be a breaking change in some cases + //if (propertyInfo == null) + // throw new InvalidOperationException( + // $"'{targetType}' does not contain a member named '{InternalAttributeName}'." + + // $"There is also a mismatch in target types. Expected '{PropertyInfo.DeclaringType}' but instead received '{targetType}'."); } + + return PropertyInfo; } + + /// + /// Whether or not the provided exposed name is equivalent to the one defined in on the model + /// + public virtual bool Is(string publicRelationshipName) + => string.Equals(publicRelationshipName, PublicAttributeName, StringComparison.OrdinalIgnoreCase); } } diff --git a/src/JsonApiDotNetCore/Models/DocumentBase.cs b/src/JsonApiDotNetCore/Models/DocumentBase.cs index 1cb31595ec..eb38f9582d 100644 --- a/src/JsonApiDotNetCore/Models/DocumentBase.cs +++ b/src/JsonApiDotNetCore/Models/DocumentBase.cs @@ -5,29 +5,13 @@ namespace JsonApiDotNetCore.Models { public class DocumentBase { - [JsonProperty("links")] + [JsonProperty("links", NullValueHandling = NullValueHandling.Ignore)] public RootLinks Links { get; set; } - [JsonProperty("included")] + [JsonProperty("included", NullValueHandling = NullValueHandling.Ignore)] public List Included { get; set; } - [JsonProperty("meta")] + [JsonProperty("meta", NullValueHandling = NullValueHandling.Ignore)] public Dictionary Meta { get; set; } - - // http://www.newtonsoft.com/json/help/html/ConditionalProperties.htm - public bool ShouldSerializeIncluded() - { - return (Included != null); - } - - public bool ShouldSerializeMeta() - { - return (Meta != null); - } - - public bool ShouldSerializeLinks() - { - return (Links != null); - } } } diff --git a/src/JsonApiDotNetCore/Models/DocumentData.cs b/src/JsonApiDotNetCore/Models/DocumentData.cs index 32ca6f3f51..ba1ce646c0 100644 --- a/src/JsonApiDotNetCore/Models/DocumentData.cs +++ b/src/JsonApiDotNetCore/Models/DocumentData.cs @@ -1,20 +1,5 @@ -using System.Collections.Generic; -using Newtonsoft.Json; - namespace JsonApiDotNetCore.Models { - public class DocumentData - { - [JsonProperty("type")] - public string Type { get; set; } - - [JsonProperty("id")] - public string Id { get; set; } - - [JsonProperty("attributes")] - public Dictionary Attributes { get; set; } - - [JsonProperty("relationships")] - public Dictionary Relationships { get; set; } - } + // TODO: deprecate DocumentData in favor of ResourceObject + public class DocumentData : ResourceObject { } } diff --git a/src/JsonApiDotNetCore/Models/HasManyAttribute.cs b/src/JsonApiDotNetCore/Models/HasManyAttribute.cs index 379458014b..877df29146 100644 --- a/src/JsonApiDotNetCore/Models/HasManyAttribute.cs +++ b/src/JsonApiDotNetCore/Models/HasManyAttribute.cs @@ -1,22 +1,42 @@ -using System.Reflection; - namespace JsonApiDotNetCore.Models { public class HasManyAttribute : RelationshipAttribute { - public HasManyAttribute(string publicName, Link documentLinks = Link.All) - : base(publicName, documentLinks) - { - PublicRelationshipName = publicName; - } + /// + /// Create a HasMany relational link to another entity + /// + /// + /// The relationship name as exposed by the API + /// Which links are available. Defaults to + /// Whether or not this relationship can be included using the ?include=public-name query string + /// + /// + /// + /// + /// public class Author : Identifiable + /// { + /// [HasMany("articles"] + /// public virtual List
Articles { get; set; } + /// } + /// + /// + /// + public HasManyAttribute(string publicName, Link documentLinks = Link.All, bool canInclude = true) + : base(publicName, documentLinks, canInclude) + { } + /// + /// Sets the value of the property identified by this attribute + /// + /// The target object + /// The new property value public override void SetValue(object entity, object newValue) { var propertyInfo = entity .GetType() .GetProperty(InternalRelationshipName); - - propertyInfo.SetValue(entity, newValue); + + propertyInfo.SetValue(entity, newValue); } } } diff --git a/src/JsonApiDotNetCore/Models/HasOneAttribute.cs b/src/JsonApiDotNetCore/Models/HasOneAttribute.cs index 296b71369e..77422027a7 100644 --- a/src/JsonApiDotNetCore/Models/HasOneAttribute.cs +++ b/src/JsonApiDotNetCore/Models/HasOneAttribute.cs @@ -1,26 +1,78 @@ -using System.Reflection; - namespace JsonApiDotNetCore.Models { public class HasOneAttribute : RelationshipAttribute { - public HasOneAttribute(string publicName, Link documentLinks = Link.All) - : base(publicName, documentLinks) + /// + /// Create a HasOne relational link to another entity + /// + /// + /// The relationship name as exposed by the API + /// Which links are available. Defaults to + /// Whether or not this relationship can be included using the ?include=public-name query string + /// The foreign key property name. Defaults to "{RelationshipName}Id" + /// + /// + /// Using an alternative foreign key: + /// + /// + /// public class Article : Identifiable + /// { + /// [HasOne("author", withForiegnKey: nameof(AuthorKey)] + /// public Author Author { get; set; } + /// public int AuthorKey { get; set; } + /// } + /// + /// + /// + public HasOneAttribute(string publicName, Link documentLinks = Link.All, bool canInclude = true, string withForiegnKey = null) + : base(publicName, documentLinks, canInclude) { - PublicRelationshipName = publicName; + _explicitIdentifiablePropertyName = withForiegnKey; } + private readonly string _explicitIdentifiablePropertyName; + + /// + /// The independent entity identifier. + /// + public string IdentifiablePropertyName => string.IsNullOrWhiteSpace(_explicitIdentifiablePropertyName) + ? $"{InternalRelationshipName}Id" + : _explicitIdentifiablePropertyName; + + /// + /// Sets the value of the property identified by this attribute + /// + /// The target object + /// The new property value public override void SetValue(object entity, object newValue) { - var propertyName = (newValue.GetType() == Type) - ? InternalRelationshipName - : $"{InternalRelationshipName}Id"; - + var propertyName = (newValue?.GetType() == Type) + ? InternalRelationshipName + : IdentifiablePropertyName; + var propertyInfo = entity .GetType() .GetProperty(propertyName); - + propertyInfo.SetValue(entity, newValue); } + + // HACK: this will likely require boxing + // we should be able to move some of the reflection into the ContextGraphBuilder + /// + /// Gets the value of the independent identifier (e.g. Article.AuthorId) + /// + /// + /// + /// An instance of dependent resource + /// + /// + /// + /// The property value or null if the property does not exist on the model. + /// + internal object GetIdentifiablePropertyValue(object entity) => entity + .GetType() + .GetProperty(IdentifiablePropertyName) + ?.GetValue(entity); } } diff --git a/src/JsonApiDotNetCore/Models/Identifiable.cs b/src/JsonApiDotNetCore/Models/Identifiable.cs index 0adb073f2f..703cc2f051 100644 --- a/src/JsonApiDotNetCore/Models/Identifiable.cs +++ b/src/JsonApiDotNetCore/Models/Identifiable.cs @@ -15,7 +15,7 @@ public class Identifiable : IIdentifiable public string StringId { get => GetStringId(Id); - set => Id = (T)GetConcreteId(value); + set => Id = GetTypedId(value); } protected virtual string GetStringId(object value) @@ -34,6 +34,13 @@ protected virtual string GetStringId(object value) : stringValue; } + protected virtual T GetTypedId(string value) + { + var convertedValue = TypeHelper.ConvertType(value, typeof(T)); + return convertedValue == null ? default : (T)convertedValue; + } + + [Obsolete("Use GetTypedId instead")] protected virtual object GetConcreteId(string value) { return TypeHelper.ConvertType(value, typeof(T)); diff --git a/src/JsonApiDotNetCore/Models/JsonApiExtension.cs b/src/JsonApiDotNetCore/Models/JsonApiExtension.cs new file mode 100644 index 0000000000..7d3b0c87ea --- /dev/null +++ b/src/JsonApiDotNetCore/Models/JsonApiExtension.cs @@ -0,0 +1,7 @@ +namespace JsonApiDotNetCore.Models +{ + public enum JsonApiExtension + { + Operations = 0 + } +} diff --git a/src/JsonApiDotNetCore/Models/Operations/Operation.cs b/src/JsonApiDotNetCore/Models/Operations/Operation.cs new file mode 100644 index 0000000000..38c544eabc --- /dev/null +++ b/src/JsonApiDotNetCore/Models/Operations/Operation.cs @@ -0,0 +1,72 @@ +using System.Collections.Generic; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; + +namespace JsonApiDotNetCore.Models.Operations +{ + public class Operation : DocumentBase + { + [JsonProperty("op"), JsonConverter(typeof(StringEnumConverter))] + public OperationCode Op { get; set; } + + [JsonProperty("ref", NullValueHandling = NullValueHandling.Ignore)] + public ResourceReference Ref { get; set; } + + [JsonProperty("params", NullValueHandling = NullValueHandling.Ignore)] + public Params Params { get; set; } + + [JsonProperty("data")] + public object Data + { + get + { + if (DataIsList) return DataList; + return DataObject; + } + set => SetData(value); + } + + private void SetData(object data) + { + if (data is JArray jArray) + { + DataIsList = true; + DataList = jArray.ToObject>(); + } + else if (data is List dataList) + { + DataIsList = true; + DataList = dataList; + } + else if (data is JObject jObject) + { + DataObject = jObject.ToObject(); + } + else if (data is DocumentData dataObject) + { + DataObject = dataObject; + } + } + + [JsonIgnore] + public bool DataIsList { get; private set; } + + [JsonIgnore] + public List DataList { get; private set; } + + [JsonIgnore] + public DocumentData DataObject { get; private set; } + + public string GetResourceTypeName() + { + if (Ref != null) + return Ref.Type?.ToString(); + + if (DataIsList) + return DataList[0].Type?.ToString(); + + return DataObject.Type?.ToString(); + } + } +} diff --git a/src/JsonApiDotNetCore/Models/Operations/OperationCode.cs b/src/JsonApiDotNetCore/Models/Operations/OperationCode.cs new file mode 100644 index 0000000000..6b6905cd59 --- /dev/null +++ b/src/JsonApiDotNetCore/Models/Operations/OperationCode.cs @@ -0,0 +1,14 @@ +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; + +namespace JsonApiDotNetCore.Models.Operations +{ + [JsonConverter(typeof(StringEnumConverter))] + public enum OperationCode + { + get = 1, + add = 2, + update = 3, + remove = 4 + } +} diff --git a/src/JsonApiDotNetCore/Models/Operations/OperationsDocument.cs b/src/JsonApiDotNetCore/Models/Operations/OperationsDocument.cs new file mode 100644 index 0000000000..3228e9ca88 --- /dev/null +++ b/src/JsonApiDotNetCore/Models/Operations/OperationsDocument.cs @@ -0,0 +1,17 @@ +using System.Collections.Generic; +using Newtonsoft.Json; + +namespace JsonApiDotNetCore.Models.Operations +{ + public class OperationsDocument + { + public OperationsDocument() { } + public OperationsDocument(List operations) + { + Operations = operations; + } + + [JsonProperty("operations")] + public List Operations { get; set; } + } +} diff --git a/src/JsonApiDotNetCore/Models/Operations/Params.cs b/src/JsonApiDotNetCore/Models/Operations/Params.cs new file mode 100644 index 0000000000..470e8f4aa3 --- /dev/null +++ b/src/JsonApiDotNetCore/Models/Operations/Params.cs @@ -0,0 +1,13 @@ +using System.Collections.Generic; + +namespace JsonApiDotNetCore.Models.Operations +{ + public class Params + { + public List Include { get; set; } + public List Sort { get; set; } + public Dictionary Filter { get; set; } + public string Page { get; set; } + public Dictionary Fields { get; set; } + } +} diff --git a/src/JsonApiDotNetCore/Models/Operations/ResourceReference.cs b/src/JsonApiDotNetCore/Models/Operations/ResourceReference.cs new file mode 100644 index 0000000000..5291d61a19 --- /dev/null +++ b/src/JsonApiDotNetCore/Models/Operations/ResourceReference.cs @@ -0,0 +1,10 @@ +using Newtonsoft.Json; + +namespace JsonApiDotNetCore.Models.Operations +{ + public class ResourceReference : ResourceIdentifierObject + { + [JsonProperty("relationship")] + public string Relationship { get; set; } + } +} diff --git a/src/JsonApiDotNetCore/Models/RelationshipAttribute.cs b/src/JsonApiDotNetCore/Models/RelationshipAttribute.cs index 93662032a5..65a170281e 100644 --- a/src/JsonApiDotNetCore/Models/RelationshipAttribute.cs +++ b/src/JsonApiDotNetCore/Models/RelationshipAttribute.cs @@ -1,21 +1,56 @@ -using System; +using System; namespace JsonApiDotNetCore.Models { public abstract class RelationshipAttribute : Attribute { - protected RelationshipAttribute(string publicName, Link documentLinks) + protected RelationshipAttribute(string publicName, Link documentLinks, bool canInclude) { PublicRelationshipName = publicName; DocumentLinks = documentLinks; + CanInclude = canInclude; } - public string PublicRelationshipName { get; set; } - public string InternalRelationshipName { get; set; } - public Type Type { get; set; } + public string PublicRelationshipName { get; } + public string InternalRelationshipName { get; internal set; } + + /// + /// The related entity type. This does not necessarily match the navigation property type. + /// In the case of a HasMany relationship, this value will be the generic argument type. + /// + /// + /// + /// + /// public List<Articles> Articles { get; set; } // Type => Article + /// + /// + public Type Type { get; internal set; } public bool IsHasMany => GetType() == typeof(HasManyAttribute); public bool IsHasOne => GetType() == typeof(HasOneAttribute); - public Link DocumentLinks { get; set; } = Link.All; + public Link DocumentLinks { get; } = Link.All; + public bool CanInclude { get; } + + public bool TryGetHasOne(out HasOneAttribute result) + { + if (IsHasOne) + { + result = (HasOneAttribute)this; + return true; + } + result = null; + return false; + } + + public bool TryGetHasMany(out HasManyAttribute result) + { + if (IsHasMany) + { + result = (HasManyAttribute)this; + return true; + } + result = null; + return false; + } public abstract void SetValue(object entity, object newValue); @@ -26,12 +61,17 @@ public override string ToString() public override bool Equals(object obj) { - var attr = obj as RelationshipAttribute; - if (attr == null) + if (!(obj is RelationshipAttribute attr)) { return false; } return IsHasMany == attr.IsHasMany && PublicRelationshipName.Equals(attr.PublicRelationshipName); } + + /// + /// Whether or not the provided exposed name is equivalent to the one defined in on the model + /// + public virtual bool Is(string publicRelationshipName) + => string.Equals(publicRelationshipName, PublicRelationshipName, StringComparison.OrdinalIgnoreCase); } } diff --git a/src/JsonApiDotNetCore/Models/RelationshipData.cs b/src/JsonApiDotNetCore/Models/RelationshipData.cs index 21efa7409c..1cfe47c5c7 100644 --- a/src/JsonApiDotNetCore/Models/RelationshipData.cs +++ b/src/JsonApiDotNetCore/Models/RelationshipData.cs @@ -1,4 +1,3 @@ -using System.Collections; using System.Collections.Generic; using Newtonsoft.Json; using Newtonsoft.Json.Linq; @@ -11,29 +10,41 @@ public class RelationshipData public Links Links { get; set; } [JsonProperty("data")] - public object ExposedData { - get { - if(ManyData != null) + public object ExposedData + { + get + { + if (ManyData != null) return ManyData; return SingleData; } - set { - if(value is IEnumerable) - if(value is JObject jObject) - SingleData = jObject.ToObject>(); - else if(value is JArray jArray) - ManyData = jArray.ToObject>>(); - else - ManyData = (List>)value; + set + { + if (value is JObject jObject) + SingleData = jObject.ToObject(); + else if (value is ResourceIdentifierObject dict) + SingleData = (ResourceIdentifierObject)value; else - SingleData = (Dictionary)value; + SetManyData(value); } - } + } + + private void SetManyData(object value) + { + IsHasMany = true; + if (value is JArray jArray) + ManyData = jArray.ToObject>(); + else + ManyData = (List)value; + } + + [JsonIgnore] + public List ManyData { get; set; } [JsonIgnore] - public List> ManyData { get; set; } - + public ResourceIdentifierObject SingleData { get; set; } + [JsonIgnore] - public Dictionary SingleData { get; set; } + public bool IsHasMany { get; private set; } } } diff --git a/src/JsonApiDotNetCore/Models/ResourceDefinition.cs b/src/JsonApiDotNetCore/Models/ResourceDefinition.cs new file mode 100644 index 0000000000..64ff918116 --- /dev/null +++ b/src/JsonApiDotNetCore/Models/ResourceDefinition.cs @@ -0,0 +1,107 @@ +using JsonApiDotNetCore.Internal; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Linq.Expressions; +using System.Reflection; + +namespace JsonApiDotNetCore.Models +{ + public interface IResourceDefinition + { + List GetOutputAttrs(object instance); + } + + /// + /// A scoped service used to... + /// + /// The resource type + public class ResourceDefinition : IResourceDefinition where T : class, IIdentifiable + { + private readonly IContextGraph _graph; + private readonly ContextEntity _contextEntity; + internal readonly bool _instanceAttrsAreSpecified; + + private bool _requestCachedAttrsHaveBeenLoaded = false; + private List _requestCachedAttrs; + + public ResourceDefinition() + { + _graph = ContextGraph.Instance; + _contextEntity = ContextGraph.Instance.GetContextEntity(typeof(T)); + _instanceAttrsAreSpecified = InstanceOutputAttrsAreSpecified(); + } + + private bool InstanceOutputAttrsAreSpecified() + { + var derivedType = GetType(); + var methods = derivedType.GetMethods(BindingFlags.NonPublic | BindingFlags.Instance); + var instanceMethod = methods + .Where(m => + m.Name == nameof(OutputAttrs) + && m.GetParameters() + .FirstOrDefault() + ?.ParameterType == typeof(T)) + .FirstOrDefault(); + var declaringType = instanceMethod?.DeclaringType; + return declaringType == derivedType; + } + + // TODO: need to investigate options for caching these + protected List Remove(Expression> filter, List from = null) + { + from = from ?? _contextEntity.Attributes; + + // model => model.Attribute + if (filter.Body is MemberExpression memberExpression) + return _contextEntity.Attributes + .Where(a => a.InternalAttributeName != memberExpression.Member.Name) + .ToList(); + + // model => new { model.Attribute1, model.Attribute2 } + if (filter.Body is NewExpression newExpression) + { + var attributes = new List(); + foreach (var attr in _contextEntity.Attributes) + if (newExpression.Members.Any(m => m.Name == attr.InternalAttributeName) == false) + attributes.Add(attr); + + return attributes; + } + + throw new JsonApiException(500, + message: $"The expression returned by '{filter}' for '{GetType()}' is of type {filter.Body.GetType()}" + + " and cannot be used to select resource attributes. ", + detail: "The type must be a NewExpression. Example: article => new { article.Author }; "); + } + + /// + /// Called once per filtered resource in request. + /// + protected virtual List OutputAttrs() => _contextEntity.Attributes; + + /// + /// Called for every instance of a resource + /// + protected virtual List OutputAttrs(T instance) => _contextEntity.Attributes; + + public List GetOutputAttrs(object instance) + => _instanceAttrsAreSpecified == false + ? GetOutputAttrs() + : OutputAttrs(instance as T); + + private List GetOutputAttrs() + { + if (_requestCachedAttrsHaveBeenLoaded == false) + { + _requestCachedAttrs = OutputAttrs(); + // the reason we don't just check for null is because we + // guarantee that OutputAttrs will be called once per + // request and null is a valid return value + _requestCachedAttrsHaveBeenLoaded = true; + } + + return _requestCachedAttrs; + } + } +} diff --git a/src/JsonApiDotNetCore/Models/ResourceIdentifierObject.cs b/src/JsonApiDotNetCore/Models/ResourceIdentifierObject.cs new file mode 100644 index 0000000000..1ebab6c474 --- /dev/null +++ b/src/JsonApiDotNetCore/Models/ResourceIdentifierObject.cs @@ -0,0 +1,16 @@ +using Newtonsoft.Json; + +namespace JsonApiDotNetCore.Models +{ + public class ResourceIdentifierObject + { + [JsonProperty("type")] + public string Type { get; set; } + + [JsonProperty("id")] + public string Id { get; set; } + + [JsonProperty("lid")] + public string LocalId { get; set; } + } +} diff --git a/src/JsonApiDotNetCore/Models/ResourceObject.cs b/src/JsonApiDotNetCore/Models/ResourceObject.cs new file mode 100644 index 0000000000..1a28631407 --- /dev/null +++ b/src/JsonApiDotNetCore/Models/ResourceObject.cs @@ -0,0 +1,14 @@ +using System.Collections.Generic; +using Newtonsoft.Json; + +namespace JsonApiDotNetCore.Models +{ + public class ResourceObject : ResourceIdentifierObject + { + [JsonProperty("attributes")] + public Dictionary Attributes { get; set; } + + [JsonProperty("relationships", NullValueHandling = NullValueHandling.Ignore)] + public Dictionary Relationships { get; set; } + } +} diff --git a/src/JsonApiDotNetCore/Request/HasManyRelationshipPointers.cs b/src/JsonApiDotNetCore/Request/HasManyRelationshipPointers.cs new file mode 100644 index 0000000000..04056e4af8 --- /dev/null +++ b/src/JsonApiDotNetCore/Request/HasManyRelationshipPointers.cs @@ -0,0 +1,49 @@ +using System.Collections; +using System.Collections.Generic; +using JsonApiDotNetCore.Models; + +namespace JsonApiDotNetCore.Request +{ + /// + /// Stores information to set relationships for the request resource. + /// These relationships must already exist and should not be re-created. + /// + /// The expected use case is POST-ing or PATCH-ing + /// an entity with HasMany relaitonships: + /// + /// { + /// "data": { + /// "type": "photos", + /// "attributes": { + /// "title": "Ember Hamster", + /// "src": "http://example.com/images/productivity.png" + /// }, + /// "relationships": { + /// "tags": { + /// "data": [ + /// { "type": "tags", "id": "2" }, + /// { "type": "tags", "id": "3" } + /// ] + /// } + /// } + /// } + /// } + /// + /// + public class HasManyRelationshipPointers + { + private Dictionary _hasManyRelationships = new Dictionary(); + + /// + /// Add the relationship to the list of relationships that should be + /// set in the repository layer. + /// + public void Add(RelationshipAttribute relationship, IList entities) + => _hasManyRelationships[relationship] = entities; + + /// + /// Get all the models that should be associated + /// + public Dictionary Get() => _hasManyRelationships; + } +} diff --git a/src/JsonApiDotNetCore/Request/HasOneRelationshipPointers.cs b/src/JsonApiDotNetCore/Request/HasOneRelationshipPointers.cs new file mode 100644 index 0000000000..753aa35e98 --- /dev/null +++ b/src/JsonApiDotNetCore/Request/HasOneRelationshipPointers.cs @@ -0,0 +1,45 @@ +using JsonApiDotNetCore.Models; +using System.Collections.Generic; + +namespace JsonApiDotNetCore.Request +{ + /// + /// Stores information to set relationships for the request resource. + /// These relationships must already exist and should not be re-created. + /// + /// The expected use case is POST-ing or PATCH-ing + /// an entity with HasOne relationships: + /// + /// { + /// "data": { + /// "type": "photos", + /// "attributes": { + /// "title": "Ember Hamster", + /// "src": "http://example.com/images/productivity.png" + /// }, + /// "relationships": { + /// "photographer": { + /// "data": { "type": "people", "id": "2" } + /// } + /// } + /// } + /// } + /// + /// + public class HasOneRelationshipPointers + { + private Dictionary _hasOneRelationships = new Dictionary(); + + /// + /// Add the relationship to the list of relationships that should be + /// set in the repository layer. + /// + public void Add(RelationshipAttribute relationship, IIdentifiable entity) + => _hasOneRelationships[relationship] = entity; + + /// + /// Get all the models that should be associated + /// + public Dictionary Get() => _hasOneRelationships; + } +} diff --git a/src/JsonApiDotNetCore/Serialization/IJsonApiDeSerializer.cs b/src/JsonApiDotNetCore/Serialization/IJsonApiDeSerializer.cs index 02f84a747a..57b28c6087 100644 --- a/src/JsonApiDotNetCore/Serialization/IJsonApiDeSerializer.cs +++ b/src/JsonApiDotNetCore/Serialization/IJsonApiDeSerializer.cs @@ -1,11 +1,14 @@ using System.Collections.Generic; +using JsonApiDotNetCore.Models; namespace JsonApiDotNetCore.Serialization { public interface IJsonApiDeSerializer { object Deserialize(string requestBody); + TEntity Deserialize(string requestBody); object DeserializeRelationship(string requestBody); List DeserializeList(string requestBody); + object DocumentToObject(DocumentData data, List included = null); } -} \ No newline at end of file +} diff --git a/src/JsonApiDotNetCore/Serialization/JsonApiDeSerializer.cs b/src/JsonApiDotNetCore/Serialization/JsonApiDeSerializer.cs index dc7e515561..22bbe86543 100644 --- a/src/JsonApiDotNetCore/Serialization/JsonApiDeSerializer.cs +++ b/src/JsonApiDotNetCore/Serialization/JsonApiDeSerializer.cs @@ -2,9 +2,11 @@ using System.Collections.Generic; using System.Linq; using System.Reflection; +using JsonApiDotNetCore.Extensions; using JsonApiDotNetCore.Internal; using JsonApiDotNetCore.Internal.Generics; using JsonApiDotNetCore.Models; +using JsonApiDotNetCore.Models.Operations; using JsonApiDotNetCore.Services; using Newtonsoft.Json; using Newtonsoft.Json.Linq; @@ -14,32 +16,62 @@ namespace JsonApiDotNetCore.Serialization public class JsonApiDeSerializer : IJsonApiDeSerializer { private readonly IJsonApiContext _jsonApiContext; - private readonly IGenericProcessorFactory _genericProcessorFactory; + [Obsolete( + "The deserializer no longer depends on the IGenericProcessorFactory", + error: false)] public JsonApiDeSerializer( IJsonApiContext jsonApiContext, IGenericProcessorFactory genericProcessorFactory) { _jsonApiContext = jsonApiContext; - _genericProcessorFactory = genericProcessorFactory; + } + + public JsonApiDeSerializer(IJsonApiContext jsonApiContext) + { + _jsonApiContext = jsonApiContext; } public object Deserialize(string requestBody) { try { - var document = JsonConvert.DeserializeObject(requestBody); - var entity = DocumentToObject(document.Data); + var bodyJToken = JToken.Parse(requestBody); + + if (RequestIsOperation(bodyJToken)) + { + _jsonApiContext.IsBulkOperationRequest = true; + + // TODO: determine whether or not the token should be re-used rather than performing full + // deserialization again from the string + var operations = JsonConvert.DeserializeObject(requestBody); + if (operations == null) + throw new JsonApiException(400, "Failed to deserialize operations request."); + + return operations; + } + + var document = bodyJToken.ToObject(); + + _jsonApiContext.DocumentMeta = document.Meta; + var entity = DocumentToObject(document.Data, document.Included); return entity; } + catch (JsonApiException) + { + throw; + } catch (Exception e) { throw new JsonApiException(400, "Failed to deserialize request body", e); } } - public TEntity Deserialize(string requestBody) - => (TEntity)Deserialize(requestBody); + private bool RequestIsOperation(JToken bodyJToken) + => _jsonApiContext.Options.EnableOperations + && (bodyJToken.SelectToken("operations") != null); + + public TEntity Deserialize(string requestBody) => (TEntity)Deserialize(requestBody); public object DeserializeRelationship(string requestBody) { @@ -67,8 +99,8 @@ public List DeserializeList(string requestBody) var deserializedList = new List(); foreach (var data in documents.Data) { - var entity = DocumentToObject(data); - deserializedList.Add((TEntity)entity); + var entity = (TEntity)DocumentToObject(data, documents.Included); + deserializedList.Add(entity); } return deserializedList; @@ -79,20 +111,27 @@ public List DeserializeList(string requestBody) } } - private object DocumentToObject(DocumentData data) + public object DocumentToObject(DocumentData data, List included = null) { - var contextEntity = _jsonApiContext.ContextGraph.GetContextEntity(data.Type); - _jsonApiContext.RequestEntity = contextEntity; + if (data == null) + throw new JsonApiException(422, "Failed to deserialize document as json:api."); + + var contextEntity = _jsonApiContext.ContextGraph.GetContextEntity(data.Type?.ToString()); + _jsonApiContext.RequestEntity = contextEntity ?? throw new JsonApiException(400, + message: $"This API does not contain a json:api resource named '{data.Type}'.", + detail: "This resource is not registered on the ContextGraph. " + + "If you are using Entity Framework, make sure the DbSet matches the expected resource name. " + + "If you have manually registered the resource, check that the call to AddResource correctly sets the public name."); var entity = Activator.CreateInstance(contextEntity.EntityType); entity = SetEntityAttributes(entity, contextEntity, data.Attributes); - entity = SetRelationships(entity, contextEntity, data.Relationships); + entity = SetRelationships(entity, contextEntity, data.Relationships, included); var identifiableEntity = (IIdentifiable)entity; if (data.Id != null) - identifiableEntity.StringId = data.Id; + identifiableEntity.StringId = data.Id?.ToString(); return identifiableEntity; } @@ -103,21 +142,14 @@ private object SetEntityAttributes( if (attributeValues == null || attributeValues.Count == 0) return entity; - var entityProperties = entity.GetType().GetProperties(); - foreach (var attr in contextEntity.Attributes) { - var entityProperty = entityProperties.FirstOrDefault(p => p.Name == attr.InternalAttributeName); - - if (entityProperty == null) - throw new ArgumentException($"{contextEntity.EntityType.Name} does not contain an attribute named {attr.InternalAttributeName}", nameof(entity)); - if (attributeValues.TryGetValue(attr.PublicAttributeName, out object newValue)) { - var convertedValue = ConvertAttrValue(newValue, entityProperty.PropertyType); - entityProperty.SetValue(entity, convertedValue); + var convertedValue = ConvertAttrValue(newValue, attr.PropertyInfo.PropertyType); + attr.SetValue(entity, convertedValue); - if(attr.IsImmutable == false) + if (attr.IsImmutable == false) _jsonApiContext.AttributesToUpdate[attr] = convertedValue; } } @@ -136,18 +168,14 @@ private object ConvertAttrValue(object newValue, Type targetType) private object DeserializeComplexType(JContainer obj, Type targetType) { - var serializerSettings = new JsonSerializerSettings - { - ContractResolver = _jsonApiContext.Options.JsonContractResolver - }; - - return obj.ToObject(targetType, JsonSerializer.Create(serializerSettings)); + return obj.ToObject(targetType, JsonSerializer.Create(_jsonApiContext.Options.SerializerSettings)); } private object SetRelationships( object entity, ContextEntity contextEntity, - Dictionary relationships) + Dictionary relationships, + List included = null) { if (relationships == null || relationships.Count == 0) return entity; @@ -157,8 +185,8 @@ private object SetRelationships( foreach (var attr in contextEntity.Relationships) { entity = attr.IsHasOne - ? SetHasOneRelationship(entity, entityProperties, attr, contextEntity, relationships) - : SetHasManyRelationship(entity, entityProperties, attr, contextEntity, relationships); + ? SetHasOneRelationship(entity, entityProperties, (HasOneAttribute)attr, contextEntity, relationships, included) + : SetHasManyRelationship(entity, entityProperties, attr, contextEntity, relationships, included); } return entity; @@ -166,32 +194,60 @@ private object SetRelationships( private object SetHasOneRelationship(object entity, PropertyInfo[] entityProperties, - RelationshipAttribute attr, + HasOneAttribute attr, ContextEntity contextEntity, - Dictionary relationships) + Dictionary relationships, + List included = null) { - var entityProperty = entityProperties.FirstOrDefault(p => p.Name == $"{attr.InternalRelationshipName}Id"); + var relationshipName = attr.PublicRelationshipName; - if (entityProperty == null) - throw new JsonApiException(400, $"{contextEntity.EntityType.Name} does not contain an relationsip named {attr.InternalRelationshipName}"); + if (relationships.TryGetValue(relationshipName, out RelationshipData relationshipData) == false) + return entity; - var relationshipName = attr.PublicRelationshipName; + var relationshipAttr = _jsonApiContext.RequestEntity.Relationships + .SingleOrDefault(r => r.PublicRelationshipName == relationshipName); - if (relationships.TryGetValue(relationshipName, out RelationshipData relationshipData)) - { - var relationshipAttr = _jsonApiContext.RequestEntity.Relationships - .SingleOrDefault(r => r.PublicRelationshipName == relationshipName); + if (relationshipAttr == null) + throw new JsonApiException(400, $"{_jsonApiContext.RequestEntity.EntityName} does not contain a relationship '{relationshipName}'"); - var data = (Dictionary)relationshipData.ExposedData; + var rio = (ResourceIdentifierObject)relationshipData.ExposedData; - if (data == null) return entity; + var foreignKey = attr.IdentifiablePropertyName; + var foreignKeyProperty = entityProperties.FirstOrDefault(p => p.Name == foreignKey); - var newValue = data["id"]; - var convertedValue = TypeHelper.ConvertType(newValue, entityProperty.PropertyType); + if (foreignKeyProperty == null && rio == null) + return entity; - _jsonApiContext.RelationshipsToUpdate[relationshipAttr] = convertedValue; + if (foreignKeyProperty == null && rio != null) + throw new JsonApiException(400, $"{contextEntity.EntityType.Name} does not contain a foreign key property '{foreignKey}' for has one relationship '{attr.InternalRelationshipName}'"); - entityProperty.SetValue(entity, convertedValue); + // e.g. PATCH /articles + // {... { "relationships":{ "Owner": { "data": null } } } } + if (rio == null && Nullable.GetUnderlyingType(foreignKeyProperty.PropertyType) == null) + throw new JsonApiException(400, $"Cannot set required relationship identifier '{attr.IdentifiablePropertyName}' to null because it is a non-nullable type."); + + var newValue = rio?.Id ?? null; + var convertedValue = TypeHelper.ConvertType(newValue, foreignKeyProperty.PropertyType); + + _jsonApiContext.RelationshipsToUpdate[relationshipAttr] = convertedValue; + + foreignKeyProperty.SetValue(entity, convertedValue); + + + if (rio != null + // if the resource identifier is null, there should be no reason to instantiate an instance + && rio.Id != null) + { + // we have now set the FK property on the resource, now we need to check to see if the + // related entity was included in the payload and update its attributes + var includedRelationshipObject = GetIncludedRelationship(rio, included, relationshipAttr); + if (includedRelationshipObject != null) + relationshipAttr.SetValue(entity, includedRelationshipObject); + + // we need to store the fact that this relationship was included in the payload + // for EF, the repository will use these pointers to make ensure we don't try to + // create resources if they already exist, we just need to create the relationship + _jsonApiContext.HasOneRelationshipPointers.Add(attr, includedRelationshipObject); } return entity; @@ -201,27 +257,67 @@ private object SetHasManyRelationship(object entity, PropertyInfo[] entityProperties, RelationshipAttribute attr, ContextEntity contextEntity, - Dictionary relationships) + Dictionary relationships, + List included = null) { - var entityProperty = entityProperties.FirstOrDefault(p => p.Name == attr.InternalRelationshipName); - - if (entityProperty == null) - throw new JsonApiException(400, $"{contextEntity.EntityType.Name} does not contain an relationsip named {attr.InternalRelationshipName}"); - var relationshipName = attr.PublicRelationshipName; if (relationships.TryGetValue(relationshipName, out RelationshipData relationshipData)) { - var data = (List>)relationshipData.ExposedData; + var data = (List)relationshipData.ExposedData; if (data == null) return entity; - var genericProcessor = _genericProcessorFactory.GetProcessor(attr.Type); - var ids = relationshipData.ManyData.Select(r => r["id"]); - genericProcessor.SetRelationships(entity, attr, ids); + var relatedResources = relationshipData.ManyData.Select(r => + { + var instance = GetIncludedRelationship(r, included, attr); + return instance; + }); + + var convertedCollection = TypeHelper.ConvertCollection(relatedResources, attr.Type); + + attr.SetValue(entity, convertedCollection); + + _jsonApiContext.HasManyRelationshipPointers.Add(attr, convertedCollection); } return entity; } + + private IIdentifiable GetIncludedRelationship(ResourceIdentifierObject relatedResourceIdentifier, List includedResources, RelationshipAttribute relationshipAttr) + { + // at this point we can be sure the relationshipAttr.Type is IIdentifiable because we were able to successfully build the ContextGraph + var relatedInstance = relationshipAttr.Type.New(); + relatedInstance.StringId = relatedResourceIdentifier.Id; + + // can't provide any more data other than the rio since it is not contained in the included section + if (includedResources == null || includedResources.Count == 0) + return relatedInstance; + + var includedResource = GetLinkedResource(relatedResourceIdentifier, includedResources); + if (includedResource == null) + return relatedInstance; + + var contextEntity = _jsonApiContext.ContextGraph.GetContextEntity(relationshipAttr.Type); + if (contextEntity == null) + throw new JsonApiException(400, $"Included type '{relationshipAttr.Type}' is not a registered json:api resource."); + + SetEntityAttributes(relatedInstance, contextEntity, includedResource.Attributes); + + return relatedInstance; + } + + private DocumentData GetLinkedResource(ResourceIdentifierObject relatedResourceIdentifier, List includedResources) + { + try + { + return includedResources.SingleOrDefault(r => r.Type == relatedResourceIdentifier.Type && r.Id == relatedResourceIdentifier.Id); + } + catch (InvalidOperationException e) + { + throw new JsonApiException(400, $"A compound document MUST NOT include more than one resource object for each type and id pair." + + $"The duplicate pair was '{relatedResourceIdentifier.Type}, {relatedResourceIdentifier.Id}'", e); + } + } } } diff --git a/src/JsonApiDotNetCore/Serialization/JsonApiSerializer.cs b/src/JsonApiDotNetCore/Serialization/JsonApiSerializer.cs index a7e14341b0..a784554f58 100644 --- a/src/JsonApiDotNetCore/Serialization/JsonApiSerializer.cs +++ b/src/JsonApiDotNetCore/Serialization/JsonApiSerializer.cs @@ -13,18 +13,18 @@ public class JsonApiSerializer : IJsonApiSerializer private readonly IDocumentBuilder _documentBuilder; private readonly ILogger _logger; private readonly IJsonApiContext _jsonApiContext; - + public JsonApiSerializer( IJsonApiContext jsonApiContext, IDocumentBuilder documentBuilder) { _jsonApiContext = jsonApiContext; - _documentBuilder = documentBuilder; + _documentBuilder = documentBuilder; } public JsonApiSerializer( IJsonApiContext jsonApiContext, - IDocumentBuilder documentBuilder, + IDocumentBuilder documentBuilder, ILoggerFactory loggerFactory) { _jsonApiContext = jsonApiContext; @@ -37,13 +37,16 @@ public string Serialize(object entity) if (entity == null) return GetNullDataResponse(); - if (entity.GetType() == typeof(ErrorCollection) || _jsonApiContext.RequestEntity == null) + if (entity.GetType() == typeof(ErrorCollection) || (_jsonApiContext.RequestEntity == null && _jsonApiContext.IsBulkOperationRequest == false)) return GetErrorJson(entity, _logger); + if (_jsonApiContext.IsBulkOperationRequest) + return _serialize(entity); + if (entity is IEnumerable) return SerializeDocuments(entity); - return SerializeDocument(entity); + return SerializeDocument(entity); } private string GetNullDataResponse() @@ -62,7 +65,11 @@ private string GetErrorJson(object responseObject, ILogger logger) } else { - logger?.LogInformation("Response was not a JSONAPI entity. Serializing as plain JSON."); + if (logger?.IsEnabled(LogLevel.Information) == true) + { + logger.LogInformation("Response was not a JSONAPI entity. Serializing as plain JSON."); + } + return JsonConvert.SerializeObject(responseObject); } } @@ -83,10 +90,7 @@ private string SerializeDocument(object entity) private string _serialize(object obj) { - return JsonConvert.SerializeObject(obj, new JsonSerializerSettings { - NullValueHandling = NullValueHandling.Ignore, - ContractResolver = _jsonApiContext.Options.JsonContractResolver - }); + return JsonConvert.SerializeObject(obj, _jsonApiContext.Options.SerializerSettings); } } } diff --git a/src/JsonApiDotNetCore/Services/Contract/ICreateService.cs b/src/JsonApiDotNetCore/Services/Contract/ICreateService.cs index a4c0cd6cbb..df4916856d 100644 --- a/src/JsonApiDotNetCore/Services/Contract/ICreateService.cs +++ b/src/JsonApiDotNetCore/Services/Contract/ICreateService.cs @@ -1,4 +1,3 @@ -using System.Collections.Generic; using System.Threading.Tasks; using JsonApiDotNetCore.Models; diff --git a/src/JsonApiDotNetCore/Services/Contract/IDeleteService.cs b/src/JsonApiDotNetCore/Services/Contract/IDeleteService.cs index 4ba09fdf40..52e4ca17f4 100644 --- a/src/JsonApiDotNetCore/Services/Contract/IDeleteService.cs +++ b/src/JsonApiDotNetCore/Services/Contract/IDeleteService.cs @@ -1,4 +1,3 @@ -using System.Collections.Generic; using System.Threading.Tasks; using JsonApiDotNetCore.Models; diff --git a/src/JsonApiDotNetCore/Services/Contract/IGetByIdService.cs b/src/JsonApiDotNetCore/Services/Contract/IGetByIdService.cs index 27761abd5d..c01c6a1391 100644 --- a/src/JsonApiDotNetCore/Services/Contract/IGetByIdService.cs +++ b/src/JsonApiDotNetCore/Services/Contract/IGetByIdService.cs @@ -1,4 +1,3 @@ -using System.Collections.Generic; using System.Threading.Tasks; using JsonApiDotNetCore.Models; diff --git a/src/JsonApiDotNetCore/Services/Contract/IGetRelationshipService.cs b/src/JsonApiDotNetCore/Services/Contract/IGetRelationshipService.cs index bd9c0b2be0..de32b77547 100644 --- a/src/JsonApiDotNetCore/Services/Contract/IGetRelationshipService.cs +++ b/src/JsonApiDotNetCore/Services/Contract/IGetRelationshipService.cs @@ -1,4 +1,3 @@ -using System.Collections.Generic; using System.Threading.Tasks; using JsonApiDotNetCore.Models; diff --git a/src/JsonApiDotNetCore/Services/Contract/IGetRelationshipsService.cs b/src/JsonApiDotNetCore/Services/Contract/IGetRelationshipsService.cs index a61cf8f7ac..e519d0b4d1 100644 --- a/src/JsonApiDotNetCore/Services/Contract/IGetRelationshipsService.cs +++ b/src/JsonApiDotNetCore/Services/Contract/IGetRelationshipsService.cs @@ -1,4 +1,3 @@ -using System.Collections.Generic; using System.Threading.Tasks; using JsonApiDotNetCore.Models; diff --git a/src/JsonApiDotNetCore/Services/Contract/IResourceCmdService.cs b/src/JsonApiDotNetCore/Services/Contract/IResourceCmdService.cs index 2633fd589b..0f6c5e64b7 100644 --- a/src/JsonApiDotNetCore/Services/Contract/IResourceCmdService.cs +++ b/src/JsonApiDotNetCore/Services/Contract/IResourceCmdService.cs @@ -2,7 +2,12 @@ namespace JsonApiDotNetCore.Services { - public interface IResourceCmdService : IResourceCmdService + public interface IResourceCmdService : + ICreateService, + IUpdateService, + IUpdateRelationshipService, + IDeleteService, + IResourceCmdService where T : class, IIdentifiable { } diff --git a/src/JsonApiDotNetCore/Services/Contract/IResourceQueryService.cs b/src/JsonApiDotNetCore/Services/Contract/IResourceQueryService.cs index 8a9e247a3f..1cd4a94cf3 100644 --- a/src/JsonApiDotNetCore/Services/Contract/IResourceQueryService.cs +++ b/src/JsonApiDotNetCore/Services/Contract/IResourceQueryService.cs @@ -2,7 +2,12 @@ namespace JsonApiDotNetCore.Services { - public interface IResourceQueryService : IResourceQueryService + public interface IResourceQueryService : + IGetAllService, + IGetByIdService, + IGetRelationshipsService, + IGetRelationshipService, + IResourceQueryService where T : class, IIdentifiable { } diff --git a/src/JsonApiDotNetCore/Services/Contract/IResourceService.cs b/src/JsonApiDotNetCore/Services/Contract/IResourceService.cs index 82f3505c78..ec534a5f1b 100644 --- a/src/JsonApiDotNetCore/Services/Contract/IResourceService.cs +++ b/src/JsonApiDotNetCore/Services/Contract/IResourceService.cs @@ -3,7 +3,7 @@ namespace JsonApiDotNetCore.Services { public interface IResourceService - : IResourceService + : IResourceCmdService, IResourceQueryService, IResourceService where T : class, IIdentifiable { } diff --git a/src/JsonApiDotNetCore/Services/Contract/IUpdateService.cs b/src/JsonApiDotNetCore/Services/Contract/IUpdateService.cs index ca2e171090..bd5f13dd60 100644 --- a/src/JsonApiDotNetCore/Services/Contract/IUpdateService.cs +++ b/src/JsonApiDotNetCore/Services/Contract/IUpdateService.cs @@ -1,4 +1,3 @@ -using System.Collections.Generic; using System.Threading.Tasks; using JsonApiDotNetCore.Models; diff --git a/src/JsonApiDotNetCore/Services/ControllerContext.cs b/src/JsonApiDotNetCore/Services/ControllerContext.cs new file mode 100644 index 0000000000..1984262b15 --- /dev/null +++ b/src/JsonApiDotNetCore/Services/ControllerContext.cs @@ -0,0 +1,25 @@ +using System; +using System.Reflection; +using JsonApiDotNetCore.Internal; + +namespace JsonApiDotNetCore.Services +{ + public interface IControllerContext + { + Type ControllerType { get; set; } + ContextEntity RequestEntity { get; set; } + TAttribute GetControllerAttribute() where TAttribute : Attribute; + } + + public class ControllerContext : IControllerContext + { + public Type ControllerType { get; set; } + public ContextEntity RequestEntity { get; set; } + + public TAttribute GetControllerAttribute() where TAttribute : Attribute + { + var attribute = ControllerType.GetTypeInfo().GetCustomAttribute(typeof(TAttribute)); + return attribute == null ? null : (TAttribute)attribute; + } + } +} \ No newline at end of file diff --git a/src/JsonApiDotNetCore/Services/EntityResourceService.cs b/src/JsonApiDotNetCore/Services/EntityResourceService.cs index 43a72a1a76..a3094eb8f9 100644 --- a/src/JsonApiDotNetCore/Services/EntityResourceService.cs +++ b/src/JsonApiDotNetCore/Services/EntityResourceService.cs @@ -4,9 +4,7 @@ using JsonApiDotNetCore.Data; using JsonApiDotNetCore.Extensions; using JsonApiDotNetCore.Internal; -using JsonApiDotNetCore.Internal.Query; using JsonApiDotNetCore.Models; -using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Logging; namespace JsonApiDotNetCore.Services @@ -41,60 +39,64 @@ public EntityResourceService( _logger = loggerFactory.CreateLogger>(); } - public async Task> GetAsync() + public virtual async Task> GetAsync() { var entities = _entities.Get(); entities = ApplySortAndFilterQuery(entities); - if (_jsonApiContext.QuerySet?.IncludedRelationships != null && _jsonApiContext.QuerySet.IncludedRelationships.Count > 0) + if (ShouldIncludeRelationships()) entities = IncludeRelationships(entities, _jsonApiContext.QuerySet.IncludedRelationships); if (_jsonApiContext.Options.IncludeTotalRecordCount) - _jsonApiContext.PageManager.TotalRecords = await entities.CountAsync(); + _jsonApiContext.PageManager.TotalRecords = await _entities.CountAsync(entities); // pagination should be done last since it will execute the query var pagedEntities = await ApplyPageQueryAsync(entities); return pagedEntities; } - public async Task GetAsync(TId id) + public virtual async Task GetAsync(TId id) { T entity; - if (_jsonApiContext.QuerySet?.IncludedRelationships != null) + if (ShouldIncludeRelationships()) entity = await GetWithRelationshipsAsync(id); else entity = await _entities.GetAsync(id); return entity; } + private bool ShouldIncludeRelationships() + => (_jsonApiContext.QuerySet?.IncludedRelationships != null && _jsonApiContext.QuerySet.IncludedRelationships.Count > 0); + private async Task GetWithRelationshipsAsync(TId id) { - var query = _entities.Get(); + var query = _entities.Get().Where(e => e.Id.Equals(id)); _jsonApiContext.QuerySet.IncludedRelationships.ForEach(r => { query = _entities.Include(query, r); }); - return await query.FirstOrDefaultAsync(e => e.Id.Equals(id)); + return await _entities.FirstOrDefaultAsync(query); } - public async Task GetRelationshipsAsync(TId id, string relationshipName) - { - _jsonApiContext.IsRelationshipData = true; - return await GetRelationshipAsync(id, relationshipName); - } + public virtual async Task GetRelationshipsAsync(TId id, string relationshipName) + => await GetRelationshipAsync(id, relationshipName); - public async Task GetRelationshipAsync(TId id, string relationshipName) + public virtual async Task GetRelationshipAsync(TId id, string relationshipName) { relationshipName = _jsonApiContext.ContextGraph .GetRelationshipName(relationshipName); if (relationshipName == null) throw new JsonApiException(422, "Relationship name not specified."); + if (_logger.IsEnabled(LogLevel.Trace)) + { + _logger.LogTrace($"Looking up '{relationshipName}'..."); + } - _logger.LogTrace($"Looking up '{relationshipName}'..."); - var entity = await _entities.GetAndIncludeAsync(id, relationshipName); + // TODO: it would be better if we could distinguish whether or not the relationship was not found, + // vs the relationship not being set on the instance of T if (entity == null) throw new JsonApiException(404, $"Relationship {relationshipName} not found."); @@ -104,18 +106,18 @@ public async Task GetRelationshipAsync(TId id, string relationshipName) return relationship; } - public async Task CreateAsync(T entity) + public virtual async Task CreateAsync(T entity) { return await _entities.CreateAsync(entity); } - public async Task UpdateAsync(TId id, T entity) + public virtual async Task UpdateAsync(TId id, T entity) { var updatedEntity = await _entities.UpdateAsync(id, entity); return updatedEntity; } - public async Task UpdateRelationshipsAsync(TId id, string relationshipName, List relationships) + public virtual async Task UpdateRelationshipsAsync(TId id, string relationshipName, List relationships) { relationshipName = _jsonApiContext.ContextGraph .GetRelationshipName(relationshipName); @@ -133,17 +135,17 @@ public async Task UpdateRelationshipsAsync(TId id, string relationshipName, List .Relationships .FirstOrDefault(r => r.InternalRelationshipName == relationshipName); - var relationshipIds = relationships.Select(r => r.Id); + var relationshipIds = relationships.Select(r => r?.Id?.ToString()); await _entities.UpdateRelationshipsAsync(entity, relationship, relationshipIds); } - public async Task DeleteAsync(TId id) + public virtual async Task DeleteAsync(TId id) { return await _entities.DeleteAsync(id); } - private IQueryable ApplySortAndFilterQuery(IQueryable entities) + protected virtual IQueryable ApplySortAndFilterQuery(IQueryable entities) { var query = _jsonApiContext.QuerySet; @@ -160,20 +162,21 @@ private IQueryable ApplySortAndFilterQuery(IQueryable entities) return entities; } - private async Task> ApplyPageQueryAsync(IQueryable entities) + protected virtual async Task> ApplyPageQueryAsync(IQueryable entities) { var pageManager = _jsonApiContext.PageManager; if (!pageManager.IsPaginated) - return entities; - - var query = _jsonApiContext.QuerySet?.PageQuery ?? new PageQuery(); + return await _entities.ToListAsync(entities); - _logger?.LogInformation($"Applying paging query. Fetching page {pageManager.CurrentPage} with {pageManager.PageSize} entities"); + if (_logger?.IsEnabled(LogLevel.Information) == true) + { + _logger?.LogInformation($"Applying paging query. Fetching page {pageManager.CurrentPage} with {pageManager.PageSize} entities"); + } return await _entities.PageAsync(entities, pageManager.PageSize, pageManager.CurrentPage); } - private IQueryable IncludeRelationships(IQueryable entities, List relationships) + protected virtual IQueryable IncludeRelationships(IQueryable entities, List relationships) { _jsonApiContext.IncludedRelationships = relationships; diff --git a/src/JsonApiDotNetCore/Services/IJsonApiContext.cs b/src/JsonApiDotNetCore/Services/IJsonApiContext.cs index 7b1b9e67a8..80995596ea 100644 --- a/src/JsonApiDotNetCore/Services/IJsonApiContext.cs +++ b/src/JsonApiDotNetCore/Services/IJsonApiContext.cs @@ -1,34 +1,163 @@ using System; using System.Collections.Generic; -using System.Reflection; using JsonApiDotNetCore.Builders; using JsonApiDotNetCore.Configuration; -using JsonApiDotNetCore.Data; using JsonApiDotNetCore.Internal; using JsonApiDotNetCore.Internal.Generics; using JsonApiDotNetCore.Internal.Query; using JsonApiDotNetCore.Models; +using JsonApiDotNetCore.Request; namespace JsonApiDotNetCore.Services { - public interface IJsonApiContext + public interface IJsonApiApplication { JsonApiOptions Options { get; set; } - IJsonApiContext ApplyContext(object controller); IContextGraph ContextGraph { get; set; } - ContextEntity RequestEntity { get; set; } - string BasePath { get; set; } - QuerySet QuerySet { get; set; } - bool IsRelationshipData { get; set; } + } + + public interface IQueryRequest + { List IncludedRelationships { get; set; } - bool IsRelationshipPath { get; } + QuerySet QuerySet { get; set; } PageManager PageManager { get; set; } - IMetaBuilder MetaBuilder { get; set; } - IGenericProcessorFactory GenericProcessorFactory { get; set; } + } + + public interface IUpdateRequest + { + /// + /// The attributes that were included in a PATCH request. + /// Only the attributes in this dictionary should be updated. + /// Dictionary AttributesToUpdate { get; set; } + + /// + /// Any relationships that were included in a PATCH request. + /// Only the relationships in this dictionary should be updated. + /// Dictionary RelationshipsToUpdate { get; set; } + } + + public interface IJsonApiRequest : IJsonApiApplication, IUpdateRequest, IQueryRequest + { + /// + /// The request namespace. This may be an absolute or relative path + /// depending upon the configuration. + /// + /// + /// Absolute: https://example.com/api/v1 + /// + /// Relative: /api/v1 + /// + string BasePath { get; set; } + + /// + /// Stores information to set relationships for the request resource. + /// These relationships must already exist and should not be re-created. + /// By default, it is the responsibility of the repository to use the + /// relationship pointers to persist the relationship. + /// + /// The expected use case is POST-ing or PATCH-ing an entity with HasMany + /// relaitonships: + /// + /// { + /// "data": { + /// "type": "photos", + /// "attributes": { + /// "title": "Ember Hamster", + /// "src": "http://example.com/images/productivity.png" + /// }, + /// "relationships": { + /// "tags": { + /// "data": [ + /// { "type": "tags", "id": "2" }, + /// { "type": "tags", "id": "3" } + /// ] + /// } + /// } + /// } + /// } + /// + /// + HasManyRelationshipPointers HasManyRelationshipPointers { get; } + + /// + /// Stores information to set relationships for the request resource. + /// These relationships must already exist and should not be re-created. + /// + /// The expected use case is POST-ing or PATCH-ing + /// an entity with HasOne relationships: + /// + /// { + /// "data": { + /// "type": "photos", + /// "attributes": { + /// "title": "Ember Hamster", + /// "src": "http://example.com/images/productivity.png" + /// }, + /// "relationships": { + /// "photographer": { + /// "data": { "type": "people", "id": "2" } + /// } + /// } + /// } + /// } + /// + /// + HasOneRelationshipPointers HasOneRelationshipPointers { get; } + + /// + /// If the request is a bulk json:api v1.1 operations request. + /// This is determined by the ` + /// ` class. + /// + /// See [json-api/1254](https://github.com/json-api/json-api/pull/1254) for details. + /// + bool IsBulkOperationRequest { get; set; } + + /// + /// The ``for the target route. + /// + /// + /// + /// For a `GET /articles` request, `RequestEntity` will be set + /// to the `Article` resource representation on the `JsonApiContext`. + /// + ContextEntity RequestEntity { get; set; } + + /// + /// The concrete type of the controller that was activated by the MVC routing middleware + /// Type ControllerType { get; set; } + + /// + /// The json:api meta data at the document level + /// + Dictionary DocumentMeta { get; set; } + + /// + /// If the request is on the `{id}/relationships/{relationshipName}` route + /// + bool IsRelationshipPath { get; } + + [Obsolete("Use `IsRelationshipPath` instead.")] + bool IsRelationshipData { get; set; } + } + + public interface IJsonApiContext : IJsonApiRequest + { + IJsonApiContext ApplyContext(object controller); + IMetaBuilder MetaBuilder { get; set; } + IGenericProcessorFactory GenericProcessorFactory { get; set; } + + [Obsolete("Use the proxied method IControllerContext.GetControllerAttribute instead.")] TAttribute GetControllerAttribute() where TAttribute : Attribute; - IDbContextResolver GetDbContextResolver(); + + /// + /// **_Experimental_**: do not use. It is likely to change in the future. + /// + /// Resets operational state information. + /// + void BeginOperation(); } } diff --git a/src/JsonApiDotNetCore/Services/IQueryAccessor.cs b/src/JsonApiDotNetCore/Services/IQueryAccessor.cs deleted file mode 100644 index 51b3ccbbbf..0000000000 --- a/src/JsonApiDotNetCore/Services/IQueryAccessor.cs +++ /dev/null @@ -1,9 +0,0 @@ -using System.Collections.Generic; - -namespace JsonApiDotNetCore.Services -{ - public interface IQueryAccessor - { - bool TryGetValue(string key, out T value); - } -} \ No newline at end of file diff --git a/src/JsonApiDotNetCore/Services/JsonApiContext.cs b/src/JsonApiDotNetCore/Services/JsonApiContext.cs index 47702f68f7..1e9b53eb51 100644 --- a/src/JsonApiDotNetCore/Services/JsonApiContext.cs +++ b/src/JsonApiDotNetCore/Services/JsonApiContext.cs @@ -1,14 +1,12 @@ using System; using System.Collections.Generic; -using System.Linq; -using System.Reflection; using JsonApiDotNetCore.Builders; using JsonApiDotNetCore.Configuration; -using JsonApiDotNetCore.Data; using JsonApiDotNetCore.Internal; using JsonApiDotNetCore.Internal.Generics; using JsonApiDotNetCore.Internal.Query; using JsonApiDotNetCore.Models; +using JsonApiDotNetCore.Request; using Microsoft.AspNetCore.Http; namespace JsonApiDotNetCore.Services @@ -16,27 +14,31 @@ namespace JsonApiDotNetCore.Services public class JsonApiContext : IJsonApiContext { private readonly IHttpContextAccessor _httpContextAccessor; - private readonly IDbContextResolver _contextResolver; + private readonly IQueryParser _queryParser; + private readonly IControllerContext _controllerContext; public JsonApiContext( - IDbContextResolver contextResolver, IContextGraph contextGraph, IHttpContextAccessor httpContextAccessor, JsonApiOptions options, IMetaBuilder metaBuilder, - IGenericProcessorFactory genericProcessorFactory) + IGenericProcessorFactory genericProcessorFactory, + IQueryParser queryParser, + IControllerContext controllerContext) { - _contextResolver = contextResolver; ContextGraph = contextGraph; _httpContextAccessor = httpContextAccessor; Options = options; MetaBuilder = metaBuilder; GenericProcessorFactory = genericProcessorFactory; + _queryParser = queryParser; + _controllerContext = controllerContext; } public JsonApiOptions Options { get; set; } public IContextGraph ContextGraph { get; set; } - public ContextEntity RequestEntity { get; set; } + [Obsolete("Use the proxied member IControllerContext.RequestEntity instead.")] + public ContextEntity RequestEntity { get => _controllerContext.RequestEntity; set => _controllerContext.RequestEntity = value; } public string BasePath { get; set; } public QuerySet QuerySet { get; set; } public bool IsRelationshipData { get; set; } @@ -45,36 +47,73 @@ public JsonApiContext( public PageManager PageManager { get; set; } public IMetaBuilder MetaBuilder { get; set; } public IGenericProcessorFactory GenericProcessorFactory { get; set; } + public Type ControllerType { get; set; } + public Dictionary DocumentMeta { get; set; } + public bool IsBulkOperationRequest { get; set; } + public Dictionary AttributesToUpdate { get; set; } = new Dictionary(); public Dictionary RelationshipsToUpdate { get; set; } = new Dictionary(); - public Type ControllerType { get; set; } + public HasManyRelationshipPointers HasManyRelationshipPointers { get; private set; } = new HasManyRelationshipPointers(); + public HasOneRelationshipPointers HasOneRelationshipPointers { get; private set; } = new HasOneRelationshipPointers(); public IJsonApiContext ApplyContext(object controller) { if (controller == null) throw new JsonApiException(500, $"Cannot ApplyContext from null controller for type {typeof(T)}"); - ControllerType = controller.GetType(); + _controllerContext.ControllerType = controller.GetType(); + _controllerContext.RequestEntity = ContextGraph.GetContextEntity(typeof(T)); + if (_controllerContext.RequestEntity == null) + throw new JsonApiException(500, $"A resource has not been properly defined for type '{typeof(T)}'. Ensure it has been registered on the ContextGraph."); var context = _httpContextAccessor.HttpContext; - var path = context.Request.Path.Value.Split('/'); - - RequestEntity = ContextGraph.GetContextEntity(typeof(T)); - if (context.Request.Query.Any()) + if (context.Request.Query.Count > 0) { - QuerySet = new QuerySet(this, context.Request.Query); + QuerySet = _queryParser.Parse(context.Request.Query); IncludedRelationships = QuerySet.IncludedRelationships; } - var linkBuilder = new LinkBuilder(this); - BasePath = linkBuilder.GetBasePath(context, RequestEntity.EntityName); + BasePath = new LinkBuilder(this).GetBasePath(context, _controllerContext.RequestEntity.EntityName); PageManager = GetPageManager(); - IsRelationshipPath = path[path.Length - 2] == "relationships"; + IsRelationshipPath = PathIsRelationship(context.Request.Path.Value); + return this; } - public IDbContextResolver GetDbContextResolver() => _contextResolver; + internal static bool PathIsRelationship(string requestPath) + { + // while(!Debugger.IsAttached) { Thread.Sleep(1000); } + const string relationships = "relationships"; + const char pathSegmentDelimiter = '/'; + + var span = requestPath.AsSpan(); + + // we need to iterate over the string, from the end, + // checking whether or not the 2nd to last path segment + // is "relationships" + // -2 is chosen in case the path ends with '/' + for (var i = requestPath.Length - 2; i >= 0; i--) + { + // if there are not enough characters left in the path to + // contain "relationships" + if (i < relationships.Length) + return false; + + // we have found the first instance of '/' + if (span[i] == pathSegmentDelimiter) + { + // in the case of a "relationships" route, the next + // path segment will be "relationships" + return ( + span.Slice(i - relationships.Length, relationships.Length) + .SequenceEqual(relationships.AsSpan()) + ); + } + } + + return false; + } private PageManager GetPageManager() { @@ -86,15 +125,22 @@ private PageManager GetPageManager() return new PageManager { DefaultPageSize = Options.DefaultPageSize, - CurrentPage = query.PageOffset > 0 ? query.PageOffset : 1, + CurrentPage = query.PageOffset, PageSize = query.PageSize > 0 ? query.PageSize : Options.DefaultPageSize }; } + [Obsolete("Use the proxied method IControllerContext.GetControllerAttribute instead.")] public TAttribute GetControllerAttribute() where TAttribute : Attribute + => _controllerContext.GetControllerAttribute(); + + public void BeginOperation() { - var attribute = ControllerType.GetTypeInfo().GetCustomAttribute(typeof(TAttribute)); - return attribute == null ? null : (TAttribute)attribute; + IncludedRelationships = new List(); + AttributesToUpdate = new Dictionary(); + RelationshipsToUpdate = new Dictionary(); + HasManyRelationshipPointers = new HasManyRelationshipPointers(); + HasOneRelationshipPointers = new HasOneRelationshipPointers(); } } } diff --git a/src/JsonApiDotNetCore/Services/Operations/IOpProcessor.cs b/src/JsonApiDotNetCore/Services/Operations/IOpProcessor.cs new file mode 100644 index 0000000000..0a2d30397c --- /dev/null +++ b/src/JsonApiDotNetCore/Services/Operations/IOpProcessor.cs @@ -0,0 +1,10 @@ +using System.Threading.Tasks; +using JsonApiDotNetCore.Models.Operations; + +namespace JsonApiDotNetCore.Services.Operations +{ + public interface IOpProcessor + { + Task ProcessAsync(Operation operation); + } +} diff --git a/src/JsonApiDotNetCore/Services/Operations/OperationProcessorResolver.cs b/src/JsonApiDotNetCore/Services/Operations/OperationProcessorResolver.cs new file mode 100644 index 0000000000..1004ed30dc --- /dev/null +++ b/src/JsonApiDotNetCore/Services/Operations/OperationProcessorResolver.cs @@ -0,0 +1,104 @@ +using JsonApiDotNetCore.Internal; +using JsonApiDotNetCore.Internal.Generics; +using JsonApiDotNetCore.Models.Operations; +using JsonApiDotNetCore.Services.Operations.Processors; + +namespace JsonApiDotNetCore.Services.Operations +{ + /// + /// Used to resolve at runtime based on the required operation + /// + public interface IOperationProcessorResolver + { + /// + /// Locates the correct + /// + IOpProcessor LocateCreateService(Operation operation); + + /// + /// Locates the correct + /// + IOpProcessor LocateGetService(Operation operation); + + /// + /// Locates the correct + /// + IOpProcessor LocateRemoveService(Operation operation); + + /// + /// Locates the correct + /// + IOpProcessor LocateUpdateService(Operation operation); + } + + /// + public class OperationProcessorResolver : IOperationProcessorResolver + { + private readonly IGenericProcessorFactory _processorFactory; + private readonly IJsonApiContext _context; + + /// + public OperationProcessorResolver( + IGenericProcessorFactory processorFactory, + IJsonApiContext context) + { + _processorFactory = processorFactory; + _context = context; + } + + /// + public IOpProcessor LocateCreateService(Operation operation) + { + var resource = operation.GetResourceTypeName(); + + var contextEntity = _context.ContextGraph.GetContextEntity(resource); + var processor = _processorFactory.GetProcessor( + typeof(ICreateOpProcessor<,>), contextEntity.EntityType, contextEntity.IdentityType + ); + + return processor; + } + + /// + public IOpProcessor LocateGetService(Operation operation) + { + var resource = operation.GetResourceTypeName(); + + var contextEntity = _context.ContextGraph.GetContextEntity(resource); + var processor = _processorFactory.GetProcessor( + typeof(IGetOpProcessor<,>), contextEntity.EntityType, contextEntity.IdentityType + ); + + return processor; + } + + /// + public IOpProcessor LocateRemoveService(Operation operation) + { + var resource = operation.GetResourceTypeName(); + + var contextEntity = _context.ContextGraph.GetContextEntity(resource); + var processor = _processorFactory.GetProcessor( + typeof(IRemoveOpProcessor<,>), contextEntity.EntityType, contextEntity.IdentityType + ); + + return processor; + } + + /// + public IOpProcessor LocateUpdateService(Operation operation) + { + var resource = operation.GetResourceTypeName(); + + var contextEntity = _context.ContextGraph.GetContextEntity(resource); + if (contextEntity == null) + throw new JsonApiException(400, $"This API does not expose a resource of type '{resource}'."); + + var processor = _processorFactory.GetProcessor( + typeof(IUpdateOpProcessor<,>), contextEntity.EntityType, contextEntity.IdentityType + ); + + return processor; + } + } +} diff --git a/src/JsonApiDotNetCore/Services/Operations/OperationsProcessor.cs b/src/JsonApiDotNetCore/Services/Operations/OperationsProcessor.cs new file mode 100644 index 0000000000..275b4b85b0 --- /dev/null +++ b/src/JsonApiDotNetCore/Services/Operations/OperationsProcessor.cs @@ -0,0 +1,148 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using JsonApiDotNetCore.Data; +using JsonApiDotNetCore.Internal; +using JsonApiDotNetCore.Models; +using JsonApiDotNetCore.Models.Operations; +using Microsoft.EntityFrameworkCore; + +namespace JsonApiDotNetCore.Services.Operations +{ + public interface IOperationsProcessor + { + Task> ProcessAsync(List inputOps); + } + + public class OperationsProcessor : IOperationsProcessor + { + private readonly IOperationProcessorResolver _processorResolver; + private readonly DbContext _dbContext; + private readonly IJsonApiContext _jsonApiContext; + + public OperationsProcessor( + IOperationProcessorResolver processorResolver, + IDbContextResolver dbContextResolver, + IJsonApiContext jsonApiContext) + { + _processorResolver = processorResolver; + _dbContext = dbContextResolver.GetContext(); + _jsonApiContext = jsonApiContext; + } + + public async Task> ProcessAsync(List inputOps) + { + var outputOps = new List(); + var opIndex = 0; + OperationCode? lastAttemptedOperation = null; // used for error messages only + + using (var transaction = await _dbContext.Database.BeginTransactionAsync()) + { + try + { + foreach (var op in inputOps) + { + _jsonApiContext.BeginOperation(); + lastAttemptedOperation = op.Op; + await ProcessOperation(op, outputOps); + opIndex++; + } + + transaction.Commit(); + return outputOps; + } + catch (JsonApiException e) + { + transaction.Rollback(); + throw new JsonApiException(e.GetStatusCode(), $"Transaction failed on operation[{opIndex}] ({lastAttemptedOperation}).", e); + } + catch (Exception e) + { + transaction.Rollback(); + throw new JsonApiException(500, $"Transaction failed on operation[{opIndex}] ({lastAttemptedOperation}) for an unexpected reason.", e); + } + } + } + + private async Task ProcessOperation(Operation op, List outputOps) + { + ReplaceLocalIdsInResourceObject(op.DataObject, outputOps); + ReplaceLocalIdsInRef(op.Ref, outputOps); + + var processor = GetOperationsProcessor(op); + var resultOp = await processor.ProcessAsync(op); + + if (resultOp != null) + outputOps.Add(resultOp); + } + + private void ReplaceLocalIdsInResourceObject(ResourceObject resourceObject, List outputOps) + { + if (resourceObject == null) + return; + + // it is strange to me that a top level resource object might use a lid. + // by not replacing it, we avoid a case where the first operation is an 'add' with an 'lid' + // and we would be unable to locate the matching 'lid' in 'outputOps' + // + // we also create a scenario where I might try to update a resource I just created + // in this case, the 'data.id' will be null, but the 'ref.id' will be replaced by the correct 'id' from 'outputOps' + // + // if(HasLocalId(resourceObject)) + // resourceObject.Id = GetIdFromLocalId(outputOps, resourceObject.LocalId); + + if (resourceObject.Relationships != null) + { + foreach (var relationshipDictionary in resourceObject.Relationships) + { + if (relationshipDictionary.Value.IsHasMany) + { + foreach (var relationship in relationshipDictionary.Value.ManyData) + if (HasLocalId(relationship)) + relationship.Id = GetIdFromLocalId(outputOps, relationship.LocalId); + } + else + { + var relationship = relationshipDictionary.Value.SingleData; + if (HasLocalId(relationship)) + relationship.Id = GetIdFromLocalId(outputOps, relationship.LocalId); + } + } + } + } + + private void ReplaceLocalIdsInRef(ResourceReference resourceRef, List outputOps) + { + if (resourceRef == null) return; + if (HasLocalId(resourceRef)) + resourceRef.Id = GetIdFromLocalId(outputOps, resourceRef.LocalId); + } + + private bool HasLocalId(ResourceIdentifierObject rio) => string.IsNullOrEmpty(rio.LocalId) == false; + + private string GetIdFromLocalId(List outputOps, string localId) + { + var referencedOp = outputOps.FirstOrDefault(o => o.DataObject.LocalId == localId); + if (referencedOp == null) throw new JsonApiException(400, $"Could not locate lid '{localId}' in document."); + return referencedOp.DataObject.Id; + } + + private IOpProcessor GetOperationsProcessor(Operation op) + { + switch (op.Op) + { + case OperationCode.add: + return _processorResolver.LocateCreateService(op); + case OperationCode.get: + return _processorResolver.LocateGetService(op); + case OperationCode.remove: + return _processorResolver.LocateRemoveService(op); + case OperationCode.update: + return _processorResolver.LocateUpdateService(op); + default: + throw new JsonApiException(400, $"'{op.Op}' is not a valid operation code"); + } + } + } +} diff --git a/src/JsonApiDotNetCore/Services/Operations/Processors/CreateOpProcessor.cs b/src/JsonApiDotNetCore/Services/Operations/Processors/CreateOpProcessor.cs new file mode 100644 index 0000000000..5ecdf6f38a --- /dev/null +++ b/src/JsonApiDotNetCore/Services/Operations/Processors/CreateOpProcessor.cs @@ -0,0 +1,72 @@ +using System.Threading.Tasks; +using JsonApiDotNetCore.Builders; +using JsonApiDotNetCore.Internal; +using JsonApiDotNetCore.Models; +using JsonApiDotNetCore.Models.Operations; +using JsonApiDotNetCore.Serialization; + +namespace JsonApiDotNetCore.Services.Operations.Processors +{ + public interface ICreateOpProcessor : ICreateOpProcessor + where T : class, IIdentifiable + { } + + public interface ICreateOpProcessor : IOpProcessor + where T : class, IIdentifiable + { } + + public class CreateOpProcessor + : CreateOpProcessor, ICreateOpProcessor + where T : class, IIdentifiable + { + public CreateOpProcessor( + ICreateService service, + IJsonApiDeSerializer deSerializer, + IDocumentBuilder documentBuilder, + IContextGraph contextGraph + ) : base(service, deSerializer, documentBuilder, contextGraph) + { } + } + + public class CreateOpProcessor : ICreateOpProcessor + where T : class, IIdentifiable + { + private readonly ICreateService _service; + private readonly IJsonApiDeSerializer _deSerializer; + private readonly IDocumentBuilder _documentBuilder; + private readonly IContextGraph _contextGraph; + + public CreateOpProcessor( + ICreateService service, + IJsonApiDeSerializer deSerializer, + IDocumentBuilder documentBuilder, + IContextGraph contextGraph) + { + _service = service; + _deSerializer = deSerializer; + _documentBuilder = documentBuilder; + _contextGraph = contextGraph; + } + + public async Task ProcessAsync(Operation operation) + { + var model = (T)_deSerializer.DocumentToObject(operation.DataObject); + var result = await _service.CreateAsync(model); + + var operationResult = new Operation + { + Op = OperationCode.add + }; + + operationResult.Data = _documentBuilder.GetData( + _contextGraph.GetContextEntity(operation.GetResourceTypeName()), + result); + + // we need to persist the original request localId so that subsequent operations + // can locate the result of this operation by its localId + operationResult.DataObject.LocalId = operation.DataObject.LocalId; + + return operationResult; + } + } +} diff --git a/src/JsonApiDotNetCore/Services/Operations/Processors/GetOpProcessor.cs b/src/JsonApiDotNetCore/Services/Operations/Processors/GetOpProcessor.cs new file mode 100644 index 0000000000..a3cb6e7da8 --- /dev/null +++ b/src/JsonApiDotNetCore/Services/Operations/Processors/GetOpProcessor.cs @@ -0,0 +1,147 @@ +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using JsonApiDotNetCore.Builders; +using JsonApiDotNetCore.Internal; +using JsonApiDotNetCore.Models; +using JsonApiDotNetCore.Models.Operations; +using JsonApiDotNetCore.Serialization; + +namespace JsonApiDotNetCore.Services.Operations.Processors +{ + /// + /// Handles all "" operations + /// + /// The resource type + public interface IGetOpProcessor : IGetOpProcessor + where T : class, IIdentifiable + { } + + /// + /// Handles all "" operations + /// + /// The resource type + /// The resource identifier type + public interface IGetOpProcessor : IOpProcessor + where T : class, IIdentifiable + { } + + /// + public class GetOpProcessor : GetOpProcessor, IGetOpProcessor + where T : class, IIdentifiable + { + /// + public GetOpProcessor( + IGetAllService getAll, + IGetByIdService getById, + IGetRelationshipService getRelationship, + IJsonApiDeSerializer deSerializer, + IDocumentBuilder documentBuilder, + IContextGraph contextGraph, + IJsonApiContext jsonApiContext + ) : base(getAll, getById, getRelationship, deSerializer, documentBuilder, contextGraph, jsonApiContext) + { } + } + + /// + public class GetOpProcessor : IGetOpProcessor + where T : class, IIdentifiable + { + private readonly IGetAllService _getAll; + private readonly IGetByIdService _getById; + private readonly IGetRelationshipService _getRelationship; + private readonly IJsonApiDeSerializer _deSerializer; + private readonly IDocumentBuilder _documentBuilder; + private readonly IContextGraph _contextGraph; + private readonly IJsonApiContext _jsonApiContext; + + /// + public GetOpProcessor( + IGetAllService getAll, + IGetByIdService getById, + IGetRelationshipService getRelationship, + IJsonApiDeSerializer deSerializer, + IDocumentBuilder documentBuilder, + IContextGraph contextGraph, + IJsonApiContext jsonApiContext) + { + _getAll = getAll; + _getById = getById; + _getRelationship = getRelationship; + _deSerializer = deSerializer; + _documentBuilder = documentBuilder; + _contextGraph = contextGraph; + _jsonApiContext = jsonApiContext.ApplyContext(this); + } + + /// + public async Task ProcessAsync(Operation operation) + { + var operationResult = new Operation + { + Op = OperationCode.get + }; + + operationResult.Data = string.IsNullOrWhiteSpace(operation.Ref.Id) + ? await GetAllAsync(operation) + : string.IsNullOrWhiteSpace(operation.Ref.Relationship) + ? await GetByIdAsync(operation) + : await GetRelationshipAsync(operation); + + return operationResult; + } + + private async Task GetAllAsync(Operation operation) + { + var result = await _getAll.GetAsync(); + + var operations = new List(); + foreach (var resource in result) + { + var doc = _documentBuilder.GetData( + _contextGraph.GetContextEntity(operation.GetResourceTypeName()), + resource); + operations.Add(doc); + } + + return operations; + } + + private async Task GetByIdAsync(Operation operation) + { + var id = GetReferenceId(operation); + var result = await _getById.GetAsync(id); + + // this is a bit ugly but we need to bomb the entire transaction if the entity cannot be found + // in the future it would probably be better to return a result status along with the doc to + // avoid throwing exceptions on 4xx errors. + // consider response type (status, document) + if (result == null) + throw new JsonApiException(404, $"Could not find '{operation.Ref.Type}' record with id '{operation.Ref.Id}'"); + + var doc = _documentBuilder.GetData( + _contextGraph.GetContextEntity(operation.GetResourceTypeName()), + result); + + return doc; + } + + private async Task GetRelationshipAsync(Operation operation) + { + var id = GetReferenceId(operation); + var result = await _getRelationship.GetRelationshipAsync(id, operation.Ref.Relationship); + + // TODO: need a better way to get the ContextEntity from a relationship name + // when no generic parameter is available + var relationshipType = _contextGraph.GetContextEntity(operation.GetResourceTypeName()) + .Relationships.Single(r => r.Is(operation.Ref.Relationship)).Type; + var relatedContextEntity = _jsonApiContext.ContextGraph.GetContextEntity(relationshipType); + + var doc = _documentBuilder.GetData(relatedContextEntity, result as IIdentifiable); // TODO: if this is safe, then it should be cast in the GetRelationshipAsync call + + return doc; + } + + private TId GetReferenceId(Operation operation) => TypeHelper.ConvertType(operation.Ref.Id); + } +} diff --git a/src/JsonApiDotNetCore/Services/Operations/Processors/RemoveOpProcessor.cs b/src/JsonApiDotNetCore/Services/Operations/Processors/RemoveOpProcessor.cs new file mode 100644 index 0000000000..a1aebadc66 --- /dev/null +++ b/src/JsonApiDotNetCore/Services/Operations/Processors/RemoveOpProcessor.cs @@ -0,0 +1,62 @@ +using System.Threading.Tasks; +using JsonApiDotNetCore.Builders; +using JsonApiDotNetCore.Internal; +using JsonApiDotNetCore.Models; +using JsonApiDotNetCore.Models.Operations; +using JsonApiDotNetCore.Serialization; + +namespace JsonApiDotNetCore.Services.Operations.Processors +{ + public interface IRemoveOpProcessor : IRemoveOpProcessor + where T : class, IIdentifiable + { } + + public interface IRemoveOpProcessor : IOpProcessor + where T : class, IIdentifiable + { } + + public class RemoveOpProcessor : RemoveOpProcessor, IRemoveOpProcessor + where T : class, IIdentifiable + { + public RemoveOpProcessor( + IDeleteService service, + IJsonApiDeSerializer deSerializer, + IDocumentBuilder documentBuilder, + IContextGraph contextGraph + ) : base(service, deSerializer, documentBuilder, contextGraph) + { } + } + + public class RemoveOpProcessor : IRemoveOpProcessor + where T : class, IIdentifiable + { + private readonly IDeleteService _service; + private readonly IJsonApiDeSerializer _deSerializer; + private readonly IDocumentBuilder _documentBuilder; + private readonly IContextGraph _contextGraph; + + public RemoveOpProcessor( + IDeleteService service, + IJsonApiDeSerializer deSerializer, + IDocumentBuilder documentBuilder, + IContextGraph contextGraph) + { + _service = service; + _deSerializer = deSerializer; + _documentBuilder = documentBuilder; + _contextGraph = contextGraph; + } + + public async Task ProcessAsync(Operation operation) + { + var stringId = operation.Ref?.Id?.ToString(); + if (string.IsNullOrWhiteSpace(stringId)) + throw new JsonApiException(400, "The ref.id parameter is required for remove operations"); + + var id = TypeHelper.ConvertType(stringId); + var result = await _service.DeleteAsync(id); + + return null; + } + } +} diff --git a/src/JsonApiDotNetCore/Services/Operations/Processors/UpdateOpProcessor.cs b/src/JsonApiDotNetCore/Services/Operations/Processors/UpdateOpProcessor.cs new file mode 100644 index 0000000000..1ea690a52c --- /dev/null +++ b/src/JsonApiDotNetCore/Services/Operations/Processors/UpdateOpProcessor.cs @@ -0,0 +1,71 @@ +using System.Threading.Tasks; +using JsonApiDotNetCore.Builders; +using JsonApiDotNetCore.Internal; +using JsonApiDotNetCore.Models; +using JsonApiDotNetCore.Models.Operations; +using JsonApiDotNetCore.Serialization; + +namespace JsonApiDotNetCore.Services.Operations.Processors +{ + public interface IUpdateOpProcessor : IUpdateOpProcessor + where T : class, IIdentifiable + { } + + public interface IUpdateOpProcessor : IOpProcessor + where T : class, IIdentifiable + { } + + public class UpdateOpProcessor : UpdateOpProcessor, IUpdateOpProcessor + where T : class, IIdentifiable + { + public UpdateOpProcessor( + IUpdateService service, + IJsonApiDeSerializer deSerializer, + IDocumentBuilder documentBuilder, + IContextGraph contextGraph + ) : base(service, deSerializer, documentBuilder, contextGraph) + { } + } + + public class UpdateOpProcessor : IUpdateOpProcessor + where T : class, IIdentifiable + { + private readonly IUpdateService _service; + private readonly IJsonApiDeSerializer _deSerializer; + private readonly IDocumentBuilder _documentBuilder; + private readonly IContextGraph _contextGraph; + + public UpdateOpProcessor( + IUpdateService service, + IJsonApiDeSerializer deSerializer, + IDocumentBuilder documentBuilder, + IContextGraph contextGraph) + { + _service = service; + _deSerializer = deSerializer; + _documentBuilder = documentBuilder; + _contextGraph = contextGraph; + } + + public async Task ProcessAsync(Operation operation) + { + if (string.IsNullOrWhiteSpace(operation?.DataObject?.Id?.ToString())) + throw new JsonApiException(400, "The data.id parameter is required for replace operations"); + + var model = (T)_deSerializer.DocumentToObject(operation.DataObject); + + var result = await _service.UpdateAsync(model.Id, model); + if (result == null) + throw new JsonApiException(404, $"Could not find an instance of '{operation.DataObject.Type}' with id {operation.DataObject.Id}"); + + var operationResult = new Operation + { + Op = OperationCode.update + }; + + operationResult.Data = _documentBuilder.GetData(_contextGraph.GetContextEntity(operation.GetResourceTypeName()), result); + + return operationResult; + } + } +} diff --git a/src/JsonApiDotNetCore/Services/QueryAccessor.cs b/src/JsonApiDotNetCore/Services/QueryAccessor.cs index 8134028a3e..dc9ff7ef0a 100644 --- a/src/JsonApiDotNetCore/Services/QueryAccessor.cs +++ b/src/JsonApiDotNetCore/Services/QueryAccessor.cs @@ -1,35 +1,58 @@ using System; -using System.Collections.Generic; using System.Linq; using JsonApiDotNetCore.Internal; using Microsoft.Extensions.Logging; namespace JsonApiDotNetCore.Services { + public interface IQueryAccessor + { + bool TryGetValue(string key, out T value); + + /// + /// Gets the query value and throws a if it is not present. + /// If the exception is not caught, the middleware will return an HTTP 422 response. + /// + /// + T GetRequired(string key); + } + public class QueryAccessor : IQueryAccessor { private readonly IJsonApiContext _jsonApiContext; private readonly ILogger _logger; public QueryAccessor( - IJsonApiContext jsonApiContext, - ILoggerFactory loggerFactory) + IJsonApiContext jsonApiContext, + ILogger logger) { _jsonApiContext = jsonApiContext; - _logger = loggerFactory.CreateLogger(); + _logger = logger; + } + + public T GetRequired(string key) + { + if (TryGetValue(key, out T result) == false) + throw new JsonApiException(422, $"'{key}' is not a valid '{typeof(T).Name}' value for query parameter {key}"); + + return result; } public bool TryGetValue(string key, out T value) { value = default(T); - var stringValue = GetFilterValue(key); - if(stringValue == null) + var stringValue = GetFilterValue(key); + if (stringValue == null) { - _logger.LogInformation($"'{key}' was not found in the query collection"); + if (_logger.IsEnabled(LogLevel.Information)) + { + _logger.LogInformation($"'{key}' was not found in the query collection"); + } + return false; } - + try { value = TypeHelper.ConvertType(stringValue); @@ -37,14 +60,32 @@ public bool TryGetValue(string key, out T value) } catch (FormatException) { - _logger.LogInformation($"'{value}' is not a valid guid value for query parameter {key}"); + if (_logger.IsEnabled(LogLevel.Information)) + { + _logger.LogInformation( + $"'{value}' is not a valid '{typeof(T).Name}' value for query parameter {key}"); + } + return false; } } - private string GetFilterValue(string key) => _jsonApiContext.QuerySet - .Filters - .FirstOrDefault(f => f.Key == key) - ?.Value; + private string GetFilterValue(string key) { + var publicValue = _jsonApiContext.QuerySet.Filters + .FirstOrDefault(f => string.Equals(f.Attribute, key, StringComparison.OrdinalIgnoreCase))?.Value; + + if(publicValue != null) + return publicValue; + + var internalValue = _jsonApiContext.QuerySet.Filters + .FirstOrDefault(f => string.Equals(f.Attribute, key, StringComparison.OrdinalIgnoreCase))?.Value; + + if(internalValue != null) { + _logger.LogWarning("Locating filters by the internal propterty name is deprecated. You should use the public attribute name instead."); + return publicValue; + } + + return null; + } } -} \ No newline at end of file +} diff --git a/src/JsonApiDotNetCore/Services/QueryComposer.cs b/src/JsonApiDotNetCore/Services/QueryComposer.cs new file mode 100644 index 0000000000..e365811704 --- /dev/null +++ b/src/JsonApiDotNetCore/Services/QueryComposer.cs @@ -0,0 +1,38 @@ +using System.Collections.Generic; +using JsonApiDotNetCore.Internal.Query; + +namespace JsonApiDotNetCore.Services +{ + public interface IQueryComposer + { + string Compose(IJsonApiContext jsonApiContext); + } + + public class QueryComposer : IQueryComposer + { + public string Compose(IJsonApiContext jsonApiContext) + { + string result = ""; + if (jsonApiContext != null && jsonApiContext.QuerySet != null) + { + List filterQueries = jsonApiContext.QuerySet.Filters; + if (filterQueries.Count > 0) + { + foreach (FilterQuery filter in filterQueries) + { + result += ComposeSingleFilter(filter); + } + } + } + return result; + } + + private string ComposeSingleFilter(FilterQuery query) + { + var result = "&filter"; + var operation = string.IsNullOrWhiteSpace(query.Operation) ? query.Operation : query.Operation + ":"; + result += QueryConstants.OPEN_BRACKET + query.Attribute + QueryConstants.CLOSE_BRACKET + "=" + operation + query.Value; + return result; + } + } +} diff --git a/src/JsonApiDotNetCore/Services/QueryParser.cs b/src/JsonApiDotNetCore/Services/QueryParser.cs new file mode 100644 index 0000000000..7e17352815 --- /dev/null +++ b/src/JsonApiDotNetCore/Services/QueryParser.cs @@ -0,0 +1,254 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using JsonApiDotNetCore.Configuration; +using JsonApiDotNetCore.Controllers; +using JsonApiDotNetCore.Internal; +using JsonApiDotNetCore.Internal.Query; +using JsonApiDotNetCore.Models; +using Microsoft.AspNetCore.Http; + +namespace JsonApiDotNetCore.Services +{ + public interface IQueryParser + { + QuerySet Parse(IQueryCollection query); + } + + public class QueryParser : IQueryParser + { + private readonly IControllerContext _controllerContext; + private readonly JsonApiOptions _options; + + public QueryParser( + IControllerContext controllerContext, + JsonApiOptions options) + { + _controllerContext = controllerContext; + _options = options; + } + + public virtual QuerySet Parse(IQueryCollection query) + { + var querySet = new QuerySet(); + var disabledQueries = _controllerContext.GetControllerAttribute()?.QueryParams ?? QueryParams.None; + + foreach (var pair in query) + { + if (pair.Key.StartsWith(QueryConstants.FILTER)) + { + if (disabledQueries.HasFlag(QueryParams.Filter) == false) + querySet.Filters.AddRange(ParseFilterQuery(pair.Key, pair.Value)); + continue; + } + + if (pair.Key.StartsWith(QueryConstants.SORT)) + { + if (disabledQueries.HasFlag(QueryParams.Sort) == false) + querySet.SortParameters = ParseSortParameters(pair.Value); + continue; + } + + if (pair.Key.StartsWith(QueryConstants.INCLUDE)) + { + if (disabledQueries.HasFlag(QueryParams.Include) == false) + querySet.IncludedRelationships = ParseIncludedRelationships(pair.Value); + continue; + } + + if (pair.Key.StartsWith(QueryConstants.PAGE)) + { + if (disabledQueries.HasFlag(QueryParams.Page) == false) + querySet.PageQuery = ParsePageQuery(querySet.PageQuery, pair.Key, pair.Value); + continue; + } + + if (pair.Key.StartsWith(QueryConstants.FIELDS)) + { + if (disabledQueries.HasFlag(QueryParams.Fields) == false) + querySet.Fields = ParseFieldsQuery(pair.Key, pair.Value); + continue; + } + + if (_options.AllowCustomQueryParameters == false) + throw new JsonApiException(400, $"{pair} is not a valid query."); + } + + return querySet; + } + + protected virtual List ParseFilterQuery(string key, string value) + { + // expected input = filter[id]=1 + // expected input = filter[id]=eq:1 + var queries = new List(); + var propertyName = key.Split(QueryConstants.OPEN_BRACKET, QueryConstants.CLOSE_BRACKET)[1]; + + // InArray case + string op = GetFilterOperation(value); + if (string.Equals(op, FilterOperations.@in.ToString(), StringComparison.OrdinalIgnoreCase)) + { + (var operation, var filterValue) = ParseFilterOperation(value); + queries.Add(new FilterQuery(propertyName, filterValue, op)); + } + else + { + var values = value.Split(QueryConstants.COMMA); + foreach (var val in values) + { + (var operation, var filterValue) = ParseFilterOperation(val); + queries.Add(new FilterQuery(propertyName, filterValue, operation)); + } + } + + return queries; + } + + protected virtual (string operation, string value) ParseFilterOperation(string value) + { + if (value.Length < 3) + return (string.Empty, value); + + var operation = GetFilterOperation(value); + var values = value.Split(QueryConstants.COLON); + + if (string.IsNullOrEmpty(operation)) + return (string.Empty, value); + + value = string.Join(QueryConstants.COLON_STR, values.Skip(1)); + + return (operation, value); + } + + protected virtual PageQuery ParsePageQuery(PageQuery pageQuery, string key, string value) + { + // expected input = page[size]=10 + // page[number]=1 + pageQuery = pageQuery ?? new PageQuery(); + + var propertyName = key.Split(QueryConstants.OPEN_BRACKET, QueryConstants.CLOSE_BRACKET)[1]; + + const string SIZE = "size"; + const string NUMBER = "number"; + + if (propertyName == SIZE) + pageQuery.PageSize = int.TryParse(value, out var pageSize) ? + pageSize : + throw new JsonApiException(400, $"Invalid page size '{value}'"); + + else if (propertyName == NUMBER) + pageQuery.PageOffset = int.TryParse(value, out var pageOffset) ? + pageOffset : + throw new JsonApiException(400, $"Invalid page size '{value}'"); + + return pageQuery; + } + + // sort=id,name + // sort=-id + protected virtual List ParseSortParameters(string value) + { + var sortParameters = new List(); + + const char DESCENDING_SORT_OPERATOR = '-'; + var sortSegments = value.Split(QueryConstants.COMMA); + + foreach (var sortSegment in sortSegments) + { + + var propertyName = sortSegment; + var direction = SortDirection.Ascending; + + if (sortSegment[0] == DESCENDING_SORT_OPERATOR) + { + direction = SortDirection.Descending; + propertyName = propertyName.Substring(1); + } + + var attribute = GetAttribute(propertyName); + + if (attribute.IsSortable == false) + throw new JsonApiException(400, $"Sort is not allowed for attribute '{attribute.PublicAttributeName}'."); + + sortParameters.Add(new SortQuery(direction, attribute)); + }; + + return sortParameters; + } + + protected virtual List ParseIncludedRelationships(string value) + { + const string NESTED_DELIMITER = "."; + if (value.Contains(NESTED_DELIMITER)) + throw new JsonApiException(400, "Deeply nested relationships are not supported"); + + return value + .Split(QueryConstants.COMMA) + .ToList(); + } + + protected virtual List ParseFieldsQuery(string key, string value) + { + // expected: fields[TYPE]=prop1,prop2 + var typeName = key.Split(QueryConstants.OPEN_BRACKET, QueryConstants.CLOSE_BRACKET)[1]; + + const string ID = "Id"; + var includedFields = new List { ID }; + + // this will not support nested inclusions, it requires that the typeName is the current request type + if (string.Equals(typeName, _controllerContext.RequestEntity.EntityName, StringComparison.OrdinalIgnoreCase) == false) + return includedFields; + + var fields = value.Split(QueryConstants.COMMA); + foreach (var field in fields) + { + var attr = _controllerContext.RequestEntity + .Attributes + .SingleOrDefault(a => a.Is(field)); + + if (attr == null) throw new JsonApiException(400, $"'{_controllerContext.RequestEntity.EntityName}' does not contain '{field}'."); + + var internalAttrName = attr.InternalAttributeName; + includedFields.Add(internalAttrName); + } + + return includedFields; + } + + protected virtual AttrAttribute GetAttribute(string propertyName) + { + try + { + return _controllerContext + .RequestEntity + .Attributes + .Single(attr => attr.Is(propertyName)); + } + catch (InvalidOperationException e) + { + throw new JsonApiException(400, $"Attribute '{propertyName}' does not exist on resource '{_controllerContext.RequestEntity.EntityName}'", e); + } + } + + private string GetFilterOperation(string value) + { + var values = value.Split(QueryConstants.COLON); + + if (values.Length == 1) + return string.Empty; + + var operation = values[0]; + // remove prefix from value + if (Enum.TryParse(operation, out FilterOperations op) == false) + return string.Empty; + + return operation; + } + + private FilterQuery BuildFilterQuery(ReadOnlySpan query, string propertyName) + { + var (operation, filterValue) = ParseFilterOperation(query.ToString()); + return new FilterQuery(propertyName, filterValue, operation); + } + } +} diff --git a/src/JsonApiDotNetCore/Services/ScopedServiceProvider.cs b/src/JsonApiDotNetCore/Services/ScopedServiceProvider.cs new file mode 100644 index 0000000000..eecd554e7c --- /dev/null +++ b/src/JsonApiDotNetCore/Services/ScopedServiceProvider.cs @@ -0,0 +1,28 @@ +using Microsoft.AspNetCore.Http; +using System; + +namespace JsonApiDotNetCore.Services +{ + /// + /// An interface used to separate the registration of the global ServiceProvider + /// from a request scoped service provider. This is useful in cases when we need to + /// manually resolve services from the request scope (e.g. operation processors) + /// + public interface IScopedServiceProvider : IServiceProvider { } + + /// + /// A service provider that uses the current HttpContext request scope + /// + public class RequestScopedServiceProvider : IScopedServiceProvider + { + private readonly IHttpContextAccessor _httpContextAccessor; + + public RequestScopedServiceProvider(IHttpContextAccessor httpContextAccessor) + { + _httpContextAccessor = httpContextAccessor; + } + + /// + public object GetService(Type serviceType) => _httpContextAccessor.HttpContext.RequestServices.GetService(serviceType); + } +} diff --git a/src/JsonApiDotNetCore/api/.gitignore b/src/JsonApiDotNetCore/api/.gitignore new file mode 100644 index 0000000000..da7c71b83a --- /dev/null +++ b/src/JsonApiDotNetCore/api/.gitignore @@ -0,0 +1,4 @@ +############### +# temp file # +############### +*.yml diff --git a/src/JsonApiDotNetCore/api/.manifest b/src/JsonApiDotNetCore/api/.manifest new file mode 100644 index 0000000000..41d94c66fb --- /dev/null +++ b/src/JsonApiDotNetCore/api/.manifest @@ -0,0 +1,691 @@ +{ + "JsonApiDotNetCore.Builders": "JsonApiDotNetCore.Builders.yml", + "JsonApiDotNetCore.Builders.ContextGraphBuilder": "JsonApiDotNetCore.Builders.ContextGraphBuilder.yml", + "JsonApiDotNetCore.Builders.ContextGraphBuilder.AddDbContext``1": "JsonApiDotNetCore.Builders.ContextGraphBuilder.yml", + "JsonApiDotNetCore.Builders.ContextGraphBuilder.AddResource``1(System.String)": "JsonApiDotNetCore.Builders.ContextGraphBuilder.yml", + "JsonApiDotNetCore.Builders.ContextGraphBuilder.AddResource``2(System.String)": "JsonApiDotNetCore.Builders.ContextGraphBuilder.yml", + "JsonApiDotNetCore.Builders.ContextGraphBuilder.Build": "JsonApiDotNetCore.Builders.ContextGraphBuilder.yml", + "JsonApiDotNetCore.Builders.ContextGraphBuilder.DocumentLinks": "JsonApiDotNetCore.Builders.ContextGraphBuilder.yml", + "JsonApiDotNetCore.Builders.ContextGraphBuilder.GetAttributes(System.Type)": "JsonApiDotNetCore.Builders.ContextGraphBuilder.yml", + "JsonApiDotNetCore.Builders.ContextGraphBuilder.GetRelationships(System.Type)": "JsonApiDotNetCore.Builders.ContextGraphBuilder.yml", + "JsonApiDotNetCore.Builders.ContextGraphBuilder.GetRelationshipType(JsonApiDotNetCore.Models.RelationshipAttribute,System.Reflection.PropertyInfo)": "JsonApiDotNetCore.Builders.ContextGraphBuilder.yml", + "JsonApiDotNetCore.Builders.DocumentBuilder": "JsonApiDotNetCore.Builders.DocumentBuilder.yml", + "JsonApiDotNetCore.Builders.DocumentBuilder.#ctor(JsonApiDotNetCore.Services.IJsonApiContext,JsonApiDotNetCore.Services.IRequestMeta,JsonApiDotNetCore.Builders.IDocumentBuilderOptionsProvider)": "JsonApiDotNetCore.Builders.DocumentBuilder.yml", + "JsonApiDotNetCore.Builders.DocumentBuilder.Build(JsonApiDotNetCore.Models.IIdentifiable)": "JsonApiDotNetCore.Builders.DocumentBuilder.yml", + "JsonApiDotNetCore.Builders.DocumentBuilder.Build(System.Collections.Generic.IEnumerable{JsonApiDotNetCore.Models.IIdentifiable})": "JsonApiDotNetCore.Builders.DocumentBuilder.yml", + "JsonApiDotNetCore.Builders.DocumentBuilder.GetData(JsonApiDotNetCore.Internal.ContextEntity,JsonApiDotNetCore.Models.IIdentifiable)": "JsonApiDotNetCore.Builders.DocumentBuilder.yml", + "JsonApiDotNetCore.Builders.DocumentBuilderOptions": "JsonApiDotNetCore.Builders.DocumentBuilderOptions.yml", + "JsonApiDotNetCore.Builders.DocumentBuilderOptions.#ctor(System.Boolean)": "JsonApiDotNetCore.Builders.DocumentBuilderOptions.yml", + "JsonApiDotNetCore.Builders.DocumentBuilderOptions.OmitNullValuedAttributes": "JsonApiDotNetCore.Builders.DocumentBuilderOptions.yml", + "JsonApiDotNetCore.Builders.DocumentBuilderOptionsProvider": "JsonApiDotNetCore.Builders.DocumentBuilderOptionsProvider.yml", + "JsonApiDotNetCore.Builders.DocumentBuilderOptionsProvider.#ctor(JsonApiDotNetCore.Services.IJsonApiContext,Microsoft.AspNetCore.Http.IHttpContextAccessor)": "JsonApiDotNetCore.Builders.DocumentBuilderOptionsProvider.yml", + "JsonApiDotNetCore.Builders.DocumentBuilderOptionsProvider.GetDocumentBuilderOptions": "JsonApiDotNetCore.Builders.DocumentBuilderOptionsProvider.yml", + "JsonApiDotNetCore.Builders.IContextGraphBuilder": "JsonApiDotNetCore.Builders.IContextGraphBuilder.yml", + "JsonApiDotNetCore.Builders.IContextGraphBuilder.AddDbContext``1": "JsonApiDotNetCore.Builders.IContextGraphBuilder.yml", + "JsonApiDotNetCore.Builders.IContextGraphBuilder.AddResource``1(System.String)": "JsonApiDotNetCore.Builders.IContextGraphBuilder.yml", + "JsonApiDotNetCore.Builders.IContextGraphBuilder.AddResource``2(System.String)": "JsonApiDotNetCore.Builders.IContextGraphBuilder.yml", + "JsonApiDotNetCore.Builders.IContextGraphBuilder.Build": "JsonApiDotNetCore.Builders.IContextGraphBuilder.yml", + "JsonApiDotNetCore.Builders.IContextGraphBuilder.DocumentLinks": "JsonApiDotNetCore.Builders.IContextGraphBuilder.yml", + "JsonApiDotNetCore.Builders.IDocumentBuilder": "JsonApiDotNetCore.Builders.IDocumentBuilder.yml", + "JsonApiDotNetCore.Builders.IDocumentBuilder.Build(JsonApiDotNetCore.Models.IIdentifiable)": "JsonApiDotNetCore.Builders.IDocumentBuilder.yml", + "JsonApiDotNetCore.Builders.IDocumentBuilder.Build(System.Collections.Generic.IEnumerable{JsonApiDotNetCore.Models.IIdentifiable})": "JsonApiDotNetCore.Builders.IDocumentBuilder.yml", + "JsonApiDotNetCore.Builders.IDocumentBuilder.GetData(JsonApiDotNetCore.Internal.ContextEntity,JsonApiDotNetCore.Models.IIdentifiable)": "JsonApiDotNetCore.Builders.IDocumentBuilder.yml", + "JsonApiDotNetCore.Builders.IDocumentBuilderOptionsProvider": "JsonApiDotNetCore.Builders.IDocumentBuilderOptionsProvider.yml", + "JsonApiDotNetCore.Builders.IDocumentBuilderOptionsProvider.GetDocumentBuilderOptions": "JsonApiDotNetCore.Builders.IDocumentBuilderOptionsProvider.yml", + "JsonApiDotNetCore.Builders.IMetaBuilder": "JsonApiDotNetCore.Builders.IMetaBuilder.yml", + "JsonApiDotNetCore.Builders.IMetaBuilder.Add(System.Collections.Generic.Dictionary{System.String,System.Object})": "JsonApiDotNetCore.Builders.IMetaBuilder.yml", + "JsonApiDotNetCore.Builders.IMetaBuilder.Add(System.String,System.Object)": "JsonApiDotNetCore.Builders.IMetaBuilder.yml", + "JsonApiDotNetCore.Builders.IMetaBuilder.Build": "JsonApiDotNetCore.Builders.IMetaBuilder.yml", + "JsonApiDotNetCore.Builders.LinkBuilder": "JsonApiDotNetCore.Builders.LinkBuilder.yml", + "JsonApiDotNetCore.Builders.LinkBuilder.#ctor(JsonApiDotNetCore.Services.IJsonApiContext)": "JsonApiDotNetCore.Builders.LinkBuilder.yml", + "JsonApiDotNetCore.Builders.LinkBuilder.GetBasePath(Microsoft.AspNetCore.Http.HttpContext,System.String)": "JsonApiDotNetCore.Builders.LinkBuilder.yml", + "JsonApiDotNetCore.Builders.LinkBuilder.GetPageLink(System.Int32,System.Int32)": "JsonApiDotNetCore.Builders.LinkBuilder.yml", + "JsonApiDotNetCore.Builders.LinkBuilder.GetRelatedRelationLink(System.String,System.String,System.String)": "JsonApiDotNetCore.Builders.LinkBuilder.yml", + "JsonApiDotNetCore.Builders.LinkBuilder.GetSelfRelationLink(System.String,System.String,System.String)": "JsonApiDotNetCore.Builders.LinkBuilder.yml", + "JsonApiDotNetCore.Builders.MetaBuilder": "JsonApiDotNetCore.Builders.MetaBuilder.yml", + "JsonApiDotNetCore.Builders.MetaBuilder.Add(System.Collections.Generic.Dictionary{System.String,System.Object})": "JsonApiDotNetCore.Builders.MetaBuilder.yml", + "JsonApiDotNetCore.Builders.MetaBuilder.Add(System.String,System.Object)": "JsonApiDotNetCore.Builders.MetaBuilder.yml", + "JsonApiDotNetCore.Builders.MetaBuilder.Build": "JsonApiDotNetCore.Builders.MetaBuilder.yml", + "JsonApiDotNetCore.Configuration": "JsonApiDotNetCore.Configuration.yml", + "JsonApiDotNetCore.Configuration.JsonApiOptions": "JsonApiDotNetCore.Configuration.JsonApiOptions.yml", + "JsonApiDotNetCore.Configuration.JsonApiOptions.AllowClientGeneratedIds": "JsonApiDotNetCore.Configuration.JsonApiOptions.yml", + "JsonApiDotNetCore.Configuration.JsonApiOptions.AllowCustomQueryParameters": "JsonApiDotNetCore.Configuration.JsonApiOptions.yml", + "JsonApiDotNetCore.Configuration.JsonApiOptions.BuildContextGraph(System.Action{JsonApiDotNetCore.Builders.IContextGraphBuilder})": "JsonApiDotNetCore.Configuration.JsonApiOptions.yml", + "JsonApiDotNetCore.Configuration.JsonApiOptions.BuildContextGraph``1(System.Action{JsonApiDotNetCore.Builders.IContextGraphBuilder})": "JsonApiDotNetCore.Configuration.JsonApiOptions.yml", + "JsonApiDotNetCore.Configuration.JsonApiOptions.ContextGraph": "JsonApiDotNetCore.Configuration.JsonApiOptions.yml", + "JsonApiDotNetCore.Configuration.JsonApiOptions.DefaultPageSize": "JsonApiDotNetCore.Configuration.JsonApiOptions.yml", + "JsonApiDotNetCore.Configuration.JsonApiOptions.DisableErrorSource": "JsonApiDotNetCore.Configuration.JsonApiOptions.yml", + "JsonApiDotNetCore.Configuration.JsonApiOptions.DisableErrorStackTraces": "JsonApiDotNetCore.Configuration.JsonApiOptions.yml", + "JsonApiDotNetCore.Configuration.JsonApiOptions.EnableExtension(JsonApiDotNetCore.Models.JsonApiExtension)": "JsonApiDotNetCore.Configuration.JsonApiOptions.yml", + "JsonApiDotNetCore.Configuration.JsonApiOptions.EnableOperations": "JsonApiDotNetCore.Configuration.JsonApiOptions.yml", + "JsonApiDotNetCore.Configuration.JsonApiOptions.IncludeTotalRecordCount": "JsonApiDotNetCore.Configuration.JsonApiOptions.yml", + "JsonApiDotNetCore.Configuration.JsonApiOptions.JsonContractResolver": "JsonApiDotNetCore.Configuration.JsonApiOptions.yml", + "JsonApiDotNetCore.Configuration.JsonApiOptions.Namespace": "JsonApiDotNetCore.Configuration.JsonApiOptions.yml", + "JsonApiDotNetCore.Configuration.JsonApiOptions.NullAttributeResponseBehavior": "JsonApiDotNetCore.Configuration.JsonApiOptions.yml", + "JsonApiDotNetCore.Configuration.JsonApiOptions.RelativeLinks": "JsonApiDotNetCore.Configuration.JsonApiOptions.yml", + "JsonApiDotNetCore.Configuration.JsonApiOptions.SerializerSettings": "JsonApiDotNetCore.Configuration.JsonApiOptions.yml", + "JsonApiDotNetCore.Configuration.NullAttributeResponseBehavior": "JsonApiDotNetCore.Configuration.NullAttributeResponseBehavior.yml", + "JsonApiDotNetCore.Configuration.NullAttributeResponseBehavior.#ctor(System.Boolean,System.Boolean)": "JsonApiDotNetCore.Configuration.NullAttributeResponseBehavior.yml", + "JsonApiDotNetCore.Configuration.NullAttributeResponseBehavior.AllowClientOverride": "JsonApiDotNetCore.Configuration.NullAttributeResponseBehavior.yml", + "JsonApiDotNetCore.Configuration.NullAttributeResponseBehavior.OmitNullValuedAttributes": "JsonApiDotNetCore.Configuration.NullAttributeResponseBehavior.yml", + "JsonApiDotNetCore.Controllers": "JsonApiDotNetCore.Controllers.yml", + "JsonApiDotNetCore.Controllers.BaseJsonApiController`1": "JsonApiDotNetCore.Controllers.BaseJsonApiController-1.yml", + "JsonApiDotNetCore.Controllers.BaseJsonApiController`1.#ctor(JsonApiDotNetCore.Services.IJsonApiContext,JsonApiDotNetCore.Services.IGetAllService{`0,System.Int32},JsonApiDotNetCore.Services.IGetByIdService{`0,System.Int32},JsonApiDotNetCore.Services.IGetRelationshipService{`0,System.Int32},JsonApiDotNetCore.Services.IGetRelationshipsService{`0,System.Int32},JsonApiDotNetCore.Services.ICreateService{`0,System.Int32},JsonApiDotNetCore.Services.IUpdateService{`0,System.Int32},JsonApiDotNetCore.Services.IUpdateRelationshipService{`0,System.Int32},JsonApiDotNetCore.Services.IDeleteService{`0,System.Int32})": "JsonApiDotNetCore.Controllers.BaseJsonApiController-1.yml", + "JsonApiDotNetCore.Controllers.BaseJsonApiController`1.#ctor(JsonApiDotNetCore.Services.IJsonApiContext,JsonApiDotNetCore.Services.IResourceQueryService{`0,System.Int32},JsonApiDotNetCore.Services.IResourceCmdService{`0,System.Int32})": "JsonApiDotNetCore.Controllers.BaseJsonApiController-1.yml", + "JsonApiDotNetCore.Controllers.BaseJsonApiController`1.#ctor(JsonApiDotNetCore.Services.IJsonApiContext,JsonApiDotNetCore.Services.IResourceService{`0,System.Int32})": "JsonApiDotNetCore.Controllers.BaseJsonApiController-1.yml", + "JsonApiDotNetCore.Controllers.BaseJsonApiController`2": "JsonApiDotNetCore.Controllers.BaseJsonApiController-2.yml", + "JsonApiDotNetCore.Controllers.BaseJsonApiController`2.#ctor(JsonApiDotNetCore.Services.IJsonApiContext,JsonApiDotNetCore.Services.IGetAllService{`0,`1},JsonApiDotNetCore.Services.IGetByIdService{`0,`1},JsonApiDotNetCore.Services.IGetRelationshipService{`0,`1},JsonApiDotNetCore.Services.IGetRelationshipsService{`0,`1},JsonApiDotNetCore.Services.ICreateService{`0,`1},JsonApiDotNetCore.Services.IUpdateService{`0,`1},JsonApiDotNetCore.Services.IUpdateRelationshipService{`0,`1},JsonApiDotNetCore.Services.IDeleteService{`0,`1})": "JsonApiDotNetCore.Controllers.BaseJsonApiController-2.yml", + "JsonApiDotNetCore.Controllers.BaseJsonApiController`2.#ctor(JsonApiDotNetCore.Services.IJsonApiContext,JsonApiDotNetCore.Services.IResourceQueryService{`0,`1},JsonApiDotNetCore.Services.IResourceCmdService{`0,`1})": "JsonApiDotNetCore.Controllers.BaseJsonApiController-2.yml", + "JsonApiDotNetCore.Controllers.BaseJsonApiController`2.#ctor(JsonApiDotNetCore.Services.IJsonApiContext,JsonApiDotNetCore.Services.IResourceService{`0,`1})": "JsonApiDotNetCore.Controllers.BaseJsonApiController-2.yml", + "JsonApiDotNetCore.Controllers.BaseJsonApiController`2.DeleteAsync(`1)": "JsonApiDotNetCore.Controllers.BaseJsonApiController-2.yml", + "JsonApiDotNetCore.Controllers.BaseJsonApiController`2.GetAsync": "JsonApiDotNetCore.Controllers.BaseJsonApiController-2.yml", + "JsonApiDotNetCore.Controllers.BaseJsonApiController`2.GetAsync(`1)": "JsonApiDotNetCore.Controllers.BaseJsonApiController-2.yml", + "JsonApiDotNetCore.Controllers.BaseJsonApiController`2.GetRelationshipAsync(`1,System.String)": "JsonApiDotNetCore.Controllers.BaseJsonApiController-2.yml", + "JsonApiDotNetCore.Controllers.BaseJsonApiController`2.GetRelationshipsAsync(`1,System.String)": "JsonApiDotNetCore.Controllers.BaseJsonApiController-2.yml", + "JsonApiDotNetCore.Controllers.BaseJsonApiController`2.PatchAsync(`1,`0)": "JsonApiDotNetCore.Controllers.BaseJsonApiController-2.yml", + "JsonApiDotNetCore.Controllers.BaseJsonApiController`2.PatchRelationshipsAsync(`1,System.String,System.Collections.Generic.List{JsonApiDotNetCore.Models.DocumentData})": "JsonApiDotNetCore.Controllers.BaseJsonApiController-2.yml", + "JsonApiDotNetCore.Controllers.BaseJsonApiController`2.PostAsync(`0)": "JsonApiDotNetCore.Controllers.BaseJsonApiController-2.yml", + "JsonApiDotNetCore.Controllers.DisableQueryAttribute": "JsonApiDotNetCore.Controllers.DisableQueryAttribute.yml", + "JsonApiDotNetCore.Controllers.DisableQueryAttribute.#ctor(JsonApiDotNetCore.Controllers.QueryParams)": "JsonApiDotNetCore.Controllers.DisableQueryAttribute.yml", + "JsonApiDotNetCore.Controllers.DisableQueryAttribute.QueryParams": "JsonApiDotNetCore.Controllers.DisableQueryAttribute.yml", + "JsonApiDotNetCore.Controllers.DisableRoutingConventionAttribute": "JsonApiDotNetCore.Controllers.DisableRoutingConventionAttribute.yml", + "JsonApiDotNetCore.Controllers.HttpReadOnlyAttribute": "JsonApiDotNetCore.Controllers.HttpReadOnlyAttribute.yml", + "JsonApiDotNetCore.Controllers.HttpReadOnlyAttribute.Methods": "JsonApiDotNetCore.Controllers.HttpReadOnlyAttribute.yml", + "JsonApiDotNetCore.Controllers.HttpRestrictAttribute": "JsonApiDotNetCore.Controllers.HttpRestrictAttribute.yml", + "JsonApiDotNetCore.Controllers.HttpRestrictAttribute.Methods": "JsonApiDotNetCore.Controllers.HttpRestrictAttribute.yml", + "JsonApiDotNetCore.Controllers.HttpRestrictAttribute.OnActionExecutionAsync(Microsoft.AspNetCore.Mvc.Filters.ActionExecutingContext,Microsoft.AspNetCore.Mvc.Filters.ActionExecutionDelegate)": "JsonApiDotNetCore.Controllers.HttpRestrictAttribute.yml", + "JsonApiDotNetCore.Controllers.JsonApiCmdController`1": "JsonApiDotNetCore.Controllers.JsonApiCmdController-1.yml", + "JsonApiDotNetCore.Controllers.JsonApiCmdController`1.#ctor(JsonApiDotNetCore.Services.IJsonApiContext,JsonApiDotNetCore.Services.IResourceService{`0,System.Int32})": "JsonApiDotNetCore.Controllers.JsonApiCmdController-1.yml", + "JsonApiDotNetCore.Controllers.JsonApiCmdController`2": "JsonApiDotNetCore.Controllers.JsonApiCmdController-2.yml", + "JsonApiDotNetCore.Controllers.JsonApiCmdController`2.#ctor(JsonApiDotNetCore.Services.IJsonApiContext,JsonApiDotNetCore.Services.IResourceService{`0,`1})": "JsonApiDotNetCore.Controllers.JsonApiCmdController-2.yml", + "JsonApiDotNetCore.Controllers.JsonApiCmdController`2.DeleteAsync(`1)": "JsonApiDotNetCore.Controllers.JsonApiCmdController-2.yml", + "JsonApiDotNetCore.Controllers.JsonApiCmdController`2.PatchAsync(`1,`0)": "JsonApiDotNetCore.Controllers.JsonApiCmdController-2.yml", + "JsonApiDotNetCore.Controllers.JsonApiCmdController`2.PatchRelationshipsAsync(`1,System.String,System.Collections.Generic.List{JsonApiDotNetCore.Models.DocumentData})": "JsonApiDotNetCore.Controllers.JsonApiCmdController-2.yml", + "JsonApiDotNetCore.Controllers.JsonApiCmdController`2.PostAsync(`0)": "JsonApiDotNetCore.Controllers.JsonApiCmdController-2.yml", + "JsonApiDotNetCore.Controllers.JsonApiController`1": "JsonApiDotNetCore.Controllers.JsonApiController-1.yml", + "JsonApiDotNetCore.Controllers.JsonApiController`1.#ctor(JsonApiDotNetCore.Services.IJsonApiContext,JsonApiDotNetCore.Services.IGetAllService{`0,System.Int32},JsonApiDotNetCore.Services.IGetByIdService{`0,System.Int32},JsonApiDotNetCore.Services.IGetRelationshipService{`0,System.Int32},JsonApiDotNetCore.Services.IGetRelationshipsService{`0,System.Int32},JsonApiDotNetCore.Services.ICreateService{`0,System.Int32},JsonApiDotNetCore.Services.IUpdateService{`0,System.Int32},JsonApiDotNetCore.Services.IUpdateRelationshipService{`0,System.Int32},JsonApiDotNetCore.Services.IDeleteService{`0,System.Int32})": "JsonApiDotNetCore.Controllers.JsonApiController-1.yml", + "JsonApiDotNetCore.Controllers.JsonApiController`1.#ctor(JsonApiDotNetCore.Services.IJsonApiContext,JsonApiDotNetCore.Services.IResourceService{`0,System.Int32},Microsoft.Extensions.Logging.ILoggerFactory)": "JsonApiDotNetCore.Controllers.JsonApiController-1.yml", + "JsonApiDotNetCore.Controllers.JsonApiController`2": "JsonApiDotNetCore.Controllers.JsonApiController-2.yml", + "JsonApiDotNetCore.Controllers.JsonApiController`2.#ctor(JsonApiDotNetCore.Services.IJsonApiContext,JsonApiDotNetCore.Services.IGetAllService{`0,`1},JsonApiDotNetCore.Services.IGetByIdService{`0,`1},JsonApiDotNetCore.Services.IGetRelationshipService{`0,`1},JsonApiDotNetCore.Services.IGetRelationshipsService{`0,`1},JsonApiDotNetCore.Services.ICreateService{`0,`1},JsonApiDotNetCore.Services.IUpdateService{`0,`1},JsonApiDotNetCore.Services.IUpdateRelationshipService{`0,`1},JsonApiDotNetCore.Services.IDeleteService{`0,`1})": "JsonApiDotNetCore.Controllers.JsonApiController-2.yml", + "JsonApiDotNetCore.Controllers.JsonApiController`2.#ctor(JsonApiDotNetCore.Services.IJsonApiContext,JsonApiDotNetCore.Services.IResourceService{`0,`1})": "JsonApiDotNetCore.Controllers.JsonApiController-2.yml", + "JsonApiDotNetCore.Controllers.JsonApiController`2.#ctor(JsonApiDotNetCore.Services.IJsonApiContext,JsonApiDotNetCore.Services.IResourceService{`0,`1},Microsoft.Extensions.Logging.ILoggerFactory)": "JsonApiDotNetCore.Controllers.JsonApiController-2.yml", + "JsonApiDotNetCore.Controllers.JsonApiController`2.DeleteAsync(`1)": "JsonApiDotNetCore.Controllers.JsonApiController-2.yml", + "JsonApiDotNetCore.Controllers.JsonApiController`2.GetAsync": "JsonApiDotNetCore.Controllers.JsonApiController-2.yml", + "JsonApiDotNetCore.Controllers.JsonApiController`2.GetAsync(`1)": "JsonApiDotNetCore.Controllers.JsonApiController-2.yml", + "JsonApiDotNetCore.Controllers.JsonApiController`2.GetRelationshipAsync(`1,System.String)": "JsonApiDotNetCore.Controllers.JsonApiController-2.yml", + "JsonApiDotNetCore.Controllers.JsonApiController`2.GetRelationshipsAsync(`1,System.String)": "JsonApiDotNetCore.Controllers.JsonApiController-2.yml", + "JsonApiDotNetCore.Controllers.JsonApiController`2.PatchAsync(`1,`0)": "JsonApiDotNetCore.Controllers.JsonApiController-2.yml", + "JsonApiDotNetCore.Controllers.JsonApiController`2.PatchRelationshipsAsync(`1,System.String,System.Collections.Generic.List{JsonApiDotNetCore.Models.DocumentData})": "JsonApiDotNetCore.Controllers.JsonApiController-2.yml", + "JsonApiDotNetCore.Controllers.JsonApiController`2.PostAsync(`0)": "JsonApiDotNetCore.Controllers.JsonApiController-2.yml", + "JsonApiDotNetCore.Controllers.JsonApiControllerMixin": "JsonApiDotNetCore.Controllers.JsonApiControllerMixin.yml", + "JsonApiDotNetCore.Controllers.JsonApiControllerMixin.Error(JsonApiDotNetCore.Internal.Error)": "JsonApiDotNetCore.Controllers.JsonApiControllerMixin.yml", + "JsonApiDotNetCore.Controllers.JsonApiControllerMixin.Errors(JsonApiDotNetCore.Internal.ErrorCollection)": "JsonApiDotNetCore.Controllers.JsonApiControllerMixin.yml", + "JsonApiDotNetCore.Controllers.JsonApiControllerMixin.Forbidden": "JsonApiDotNetCore.Controllers.JsonApiControllerMixin.yml", + "JsonApiDotNetCore.Controllers.JsonApiControllerMixin.UnprocessableEntity": "JsonApiDotNetCore.Controllers.JsonApiControllerMixin.yml", + "JsonApiDotNetCore.Controllers.JsonApiOperationsController": "JsonApiDotNetCore.Controllers.JsonApiOperationsController.yml", + "JsonApiDotNetCore.Controllers.JsonApiOperationsController.#ctor(JsonApiDotNetCore.Services.Operations.IOperationsProcessor)": "JsonApiDotNetCore.Controllers.JsonApiOperationsController.yml", + "JsonApiDotNetCore.Controllers.JsonApiOperationsController.PatchAsync(JsonApiDotNetCore.Models.Operations.OperationsDocument)": "JsonApiDotNetCore.Controllers.JsonApiOperationsController.yml", + "JsonApiDotNetCore.Controllers.JsonApiQueryController`1": "JsonApiDotNetCore.Controllers.JsonApiQueryController-1.yml", + "JsonApiDotNetCore.Controllers.JsonApiQueryController`1.#ctor(JsonApiDotNetCore.Services.IJsonApiContext,JsonApiDotNetCore.Services.IResourceService{`0,System.Int32})": "JsonApiDotNetCore.Controllers.JsonApiQueryController-1.yml", + "JsonApiDotNetCore.Controllers.JsonApiQueryController`2": "JsonApiDotNetCore.Controllers.JsonApiQueryController-2.yml", + "JsonApiDotNetCore.Controllers.JsonApiQueryController`2.#ctor(JsonApiDotNetCore.Services.IJsonApiContext,JsonApiDotNetCore.Services.IResourceService{`0,`1})": "JsonApiDotNetCore.Controllers.JsonApiQueryController-2.yml", + "JsonApiDotNetCore.Controllers.JsonApiQueryController`2.GetAsync": "JsonApiDotNetCore.Controllers.JsonApiQueryController-2.yml", + "JsonApiDotNetCore.Controllers.JsonApiQueryController`2.GetAsync(`1)": "JsonApiDotNetCore.Controllers.JsonApiQueryController-2.yml", + "JsonApiDotNetCore.Controllers.JsonApiQueryController`2.GetRelationshipAsync(`1,System.String)": "JsonApiDotNetCore.Controllers.JsonApiQueryController-2.yml", + "JsonApiDotNetCore.Controllers.JsonApiQueryController`2.GetRelationshipsAsync(`1,System.String)": "JsonApiDotNetCore.Controllers.JsonApiQueryController-2.yml", + "JsonApiDotNetCore.Controllers.NoHttpDeleteAttribute": "JsonApiDotNetCore.Controllers.NoHttpDeleteAttribute.yml", + "JsonApiDotNetCore.Controllers.NoHttpDeleteAttribute.Methods": "JsonApiDotNetCore.Controllers.NoHttpDeleteAttribute.yml", + "JsonApiDotNetCore.Controllers.NoHttpPatchAttribute": "JsonApiDotNetCore.Controllers.NoHttpPatchAttribute.yml", + "JsonApiDotNetCore.Controllers.NoHttpPatchAttribute.Methods": "JsonApiDotNetCore.Controllers.NoHttpPatchAttribute.yml", + "JsonApiDotNetCore.Controllers.NoHttpPostAttribute": "JsonApiDotNetCore.Controllers.NoHttpPostAttribute.yml", + "JsonApiDotNetCore.Controllers.NoHttpPostAttribute.Methods": "JsonApiDotNetCore.Controllers.NoHttpPostAttribute.yml", + "JsonApiDotNetCore.Controllers.QueryParams": "JsonApiDotNetCore.Controllers.QueryParams.yml", + "JsonApiDotNetCore.Controllers.QueryParams.All": "JsonApiDotNetCore.Controllers.QueryParams.yml", + "JsonApiDotNetCore.Controllers.QueryParams.Fields": "JsonApiDotNetCore.Controllers.QueryParams.yml", + "JsonApiDotNetCore.Controllers.QueryParams.Filter": "JsonApiDotNetCore.Controllers.QueryParams.yml", + "JsonApiDotNetCore.Controllers.QueryParams.Include": "JsonApiDotNetCore.Controllers.QueryParams.yml", + "JsonApiDotNetCore.Controllers.QueryParams.None": "JsonApiDotNetCore.Controllers.QueryParams.yml", + "JsonApiDotNetCore.Controllers.QueryParams.Page": "JsonApiDotNetCore.Controllers.QueryParams.yml", + "JsonApiDotNetCore.Controllers.QueryParams.Sort": "JsonApiDotNetCore.Controllers.QueryParams.yml", + "JsonApiDotNetCore.Data": "JsonApiDotNetCore.Data.yml", + "JsonApiDotNetCore.Data.DbContextResolver`1": "JsonApiDotNetCore.Data.DbContextResolver-1.yml", + "JsonApiDotNetCore.Data.DbContextResolver`1.#ctor(`0)": "JsonApiDotNetCore.Data.DbContextResolver-1.yml", + "JsonApiDotNetCore.Data.DbContextResolver`1.GetContext": "JsonApiDotNetCore.Data.DbContextResolver-1.yml", + "JsonApiDotNetCore.Data.DbContextResolver`1.GetDbSet``1": "JsonApiDotNetCore.Data.DbContextResolver-1.yml", + "JsonApiDotNetCore.Data.DefaultEntityRepository`1": "JsonApiDotNetCore.Data.DefaultEntityRepository-1.yml", + "JsonApiDotNetCore.Data.DefaultEntityRepository`1.#ctor(Microsoft.Extensions.Logging.ILoggerFactory,JsonApiDotNetCore.Services.IJsonApiContext,JsonApiDotNetCore.Data.IDbContextResolver)": "JsonApiDotNetCore.Data.DefaultEntityRepository-1.yml", + "JsonApiDotNetCore.Data.DefaultEntityRepository`2": "JsonApiDotNetCore.Data.DefaultEntityRepository-2.yml", + "JsonApiDotNetCore.Data.DefaultEntityRepository`2.#ctor(Microsoft.Extensions.Logging.ILoggerFactory,JsonApiDotNetCore.Services.IJsonApiContext,JsonApiDotNetCore.Data.IDbContextResolver)": "JsonApiDotNetCore.Data.DefaultEntityRepository-2.yml", + "JsonApiDotNetCore.Data.DefaultEntityRepository`2.CountAsync(System.Linq.IQueryable{`0})": "JsonApiDotNetCore.Data.DefaultEntityRepository-2.yml", + "JsonApiDotNetCore.Data.DefaultEntityRepository`2.CreateAsync(`0)": "JsonApiDotNetCore.Data.DefaultEntityRepository-2.yml", + "JsonApiDotNetCore.Data.DefaultEntityRepository`2.DeleteAsync(`1)": "JsonApiDotNetCore.Data.DefaultEntityRepository-2.yml", + "JsonApiDotNetCore.Data.DefaultEntityRepository`2.Filter(System.Linq.IQueryable{`0},JsonApiDotNetCore.Internal.Query.FilterQuery)": "JsonApiDotNetCore.Data.DefaultEntityRepository-2.yml", + "JsonApiDotNetCore.Data.DefaultEntityRepository`2.FirstOrDefaultAsync(System.Linq.IQueryable{`0})": "JsonApiDotNetCore.Data.DefaultEntityRepository-2.yml", + "JsonApiDotNetCore.Data.DefaultEntityRepository`2.Get": "JsonApiDotNetCore.Data.DefaultEntityRepository-2.yml", + "JsonApiDotNetCore.Data.DefaultEntityRepository`2.GetAndIncludeAsync(`1,System.String)": "JsonApiDotNetCore.Data.DefaultEntityRepository-2.yml", + "JsonApiDotNetCore.Data.DefaultEntityRepository`2.GetAsync(`1)": "JsonApiDotNetCore.Data.DefaultEntityRepository-2.yml", + "JsonApiDotNetCore.Data.DefaultEntityRepository`2.Include(System.Linq.IQueryable{`0},System.String)": "JsonApiDotNetCore.Data.DefaultEntityRepository-2.yml", + "JsonApiDotNetCore.Data.DefaultEntityRepository`2.PageAsync(System.Linq.IQueryable{`0},System.Int32,System.Int32)": "JsonApiDotNetCore.Data.DefaultEntityRepository-2.yml", + "JsonApiDotNetCore.Data.DefaultEntityRepository`2.Sort(System.Linq.IQueryable{`0},System.Collections.Generic.List{JsonApiDotNetCore.Internal.Query.SortQuery})": "JsonApiDotNetCore.Data.DefaultEntityRepository-2.yml", + "JsonApiDotNetCore.Data.DefaultEntityRepository`2.ToListAsync(System.Linq.IQueryable{`0})": "JsonApiDotNetCore.Data.DefaultEntityRepository-2.yml", + "JsonApiDotNetCore.Data.DefaultEntityRepository`2.UpdateAsync(`1,`0)": "JsonApiDotNetCore.Data.DefaultEntityRepository-2.yml", + "JsonApiDotNetCore.Data.DefaultEntityRepository`2.UpdateRelationshipsAsync(System.Object,JsonApiDotNetCore.Models.RelationshipAttribute,System.Collections.Generic.IEnumerable{System.String})": "JsonApiDotNetCore.Data.DefaultEntityRepository-2.yml", + "JsonApiDotNetCore.Data.IDbContextResolver": "JsonApiDotNetCore.Data.IDbContextResolver.yml", + "JsonApiDotNetCore.Data.IDbContextResolver.GetContext": "JsonApiDotNetCore.Data.IDbContextResolver.yml", + "JsonApiDotNetCore.Data.IDbContextResolver.GetDbSet``1": "JsonApiDotNetCore.Data.IDbContextResolver.yml", + "JsonApiDotNetCore.Data.IEntityReadRepository`1": "JsonApiDotNetCore.Data.IEntityReadRepository-1.yml", + "JsonApiDotNetCore.Data.IEntityReadRepository`2": "JsonApiDotNetCore.Data.IEntityReadRepository-2.yml", + "JsonApiDotNetCore.Data.IEntityReadRepository`2.CountAsync(System.Linq.IQueryable{`0})": "JsonApiDotNetCore.Data.IEntityReadRepository-2.yml", + "JsonApiDotNetCore.Data.IEntityReadRepository`2.Filter(System.Linq.IQueryable{`0},JsonApiDotNetCore.Internal.Query.FilterQuery)": "JsonApiDotNetCore.Data.IEntityReadRepository-2.yml", + "JsonApiDotNetCore.Data.IEntityReadRepository`2.FirstOrDefaultAsync(System.Linq.IQueryable{`0})": "JsonApiDotNetCore.Data.IEntityReadRepository-2.yml", + "JsonApiDotNetCore.Data.IEntityReadRepository`2.Get": "JsonApiDotNetCore.Data.IEntityReadRepository-2.yml", + "JsonApiDotNetCore.Data.IEntityReadRepository`2.GetAndIncludeAsync(`1,System.String)": "JsonApiDotNetCore.Data.IEntityReadRepository-2.yml", + "JsonApiDotNetCore.Data.IEntityReadRepository`2.GetAsync(`1)": "JsonApiDotNetCore.Data.IEntityReadRepository-2.yml", + "JsonApiDotNetCore.Data.IEntityReadRepository`2.Include(System.Linq.IQueryable{`0},System.String)": "JsonApiDotNetCore.Data.IEntityReadRepository-2.yml", + "JsonApiDotNetCore.Data.IEntityReadRepository`2.PageAsync(System.Linq.IQueryable{`0},System.Int32,System.Int32)": "JsonApiDotNetCore.Data.IEntityReadRepository-2.yml", + "JsonApiDotNetCore.Data.IEntityReadRepository`2.Sort(System.Linq.IQueryable{`0},System.Collections.Generic.List{JsonApiDotNetCore.Internal.Query.SortQuery})": "JsonApiDotNetCore.Data.IEntityReadRepository-2.yml", + "JsonApiDotNetCore.Data.IEntityReadRepository`2.ToListAsync(System.Linq.IQueryable{`0})": "JsonApiDotNetCore.Data.IEntityReadRepository-2.yml", + "JsonApiDotNetCore.Data.IEntityRepository`1": "JsonApiDotNetCore.Data.IEntityRepository-1.yml", + "JsonApiDotNetCore.Data.IEntityRepository`2": "JsonApiDotNetCore.Data.IEntityRepository-2.yml", + "JsonApiDotNetCore.Data.IEntityWriteRepository`1": "JsonApiDotNetCore.Data.IEntityWriteRepository-1.yml", + "JsonApiDotNetCore.Data.IEntityWriteRepository`2": "JsonApiDotNetCore.Data.IEntityWriteRepository-2.yml", + "JsonApiDotNetCore.Data.IEntityWriteRepository`2.CreateAsync(`0)": "JsonApiDotNetCore.Data.IEntityWriteRepository-2.yml", + "JsonApiDotNetCore.Data.IEntityWriteRepository`2.DeleteAsync(`1)": "JsonApiDotNetCore.Data.IEntityWriteRepository-2.yml", + "JsonApiDotNetCore.Data.IEntityWriteRepository`2.UpdateAsync(`1,`0)": "JsonApiDotNetCore.Data.IEntityWriteRepository-2.yml", + "JsonApiDotNetCore.Data.IEntityWriteRepository`2.UpdateRelationshipsAsync(System.Object,JsonApiDotNetCore.Models.RelationshipAttribute,System.Collections.Generic.IEnumerable{System.String})": "JsonApiDotNetCore.Data.IEntityWriteRepository-2.yml", + "JsonApiDotNetCore.Extensions": "JsonApiDotNetCore.Extensions.yml", + "JsonApiDotNetCore.Extensions.DbContextExtensions": "JsonApiDotNetCore.Extensions.DbContextExtensions.yml", + "JsonApiDotNetCore.Extensions.DbContextExtensions.GetDbSet``1(Microsoft.EntityFrameworkCore.DbContext)": "JsonApiDotNetCore.Extensions.DbContextExtensions.yml", + "JsonApiDotNetCore.Extensions.IApplicationBuilderExtensions": "JsonApiDotNetCore.Extensions.IApplicationBuilderExtensions.yml", + "JsonApiDotNetCore.Extensions.IApplicationBuilderExtensions.UseJsonApi(Microsoft.AspNetCore.Builder.IApplicationBuilder,System.Boolean)": "JsonApiDotNetCore.Extensions.IApplicationBuilderExtensions.yml", + "JsonApiDotNetCore.Extensions.IQueryableExtensions": "JsonApiDotNetCore.Extensions.IQueryableExtensions.yml", + "JsonApiDotNetCore.Extensions.IQueryableExtensions.Filter``1(System.Linq.IQueryable{``0},JsonApiDotNetCore.Internal.Query.AttrFilterQuery)": "JsonApiDotNetCore.Extensions.IQueryableExtensions.yml", + "JsonApiDotNetCore.Extensions.IQueryableExtensions.Filter``1(System.Linq.IQueryable{``0},JsonApiDotNetCore.Internal.Query.RelatedAttrFilterQuery)": "JsonApiDotNetCore.Extensions.IQueryableExtensions.yml", + "JsonApiDotNetCore.Extensions.IQueryableExtensions.Filter``1(System.Linq.IQueryable{``0},JsonApiDotNetCore.Services.IJsonApiContext,JsonApiDotNetCore.Internal.Query.FilterQuery)": "JsonApiDotNetCore.Extensions.IQueryableExtensions.yml", + "JsonApiDotNetCore.Extensions.IQueryableExtensions.OrderBy``1(System.Linq.IQueryable{``0},System.String)": "JsonApiDotNetCore.Extensions.IQueryableExtensions.yml", + "JsonApiDotNetCore.Extensions.IQueryableExtensions.OrderByDescending``1(System.Linq.IQueryable{``0},System.String)": "JsonApiDotNetCore.Extensions.IQueryableExtensions.yml", + "JsonApiDotNetCore.Extensions.IQueryableExtensions.PageForward``1(System.Linq.IQueryable{``0},System.Int32,System.Int32)": "JsonApiDotNetCore.Extensions.IQueryableExtensions.yml", + "JsonApiDotNetCore.Extensions.IQueryableExtensions.Select``1(System.Linq.IQueryable{``0},System.Collections.Generic.List{System.String})": "JsonApiDotNetCore.Extensions.IQueryableExtensions.yml", + "JsonApiDotNetCore.Extensions.IQueryableExtensions.Sort``1(System.Linq.IOrderedQueryable{``0},JsonApiDotNetCore.Internal.Query.SortQuery)": "JsonApiDotNetCore.Extensions.IQueryableExtensions.yml", + "JsonApiDotNetCore.Extensions.IQueryableExtensions.Sort``1(System.Linq.IQueryable{``0},JsonApiDotNetCore.Internal.Query.SortQuery)": "JsonApiDotNetCore.Extensions.IQueryableExtensions.yml", + "JsonApiDotNetCore.Extensions.IQueryableExtensions.Sort``1(System.Linq.IQueryable{``0},System.Collections.Generic.List{JsonApiDotNetCore.Internal.Query.SortQuery})": "JsonApiDotNetCore.Extensions.IQueryableExtensions.yml", + "JsonApiDotNetCore.Extensions.IQueryableExtensions.ThenBy``1(System.Linq.IOrderedQueryable{``0},System.String)": "JsonApiDotNetCore.Extensions.IQueryableExtensions.yml", + "JsonApiDotNetCore.Extensions.IQueryableExtensions.ThenByDescending``1(System.Linq.IOrderedQueryable{``0},System.String)": "JsonApiDotNetCore.Extensions.IQueryableExtensions.yml", + "JsonApiDotNetCore.Extensions.IServiceCollectionExtensions": "JsonApiDotNetCore.Extensions.IServiceCollectionExtensions.yml", + "JsonApiDotNetCore.Extensions.IServiceCollectionExtensions.AddJsonApi(Microsoft.Extensions.DependencyInjection.IServiceCollection,System.Action{JsonApiDotNetCore.Configuration.JsonApiOptions},Microsoft.Extensions.DependencyInjection.IMvcBuilder)": "JsonApiDotNetCore.Extensions.IServiceCollectionExtensions.yml", + "JsonApiDotNetCore.Extensions.IServiceCollectionExtensions.AddJsonApi``1(Microsoft.Extensions.DependencyInjection.IServiceCollection)": "JsonApiDotNetCore.Extensions.IServiceCollectionExtensions.yml", + "JsonApiDotNetCore.Extensions.IServiceCollectionExtensions.AddJsonApi``1(Microsoft.Extensions.DependencyInjection.IServiceCollection,System.Action{JsonApiDotNetCore.Configuration.JsonApiOptions})": "JsonApiDotNetCore.Extensions.IServiceCollectionExtensions.yml", + "JsonApiDotNetCore.Extensions.IServiceCollectionExtensions.AddJsonApi``1(Microsoft.Extensions.DependencyInjection.IServiceCollection,System.Action{JsonApiDotNetCore.Configuration.JsonApiOptions},Microsoft.Extensions.DependencyInjection.IMvcBuilder)": "JsonApiDotNetCore.Extensions.IServiceCollectionExtensions.yml", + "JsonApiDotNetCore.Extensions.IServiceCollectionExtensions.AddJsonApiInternals(Microsoft.Extensions.DependencyInjection.IServiceCollection,JsonApiDotNetCore.Configuration.JsonApiOptions)": "JsonApiDotNetCore.Extensions.IServiceCollectionExtensions.yml", + "JsonApiDotNetCore.Extensions.IServiceCollectionExtensions.AddJsonApiInternals``1(Microsoft.Extensions.DependencyInjection.IServiceCollection,JsonApiDotNetCore.Configuration.JsonApiOptions)": "JsonApiDotNetCore.Extensions.IServiceCollectionExtensions.yml", + "JsonApiDotNetCore.Extensions.IServiceCollectionExtensions.SerializeAsJsonApi(Microsoft.AspNetCore.Mvc.MvcOptions,JsonApiDotNetCore.Configuration.JsonApiOptions)": "JsonApiDotNetCore.Extensions.IServiceCollectionExtensions.yml", + "JsonApiDotNetCore.Extensions.StringExtensions": "JsonApiDotNetCore.Extensions.StringExtensions.yml", + "JsonApiDotNetCore.Extensions.StringExtensions.Dasherize(System.String)": "JsonApiDotNetCore.Extensions.StringExtensions.yml", + "JsonApiDotNetCore.Extensions.StringExtensions.ToProperCase(System.String)": "JsonApiDotNetCore.Extensions.StringExtensions.yml", + "JsonApiDotNetCore.Formatters": "JsonApiDotNetCore.Formatters.yml", + "JsonApiDotNetCore.Formatters.IJsonApiReader": "JsonApiDotNetCore.Formatters.IJsonApiReader.yml", + "JsonApiDotNetCore.Formatters.IJsonApiReader.ReadAsync(Microsoft.AspNetCore.Mvc.Formatters.InputFormatterContext)": "JsonApiDotNetCore.Formatters.IJsonApiReader.yml", + "JsonApiDotNetCore.Formatters.IJsonApiWriter": "JsonApiDotNetCore.Formatters.IJsonApiWriter.yml", + "JsonApiDotNetCore.Formatters.IJsonApiWriter.WriteAsync(Microsoft.AspNetCore.Mvc.Formatters.OutputFormatterWriteContext)": "JsonApiDotNetCore.Formatters.IJsonApiWriter.yml", + "JsonApiDotNetCore.Formatters.JsonApiInputFormatter": "JsonApiDotNetCore.Formatters.JsonApiInputFormatter.yml", + "JsonApiDotNetCore.Formatters.JsonApiInputFormatter.CanRead(Microsoft.AspNetCore.Mvc.Formatters.InputFormatterContext)": "JsonApiDotNetCore.Formatters.JsonApiInputFormatter.yml", + "JsonApiDotNetCore.Formatters.JsonApiInputFormatter.ReadAsync(Microsoft.AspNetCore.Mvc.Formatters.InputFormatterContext)": "JsonApiDotNetCore.Formatters.JsonApiInputFormatter.yml", + "JsonApiDotNetCore.Formatters.JsonApiOutputFormatter": "JsonApiDotNetCore.Formatters.JsonApiOutputFormatter.yml", + "JsonApiDotNetCore.Formatters.JsonApiOutputFormatter.CanWriteResult(Microsoft.AspNetCore.Mvc.Formatters.OutputFormatterCanWriteContext)": "JsonApiDotNetCore.Formatters.JsonApiOutputFormatter.yml", + "JsonApiDotNetCore.Formatters.JsonApiOutputFormatter.WriteAsync(Microsoft.AspNetCore.Mvc.Formatters.OutputFormatterWriteContext)": "JsonApiDotNetCore.Formatters.JsonApiOutputFormatter.yml", + "JsonApiDotNetCore.Formatters.JsonApiReader": "JsonApiDotNetCore.Formatters.JsonApiReader.yml", + "JsonApiDotNetCore.Formatters.JsonApiReader.#ctor(JsonApiDotNetCore.Serialization.IJsonApiDeSerializer,JsonApiDotNetCore.Services.IJsonApiContext,Microsoft.Extensions.Logging.ILoggerFactory)": "JsonApiDotNetCore.Formatters.JsonApiReader.yml", + "JsonApiDotNetCore.Formatters.JsonApiReader.ReadAsync(Microsoft.AspNetCore.Mvc.Formatters.InputFormatterContext)": "JsonApiDotNetCore.Formatters.JsonApiReader.yml", + "JsonApiDotNetCore.Formatters.JsonApiWriter": "JsonApiDotNetCore.Formatters.JsonApiWriter.yml", + "JsonApiDotNetCore.Formatters.JsonApiWriter.#ctor(JsonApiDotNetCore.Serialization.IJsonApiSerializer,Microsoft.Extensions.Logging.ILoggerFactory)": "JsonApiDotNetCore.Formatters.JsonApiWriter.yml", + "JsonApiDotNetCore.Formatters.JsonApiWriter.WriteAsync(Microsoft.AspNetCore.Mvc.Formatters.OutputFormatterWriteContext)": "JsonApiDotNetCore.Formatters.JsonApiWriter.yml", + "JsonApiDotNetCore.Internal": "JsonApiDotNetCore.Internal.yml", + "JsonApiDotNetCore.Internal.Constants": "JsonApiDotNetCore.Internal.Constants.yml", + "JsonApiDotNetCore.Internal.Constants.AcceptHeader": "JsonApiDotNetCore.Internal.Constants.yml", + "JsonApiDotNetCore.Internal.Constants.ContentType": "JsonApiDotNetCore.Internal.Constants.yml", + "JsonApiDotNetCore.Internal.ContextEntity": "JsonApiDotNetCore.Internal.ContextEntity.yml", + "JsonApiDotNetCore.Internal.ContextEntity.Attributes": "JsonApiDotNetCore.Internal.ContextEntity.yml", + "JsonApiDotNetCore.Internal.ContextEntity.EntityName": "JsonApiDotNetCore.Internal.ContextEntity.yml", + "JsonApiDotNetCore.Internal.ContextEntity.EntityType": "JsonApiDotNetCore.Internal.ContextEntity.yml", + "JsonApiDotNetCore.Internal.ContextEntity.IdentityType": "JsonApiDotNetCore.Internal.ContextEntity.yml", + "JsonApiDotNetCore.Internal.ContextEntity.Links": "JsonApiDotNetCore.Internal.ContextEntity.yml", + "JsonApiDotNetCore.Internal.ContextEntity.Relationships": "JsonApiDotNetCore.Internal.ContextEntity.yml", + "JsonApiDotNetCore.Internal.ContextGraph": "JsonApiDotNetCore.Internal.ContextGraph.yml", + "JsonApiDotNetCore.Internal.ContextGraph.#ctor": "JsonApiDotNetCore.Internal.ContextGraph.yml", + "JsonApiDotNetCore.Internal.ContextGraph.#ctor(System.Collections.Generic.List{JsonApiDotNetCore.Internal.ContextEntity},System.Boolean)": "JsonApiDotNetCore.Internal.ContextGraph.yml", + "JsonApiDotNetCore.Internal.ContextGraph.GetContextEntity(System.String)": "JsonApiDotNetCore.Internal.ContextGraph.yml", + "JsonApiDotNetCore.Internal.ContextGraph.GetContextEntity(System.Type)": "JsonApiDotNetCore.Internal.ContextGraph.yml", + "JsonApiDotNetCore.Internal.ContextGraph.GetRelationship``1(``0,System.String)": "JsonApiDotNetCore.Internal.ContextGraph.yml", + "JsonApiDotNetCore.Internal.ContextGraph.GetRelationshipName``1(System.String)": "JsonApiDotNetCore.Internal.ContextGraph.yml", + "JsonApiDotNetCore.Internal.ContextGraph.UsesDbContext": "JsonApiDotNetCore.Internal.ContextGraph.yml", + "JsonApiDotNetCore.Internal.DasherizedRoutingConvention": "JsonApiDotNetCore.Internal.DasherizedRoutingConvention.yml", + "JsonApiDotNetCore.Internal.DasherizedRoutingConvention.#ctor(System.String)": "JsonApiDotNetCore.Internal.DasherizedRoutingConvention.yml", + "JsonApiDotNetCore.Internal.DasherizedRoutingConvention.Apply(Microsoft.AspNetCore.Mvc.ApplicationModels.ApplicationModel)": "JsonApiDotNetCore.Internal.DasherizedRoutingConvention.yml", + "JsonApiDotNetCore.Internal.Error": "JsonApiDotNetCore.Internal.Error.yml", + "JsonApiDotNetCore.Internal.Error.#ctor": "JsonApiDotNetCore.Internal.Error.yml", + "JsonApiDotNetCore.Internal.Error.#ctor(System.Int32,System.String,JsonApiDotNetCore.Internal.ErrorMeta,System.String)": "JsonApiDotNetCore.Internal.Error.yml", + "JsonApiDotNetCore.Internal.Error.#ctor(System.Int32,System.String,System.String,JsonApiDotNetCore.Internal.ErrorMeta,System.String)": "JsonApiDotNetCore.Internal.Error.yml", + "JsonApiDotNetCore.Internal.Error.#ctor(System.String,System.String,JsonApiDotNetCore.Internal.ErrorMeta,System.String)": "JsonApiDotNetCore.Internal.Error.yml", + "JsonApiDotNetCore.Internal.Error.#ctor(System.String,System.String,System.String,JsonApiDotNetCore.Internal.ErrorMeta,System.String)": "JsonApiDotNetCore.Internal.Error.yml", + "JsonApiDotNetCore.Internal.Error.Detail": "JsonApiDotNetCore.Internal.Error.yml", + "JsonApiDotNetCore.Internal.Error.Meta": "JsonApiDotNetCore.Internal.Error.yml", + "JsonApiDotNetCore.Internal.Error.ShouldSerializeMeta": "JsonApiDotNetCore.Internal.Error.yml", + "JsonApiDotNetCore.Internal.Error.ShouldSerializeSource": "JsonApiDotNetCore.Internal.Error.yml", + "JsonApiDotNetCore.Internal.Error.Source": "JsonApiDotNetCore.Internal.Error.yml", + "JsonApiDotNetCore.Internal.Error.Status": "JsonApiDotNetCore.Internal.Error.yml", + "JsonApiDotNetCore.Internal.Error.StatusCode": "JsonApiDotNetCore.Internal.Error.yml", + "JsonApiDotNetCore.Internal.Error.Title": "JsonApiDotNetCore.Internal.Error.yml", + "JsonApiDotNetCore.Internal.ErrorCollection": "JsonApiDotNetCore.Internal.ErrorCollection.yml", + "JsonApiDotNetCore.Internal.ErrorCollection.#ctor": "JsonApiDotNetCore.Internal.ErrorCollection.yml", + "JsonApiDotNetCore.Internal.ErrorCollection.Add(JsonApiDotNetCore.Internal.Error)": "JsonApiDotNetCore.Internal.ErrorCollection.yml", + "JsonApiDotNetCore.Internal.ErrorCollection.Errors": "JsonApiDotNetCore.Internal.ErrorCollection.yml", + "JsonApiDotNetCore.Internal.ErrorCollection.GetJson": "JsonApiDotNetCore.Internal.ErrorCollection.yml", + "JsonApiDotNetCore.Internal.ErrorMeta": "JsonApiDotNetCore.Internal.ErrorMeta.yml", + "JsonApiDotNetCore.Internal.ErrorMeta.FromException(System.Exception)": "JsonApiDotNetCore.Internal.ErrorMeta.yml", + "JsonApiDotNetCore.Internal.ErrorMeta.StackTrace": "JsonApiDotNetCore.Internal.ErrorMeta.yml", + "JsonApiDotNetCore.Internal.Generics": "JsonApiDotNetCore.Internal.Generics.yml", + "JsonApiDotNetCore.Internal.Generics.GenericProcessor`1": "JsonApiDotNetCore.Internal.Generics.GenericProcessor-1.yml", + "JsonApiDotNetCore.Internal.Generics.GenericProcessor`1.#ctor(JsonApiDotNetCore.Data.IDbContextResolver)": "JsonApiDotNetCore.Internal.Generics.GenericProcessor-1.yml", + "JsonApiDotNetCore.Internal.Generics.GenericProcessor`2": "JsonApiDotNetCore.Internal.Generics.GenericProcessor-2.yml", + "JsonApiDotNetCore.Internal.Generics.GenericProcessor`2.#ctor(JsonApiDotNetCore.Data.IDbContextResolver)": "JsonApiDotNetCore.Internal.Generics.GenericProcessor-2.yml", + "JsonApiDotNetCore.Internal.Generics.GenericProcessor`2.SetRelationships(System.Object,JsonApiDotNetCore.Models.RelationshipAttribute,System.Collections.Generic.IEnumerable{System.String})": "JsonApiDotNetCore.Internal.Generics.GenericProcessor-2.yml", + "JsonApiDotNetCore.Internal.Generics.GenericProcessor`2.UpdateRelationshipsAsync(System.Object,JsonApiDotNetCore.Models.RelationshipAttribute,System.Collections.Generic.IEnumerable{System.String})": "JsonApiDotNetCore.Internal.Generics.GenericProcessor-2.yml", + "JsonApiDotNetCore.Internal.Generics.GenericProcessorFactory": "JsonApiDotNetCore.Internal.Generics.GenericProcessorFactory.yml", + "JsonApiDotNetCore.Internal.Generics.GenericProcessorFactory.#ctor(JsonApiDotNetCore.Services.IScopedServiceProvider)": "JsonApiDotNetCore.Internal.Generics.GenericProcessorFactory.yml", + "JsonApiDotNetCore.Internal.Generics.GenericProcessorFactory.GetProcessor``1(System.Type,System.Type)": "JsonApiDotNetCore.Internal.Generics.GenericProcessorFactory.yml", + "JsonApiDotNetCore.Internal.Generics.GenericProcessorFactory.GetProcessor``1(System.Type,System.Type,System.Type)": "JsonApiDotNetCore.Internal.Generics.GenericProcessorFactory.yml", + "JsonApiDotNetCore.Internal.Generics.IGenericProcessor": "JsonApiDotNetCore.Internal.Generics.IGenericProcessor.yml", + "JsonApiDotNetCore.Internal.Generics.IGenericProcessor.SetRelationships(System.Object,JsonApiDotNetCore.Models.RelationshipAttribute,System.Collections.Generic.IEnumerable{System.String})": "JsonApiDotNetCore.Internal.Generics.IGenericProcessor.yml", + "JsonApiDotNetCore.Internal.Generics.IGenericProcessor.UpdateRelationshipsAsync(System.Object,JsonApiDotNetCore.Models.RelationshipAttribute,System.Collections.Generic.IEnumerable{System.String})": "JsonApiDotNetCore.Internal.Generics.IGenericProcessor.yml", + "JsonApiDotNetCore.Internal.Generics.IGenericProcessorFactory": "JsonApiDotNetCore.Internal.Generics.IGenericProcessorFactory.yml", + "JsonApiDotNetCore.Internal.Generics.IGenericProcessorFactory.GetProcessor``1(System.Type,System.Type)": "JsonApiDotNetCore.Internal.Generics.IGenericProcessorFactory.yml", + "JsonApiDotNetCore.Internal.Generics.IGenericProcessorFactory.GetProcessor``1(System.Type,System.Type,System.Type)": "JsonApiDotNetCore.Internal.Generics.IGenericProcessorFactory.yml", + "JsonApiDotNetCore.Internal.IContextGraph": "JsonApiDotNetCore.Internal.IContextGraph.yml", + "JsonApiDotNetCore.Internal.IContextGraph.GetContextEntity(System.String)": "JsonApiDotNetCore.Internal.IContextGraph.yml", + "JsonApiDotNetCore.Internal.IContextGraph.GetContextEntity(System.Type)": "JsonApiDotNetCore.Internal.IContextGraph.yml", + "JsonApiDotNetCore.Internal.IContextGraph.GetRelationship``1(``0,System.String)": "JsonApiDotNetCore.Internal.IContextGraph.yml", + "JsonApiDotNetCore.Internal.IContextGraph.GetRelationshipName``1(System.String)": "JsonApiDotNetCore.Internal.IContextGraph.yml", + "JsonApiDotNetCore.Internal.IContextGraph.UsesDbContext": "JsonApiDotNetCore.Internal.IContextGraph.yml", + "JsonApiDotNetCore.Internal.JsonApiException": "JsonApiDotNetCore.Internal.JsonApiException.yml", + "JsonApiDotNetCore.Internal.JsonApiException.#ctor(JsonApiDotNetCore.Internal.Error)": "JsonApiDotNetCore.Internal.JsonApiException.yml", + "JsonApiDotNetCore.Internal.JsonApiException.#ctor(JsonApiDotNetCore.Internal.ErrorCollection)": "JsonApiDotNetCore.Internal.JsonApiException.yml", + "JsonApiDotNetCore.Internal.JsonApiException.#ctor(System.Int32,System.String,System.Exception)": "JsonApiDotNetCore.Internal.JsonApiException.yml", + "JsonApiDotNetCore.Internal.JsonApiException.#ctor(System.Int32,System.String,System.String)": "JsonApiDotNetCore.Internal.JsonApiException.yml", + "JsonApiDotNetCore.Internal.JsonApiException.#ctor(System.Int32,System.String,System.String,System.String)": "JsonApiDotNetCore.Internal.JsonApiException.yml", + "JsonApiDotNetCore.Internal.JsonApiException.#ctor(System.String,System.String,System.String)": "JsonApiDotNetCore.Internal.JsonApiException.yml", + "JsonApiDotNetCore.Internal.JsonApiException.#ctor(System.String,System.String,System.String,System.String)": "JsonApiDotNetCore.Internal.JsonApiException.yml", + "JsonApiDotNetCore.Internal.JsonApiException.GetError": "JsonApiDotNetCore.Internal.JsonApiException.yml", + "JsonApiDotNetCore.Internal.JsonApiException.GetStatusCode": "JsonApiDotNetCore.Internal.JsonApiException.yml", + "JsonApiDotNetCore.Internal.JsonApiExceptionFactory": "JsonApiDotNetCore.Internal.JsonApiExceptionFactory.yml", + "JsonApiDotNetCore.Internal.JsonApiExceptionFactory.GetException(System.Exception)": "JsonApiDotNetCore.Internal.JsonApiExceptionFactory.yml", + "JsonApiDotNetCore.Internal.JsonApiRouteHandler": "JsonApiDotNetCore.Internal.JsonApiRouteHandler.yml", + "JsonApiDotNetCore.Internal.JsonApiRouteHandler.#ctor(Microsoft.AspNetCore.Mvc.Infrastructure.IActionInvokerFactory,Microsoft.AspNetCore.Mvc.Infrastructure.IActionSelector)": "JsonApiDotNetCore.Internal.JsonApiRouteHandler.yml", + "JsonApiDotNetCore.Internal.JsonApiRouteHandler.#ctor(Microsoft.AspNetCore.Mvc.Infrastructure.IActionInvokerFactory,Microsoft.AspNetCore.Mvc.Infrastructure.IActionSelector,Microsoft.AspNetCore.Mvc.Infrastructure.IActionContextAccessor)": "JsonApiDotNetCore.Internal.JsonApiRouteHandler.yml", + "JsonApiDotNetCore.Internal.JsonApiRouteHandler.GetVirtualPath(Microsoft.AspNetCore.Routing.VirtualPathContext)": "JsonApiDotNetCore.Internal.JsonApiRouteHandler.yml", + "JsonApiDotNetCore.Internal.JsonApiRouteHandler.RouteAsync(Microsoft.AspNetCore.Routing.RouteContext)": "JsonApiDotNetCore.Internal.JsonApiRouteHandler.yml", + "JsonApiDotNetCore.Internal.PageManager": "JsonApiDotNetCore.Internal.PageManager.yml", + "JsonApiDotNetCore.Internal.PageManager.CurrentPage": "JsonApiDotNetCore.Internal.PageManager.yml", + "JsonApiDotNetCore.Internal.PageManager.DefaultPageSize": "JsonApiDotNetCore.Internal.PageManager.yml", + "JsonApiDotNetCore.Internal.PageManager.GetPageLinks(JsonApiDotNetCore.Builders.LinkBuilder)": "JsonApiDotNetCore.Internal.PageManager.yml", + "JsonApiDotNetCore.Internal.PageManager.IsPaginated": "JsonApiDotNetCore.Internal.PageManager.yml", + "JsonApiDotNetCore.Internal.PageManager.PageSize": "JsonApiDotNetCore.Internal.PageManager.yml", + "JsonApiDotNetCore.Internal.PageManager.TotalPages": "JsonApiDotNetCore.Internal.PageManager.yml", + "JsonApiDotNetCore.Internal.PageManager.TotalRecords": "JsonApiDotNetCore.Internal.PageManager.yml", + "JsonApiDotNetCore.Internal.Query": "JsonApiDotNetCore.Internal.Query.yml", + "JsonApiDotNetCore.Internal.Query.AttrFilterQuery": "JsonApiDotNetCore.Internal.Query.AttrFilterQuery.yml", + "JsonApiDotNetCore.Internal.Query.AttrFilterQuery.#ctor(JsonApiDotNetCore.Services.IJsonApiContext,JsonApiDotNetCore.Internal.Query.FilterQuery)": "JsonApiDotNetCore.Internal.Query.AttrFilterQuery.yml", + "JsonApiDotNetCore.Internal.Query.AttrFilterQuery.FilteredAttribute": "JsonApiDotNetCore.Internal.Query.AttrFilterQuery.yml", + "JsonApiDotNetCore.Internal.Query.AttrFilterQuery.FilterOperation": "JsonApiDotNetCore.Internal.Query.AttrFilterQuery.yml", + "JsonApiDotNetCore.Internal.Query.AttrFilterQuery.PropertyValue": "JsonApiDotNetCore.Internal.Query.AttrFilterQuery.yml", + "JsonApiDotNetCore.Internal.Query.BaseFilterQuery": "JsonApiDotNetCore.Internal.Query.BaseFilterQuery.yml", + "JsonApiDotNetCore.Internal.Query.BaseFilterQuery.GetFilterOperation(System.String)": "JsonApiDotNetCore.Internal.Query.BaseFilterQuery.yml", + "JsonApiDotNetCore.Internal.Query.FilterOperations": "JsonApiDotNetCore.Internal.Query.FilterOperations.yml", + "JsonApiDotNetCore.Internal.Query.FilterOperations.eq": "JsonApiDotNetCore.Internal.Query.FilterOperations.yml", + "JsonApiDotNetCore.Internal.Query.FilterOperations.ge": "JsonApiDotNetCore.Internal.Query.FilterOperations.yml", + "JsonApiDotNetCore.Internal.Query.FilterOperations.gt": "JsonApiDotNetCore.Internal.Query.FilterOperations.yml", + "JsonApiDotNetCore.Internal.Query.FilterOperations.le": "JsonApiDotNetCore.Internal.Query.FilterOperations.yml", + "JsonApiDotNetCore.Internal.Query.FilterOperations.like": "JsonApiDotNetCore.Internal.Query.FilterOperations.yml", + "JsonApiDotNetCore.Internal.Query.FilterOperations.lt": "JsonApiDotNetCore.Internal.Query.FilterOperations.yml", + "JsonApiDotNetCore.Internal.Query.FilterQuery": "JsonApiDotNetCore.Internal.Query.FilterQuery.yml", + "JsonApiDotNetCore.Internal.Query.FilterQuery.#ctor(System.String,System.String,System.String)": "JsonApiDotNetCore.Internal.Query.FilterQuery.yml", + "JsonApiDotNetCore.Internal.Query.FilterQuery.Attribute": "JsonApiDotNetCore.Internal.Query.FilterQuery.yml", + "JsonApiDotNetCore.Internal.Query.FilterQuery.IsAttributeOfRelationship": "JsonApiDotNetCore.Internal.Query.FilterQuery.yml", + "JsonApiDotNetCore.Internal.Query.FilterQuery.Key": "JsonApiDotNetCore.Internal.Query.FilterQuery.yml", + "JsonApiDotNetCore.Internal.Query.FilterQuery.Operation": "JsonApiDotNetCore.Internal.Query.FilterQuery.yml", + "JsonApiDotNetCore.Internal.Query.FilterQuery.Value": "JsonApiDotNetCore.Internal.Query.FilterQuery.yml", + "JsonApiDotNetCore.Internal.Query.PageQuery": "JsonApiDotNetCore.Internal.Query.PageQuery.yml", + "JsonApiDotNetCore.Internal.Query.PageQuery.PageOffset": "JsonApiDotNetCore.Internal.Query.PageQuery.yml", + "JsonApiDotNetCore.Internal.Query.PageQuery.PageSize": "JsonApiDotNetCore.Internal.Query.PageQuery.yml", + "JsonApiDotNetCore.Internal.Query.QuerySet": "JsonApiDotNetCore.Internal.Query.QuerySet.yml", + "JsonApiDotNetCore.Internal.Query.QuerySet.Fields": "JsonApiDotNetCore.Internal.Query.QuerySet.yml", + "JsonApiDotNetCore.Internal.Query.QuerySet.Filters": "JsonApiDotNetCore.Internal.Query.QuerySet.yml", + "JsonApiDotNetCore.Internal.Query.QuerySet.IncludedRelationships": "JsonApiDotNetCore.Internal.Query.QuerySet.yml", + "JsonApiDotNetCore.Internal.Query.QuerySet.PageQuery": "JsonApiDotNetCore.Internal.Query.QuerySet.yml", + "JsonApiDotNetCore.Internal.Query.QuerySet.SortParameters": "JsonApiDotNetCore.Internal.Query.QuerySet.yml", + "JsonApiDotNetCore.Internal.Query.RelatedAttrFilterQuery": "JsonApiDotNetCore.Internal.Query.RelatedAttrFilterQuery.yml", + "JsonApiDotNetCore.Internal.Query.RelatedAttrFilterQuery.#ctor(JsonApiDotNetCore.Services.IJsonApiContext,JsonApiDotNetCore.Internal.Query.FilterQuery)": "JsonApiDotNetCore.Internal.Query.RelatedAttrFilterQuery.yml", + "JsonApiDotNetCore.Internal.Query.RelatedAttrFilterQuery.FilteredAttribute": "JsonApiDotNetCore.Internal.Query.RelatedAttrFilterQuery.yml", + "JsonApiDotNetCore.Internal.Query.RelatedAttrFilterQuery.FilteredRelationship": "JsonApiDotNetCore.Internal.Query.RelatedAttrFilterQuery.yml", + "JsonApiDotNetCore.Internal.Query.RelatedAttrFilterQuery.FilterOperation": "JsonApiDotNetCore.Internal.Query.RelatedAttrFilterQuery.yml", + "JsonApiDotNetCore.Internal.Query.RelatedAttrFilterQuery.PropertyValue": "JsonApiDotNetCore.Internal.Query.RelatedAttrFilterQuery.yml", + "JsonApiDotNetCore.Internal.Query.SortDirection": "JsonApiDotNetCore.Internal.Query.SortDirection.yml", + "JsonApiDotNetCore.Internal.Query.SortDirection.Ascending": "JsonApiDotNetCore.Internal.Query.SortDirection.yml", + "JsonApiDotNetCore.Internal.Query.SortDirection.Descending": "JsonApiDotNetCore.Internal.Query.SortDirection.yml", + "JsonApiDotNetCore.Internal.Query.SortQuery": "JsonApiDotNetCore.Internal.Query.SortQuery.yml", + "JsonApiDotNetCore.Internal.Query.SortQuery.#ctor(JsonApiDotNetCore.Internal.Query.SortDirection,JsonApiDotNetCore.Models.AttrAttribute)": "JsonApiDotNetCore.Internal.Query.SortQuery.yml", + "JsonApiDotNetCore.Internal.Query.SortQuery.Direction": "JsonApiDotNetCore.Internal.Query.SortQuery.yml", + "JsonApiDotNetCore.Internal.Query.SortQuery.SortedAttribute": "JsonApiDotNetCore.Internal.Query.SortQuery.yml", + "JsonApiDotNetCore.Internal.TypeHelper": "JsonApiDotNetCore.Internal.TypeHelper.yml", + "JsonApiDotNetCore.Internal.TypeHelper.ConvertType(System.Object,System.Type)": "JsonApiDotNetCore.Internal.TypeHelper.yml", + "JsonApiDotNetCore.Internal.TypeHelper.ConvertType``1(System.Object)": "JsonApiDotNetCore.Internal.TypeHelper.yml", + "JsonApiDotNetCore.Middleware": "JsonApiDotNetCore.Middleware.yml", + "JsonApiDotNetCore.Middleware.JsonApiExceptionFilter": "JsonApiDotNetCore.Middleware.JsonApiExceptionFilter.yml", + "JsonApiDotNetCore.Middleware.JsonApiExceptionFilter.#ctor(Microsoft.Extensions.Logging.ILoggerFactory)": "JsonApiDotNetCore.Middleware.JsonApiExceptionFilter.yml", + "JsonApiDotNetCore.Middleware.JsonApiExceptionFilter.OnException(Microsoft.AspNetCore.Mvc.Filters.ExceptionContext)": "JsonApiDotNetCore.Middleware.JsonApiExceptionFilter.yml", + "JsonApiDotNetCore.Middleware.RequestMiddleware": "JsonApiDotNetCore.Middleware.RequestMiddleware.yml", + "JsonApiDotNetCore.Middleware.RequestMiddleware.#ctor(Microsoft.AspNetCore.Http.RequestDelegate)": "JsonApiDotNetCore.Middleware.RequestMiddleware.yml", + "JsonApiDotNetCore.Middleware.RequestMiddleware.Invoke(Microsoft.AspNetCore.Http.HttpContext)": "JsonApiDotNetCore.Middleware.RequestMiddleware.yml", + "JsonApiDotNetCore.Models": "JsonApiDotNetCore.Models.yml", + "JsonApiDotNetCore.Models.AttrAttribute": "JsonApiDotNetCore.Models.AttrAttribute.yml", + "JsonApiDotNetCore.Models.AttrAttribute.#ctor(System.String,System.Boolean,System.Boolean,System.Boolean)": "JsonApiDotNetCore.Models.AttrAttribute.yml", + "JsonApiDotNetCore.Models.AttrAttribute.GetValue(System.Object)": "JsonApiDotNetCore.Models.AttrAttribute.yml", + "JsonApiDotNetCore.Models.AttrAttribute.InternalAttributeName": "JsonApiDotNetCore.Models.AttrAttribute.yml", + "JsonApiDotNetCore.Models.AttrAttribute.Is(System.String)": "JsonApiDotNetCore.Models.AttrAttribute.yml", + "JsonApiDotNetCore.Models.AttrAttribute.IsFilterable": "JsonApiDotNetCore.Models.AttrAttribute.yml", + "JsonApiDotNetCore.Models.AttrAttribute.IsImmutable": "JsonApiDotNetCore.Models.AttrAttribute.yml", + "JsonApiDotNetCore.Models.AttrAttribute.IsSortable": "JsonApiDotNetCore.Models.AttrAttribute.yml", + "JsonApiDotNetCore.Models.AttrAttribute.PublicAttributeName": "JsonApiDotNetCore.Models.AttrAttribute.yml", + "JsonApiDotNetCore.Models.AttrAttribute.SetValue(System.Object,System.Object)": "JsonApiDotNetCore.Models.AttrAttribute.yml", + "JsonApiDotNetCore.Models.Document": "JsonApiDotNetCore.Models.Document.yml", + "JsonApiDotNetCore.Models.Document.Data": "JsonApiDotNetCore.Models.Document.yml", + "JsonApiDotNetCore.Models.DocumentBase": "JsonApiDotNetCore.Models.DocumentBase.yml", + "JsonApiDotNetCore.Models.DocumentBase.Included": "JsonApiDotNetCore.Models.DocumentBase.yml", + "JsonApiDotNetCore.Models.DocumentBase.Links": "JsonApiDotNetCore.Models.DocumentBase.yml", + "JsonApiDotNetCore.Models.DocumentBase.Meta": "JsonApiDotNetCore.Models.DocumentBase.yml", + "JsonApiDotNetCore.Models.DocumentData": "JsonApiDotNetCore.Models.DocumentData.yml", + "JsonApiDotNetCore.Models.Documents": "JsonApiDotNetCore.Models.Documents.yml", + "JsonApiDotNetCore.Models.Documents.Data": "JsonApiDotNetCore.Models.Documents.yml", + "JsonApiDotNetCore.Models.HasManyAttribute": "JsonApiDotNetCore.Models.HasManyAttribute.yml", + "JsonApiDotNetCore.Models.HasManyAttribute.#ctor(System.String,JsonApiDotNetCore.Models.Link)": "JsonApiDotNetCore.Models.HasManyAttribute.yml", + "JsonApiDotNetCore.Models.HasManyAttribute.SetValue(System.Object,System.Object)": "JsonApiDotNetCore.Models.HasManyAttribute.yml", + "JsonApiDotNetCore.Models.HasOneAttribute": "JsonApiDotNetCore.Models.HasOneAttribute.yml", + "JsonApiDotNetCore.Models.HasOneAttribute.#ctor(System.String,JsonApiDotNetCore.Models.Link)": "JsonApiDotNetCore.Models.HasOneAttribute.yml", + "JsonApiDotNetCore.Models.HasOneAttribute.SetValue(System.Object,System.Object)": "JsonApiDotNetCore.Models.HasOneAttribute.yml", + "JsonApiDotNetCore.Models.Identifiable": "JsonApiDotNetCore.Models.Identifiable.yml", + "JsonApiDotNetCore.Models.Identifiable`1": "JsonApiDotNetCore.Models.Identifiable-1.yml", + "JsonApiDotNetCore.Models.Identifiable`1.GetConcreteId(System.String)": "JsonApiDotNetCore.Models.Identifiable-1.yml", + "JsonApiDotNetCore.Models.Identifiable`1.GetStringId(System.Object)": "JsonApiDotNetCore.Models.Identifiable-1.yml", + "JsonApiDotNetCore.Models.Identifiable`1.Id": "JsonApiDotNetCore.Models.Identifiable-1.yml", + "JsonApiDotNetCore.Models.Identifiable`1.StringId": "JsonApiDotNetCore.Models.Identifiable-1.yml", + "JsonApiDotNetCore.Models.IHasMeta": "JsonApiDotNetCore.Models.IHasMeta.yml", + "JsonApiDotNetCore.Models.IHasMeta.GetMeta(JsonApiDotNetCore.Services.IJsonApiContext)": "JsonApiDotNetCore.Models.IHasMeta.yml", + "JsonApiDotNetCore.Models.IIdentifiable": "JsonApiDotNetCore.Models.IIdentifiable.yml", + "JsonApiDotNetCore.Models.IIdentifiable.StringId": "JsonApiDotNetCore.Models.IIdentifiable.yml", + "JsonApiDotNetCore.Models.IIdentifiable`1": "JsonApiDotNetCore.Models.IIdentifiable-1.yml", + "JsonApiDotNetCore.Models.IIdentifiable`1.Id": "JsonApiDotNetCore.Models.IIdentifiable-1.yml", + "JsonApiDotNetCore.Models.JsonApiExtension": "JsonApiDotNetCore.Models.JsonApiExtension.yml", + "JsonApiDotNetCore.Models.JsonApiExtension.Operations": "JsonApiDotNetCore.Models.JsonApiExtension.yml", + "JsonApiDotNetCore.Models.Link": "JsonApiDotNetCore.Models.Link.yml", + "JsonApiDotNetCore.Models.Link.All": "JsonApiDotNetCore.Models.Link.yml", + "JsonApiDotNetCore.Models.Link.None": "JsonApiDotNetCore.Models.Link.yml", + "JsonApiDotNetCore.Models.Link.Paging": "JsonApiDotNetCore.Models.Link.yml", + "JsonApiDotNetCore.Models.Link.Related": "JsonApiDotNetCore.Models.Link.yml", + "JsonApiDotNetCore.Models.Link.Self": "JsonApiDotNetCore.Models.Link.yml", + "JsonApiDotNetCore.Models.Links": "JsonApiDotNetCore.Models.Links.yml", + "JsonApiDotNetCore.Models.Links.Related": "JsonApiDotNetCore.Models.Links.yml", + "JsonApiDotNetCore.Models.Links.Self": "JsonApiDotNetCore.Models.Links.yml", + "JsonApiDotNetCore.Models.LinksAttribute": "JsonApiDotNetCore.Models.LinksAttribute.yml", + "JsonApiDotNetCore.Models.LinksAttribute.#ctor(JsonApiDotNetCore.Models.Link)": "JsonApiDotNetCore.Models.LinksAttribute.yml", + "JsonApiDotNetCore.Models.LinksAttribute.Links": "JsonApiDotNetCore.Models.LinksAttribute.yml", + "JsonApiDotNetCore.Models.Operations": "JsonApiDotNetCore.Models.Operations.yml", + "JsonApiDotNetCore.Models.Operations.Operation": "JsonApiDotNetCore.Models.Operations.Operation.yml", + "JsonApiDotNetCore.Models.Operations.Operation.Data": "JsonApiDotNetCore.Models.Operations.Operation.yml", + "JsonApiDotNetCore.Models.Operations.Operation.DataIsList": "JsonApiDotNetCore.Models.Operations.Operation.yml", + "JsonApiDotNetCore.Models.Operations.Operation.DataList": "JsonApiDotNetCore.Models.Operations.Operation.yml", + "JsonApiDotNetCore.Models.Operations.Operation.DataObject": "JsonApiDotNetCore.Models.Operations.Operation.yml", + "JsonApiDotNetCore.Models.Operations.Operation.GetResourceTypeName": "JsonApiDotNetCore.Models.Operations.Operation.yml", + "JsonApiDotNetCore.Models.Operations.Operation.Op": "JsonApiDotNetCore.Models.Operations.Operation.yml", + "JsonApiDotNetCore.Models.Operations.Operation.Params": "JsonApiDotNetCore.Models.Operations.Operation.yml", + "JsonApiDotNetCore.Models.Operations.Operation.Ref": "JsonApiDotNetCore.Models.Operations.Operation.yml", + "JsonApiDotNetCore.Models.Operations.OperationCode": "JsonApiDotNetCore.Models.Operations.OperationCode.yml", + "JsonApiDotNetCore.Models.Operations.OperationCode.add": "JsonApiDotNetCore.Models.Operations.OperationCode.yml", + "JsonApiDotNetCore.Models.Operations.OperationCode.get": "JsonApiDotNetCore.Models.Operations.OperationCode.yml", + "JsonApiDotNetCore.Models.Operations.OperationCode.remove": "JsonApiDotNetCore.Models.Operations.OperationCode.yml", + "JsonApiDotNetCore.Models.Operations.OperationCode.update": "JsonApiDotNetCore.Models.Operations.OperationCode.yml", + "JsonApiDotNetCore.Models.Operations.OperationsDocument": "JsonApiDotNetCore.Models.Operations.OperationsDocument.yml", + "JsonApiDotNetCore.Models.Operations.OperationsDocument.#ctor": "JsonApiDotNetCore.Models.Operations.OperationsDocument.yml", + "JsonApiDotNetCore.Models.Operations.OperationsDocument.#ctor(System.Collections.Generic.List{JsonApiDotNetCore.Models.Operations.Operation})": "JsonApiDotNetCore.Models.Operations.OperationsDocument.yml", + "JsonApiDotNetCore.Models.Operations.OperationsDocument.Operations": "JsonApiDotNetCore.Models.Operations.OperationsDocument.yml", + "JsonApiDotNetCore.Models.Operations.Params": "JsonApiDotNetCore.Models.Operations.Params.yml", + "JsonApiDotNetCore.Models.Operations.Params.Fields": "JsonApiDotNetCore.Models.Operations.Params.yml", + "JsonApiDotNetCore.Models.Operations.Params.Filter": "JsonApiDotNetCore.Models.Operations.Params.yml", + "JsonApiDotNetCore.Models.Operations.Params.Include": "JsonApiDotNetCore.Models.Operations.Params.yml", + "JsonApiDotNetCore.Models.Operations.Params.Page": "JsonApiDotNetCore.Models.Operations.Params.yml", + "JsonApiDotNetCore.Models.Operations.Params.Sort": "JsonApiDotNetCore.Models.Operations.Params.yml", + "JsonApiDotNetCore.Models.Operations.ResourceReference": "JsonApiDotNetCore.Models.Operations.ResourceReference.yml", + "JsonApiDotNetCore.Models.Operations.ResourceReference.Relationship": "JsonApiDotNetCore.Models.Operations.ResourceReference.yml", + "JsonApiDotNetCore.Models.RelationshipAttribute": "JsonApiDotNetCore.Models.RelationshipAttribute.yml", + "JsonApiDotNetCore.Models.RelationshipAttribute.#ctor(System.String,JsonApiDotNetCore.Models.Link)": "JsonApiDotNetCore.Models.RelationshipAttribute.yml", + "JsonApiDotNetCore.Models.RelationshipAttribute.DocumentLinks": "JsonApiDotNetCore.Models.RelationshipAttribute.yml", + "JsonApiDotNetCore.Models.RelationshipAttribute.Equals(System.Object)": "JsonApiDotNetCore.Models.RelationshipAttribute.yml", + "JsonApiDotNetCore.Models.RelationshipAttribute.InternalRelationshipName": "JsonApiDotNetCore.Models.RelationshipAttribute.yml", + "JsonApiDotNetCore.Models.RelationshipAttribute.Is(System.String)": "JsonApiDotNetCore.Models.RelationshipAttribute.yml", + "JsonApiDotNetCore.Models.RelationshipAttribute.IsHasMany": "JsonApiDotNetCore.Models.RelationshipAttribute.yml", + "JsonApiDotNetCore.Models.RelationshipAttribute.IsHasOne": "JsonApiDotNetCore.Models.RelationshipAttribute.yml", + "JsonApiDotNetCore.Models.RelationshipAttribute.PublicRelationshipName": "JsonApiDotNetCore.Models.RelationshipAttribute.yml", + "JsonApiDotNetCore.Models.RelationshipAttribute.SetValue(System.Object,System.Object)": "JsonApiDotNetCore.Models.RelationshipAttribute.yml", + "JsonApiDotNetCore.Models.RelationshipAttribute.ToString": "JsonApiDotNetCore.Models.RelationshipAttribute.yml", + "JsonApiDotNetCore.Models.RelationshipAttribute.Type": "JsonApiDotNetCore.Models.RelationshipAttribute.yml", + "JsonApiDotNetCore.Models.RelationshipData": "JsonApiDotNetCore.Models.RelationshipData.yml", + "JsonApiDotNetCore.Models.RelationshipData.ExposedData": "JsonApiDotNetCore.Models.RelationshipData.yml", + "JsonApiDotNetCore.Models.RelationshipData.IsHasMany": "JsonApiDotNetCore.Models.RelationshipData.yml", + "JsonApiDotNetCore.Models.RelationshipData.Links": "JsonApiDotNetCore.Models.RelationshipData.yml", + "JsonApiDotNetCore.Models.RelationshipData.ManyData": "JsonApiDotNetCore.Models.RelationshipData.yml", + "JsonApiDotNetCore.Models.RelationshipData.SingleData": "JsonApiDotNetCore.Models.RelationshipData.yml", + "JsonApiDotNetCore.Models.ResourceAttribute": "JsonApiDotNetCore.Models.ResourceAttribute.yml", + "JsonApiDotNetCore.Models.ResourceAttribute.#ctor(System.String)": "JsonApiDotNetCore.Models.ResourceAttribute.yml", + "JsonApiDotNetCore.Models.ResourceAttribute.ResourceName": "JsonApiDotNetCore.Models.ResourceAttribute.yml", + "JsonApiDotNetCore.Models.ResourceIdentifierObject": "JsonApiDotNetCore.Models.ResourceIdentifierObject.yml", + "JsonApiDotNetCore.Models.ResourceIdentifierObject.Id": "JsonApiDotNetCore.Models.ResourceIdentifierObject.yml", + "JsonApiDotNetCore.Models.ResourceIdentifierObject.LocalId": "JsonApiDotNetCore.Models.ResourceIdentifierObject.yml", + "JsonApiDotNetCore.Models.ResourceIdentifierObject.Type": "JsonApiDotNetCore.Models.ResourceIdentifierObject.yml", + "JsonApiDotNetCore.Models.ResourceObject": "JsonApiDotNetCore.Models.ResourceObject.yml", + "JsonApiDotNetCore.Models.ResourceObject.Attributes": "JsonApiDotNetCore.Models.ResourceObject.yml", + "JsonApiDotNetCore.Models.ResourceObject.Relationships": "JsonApiDotNetCore.Models.ResourceObject.yml", + "JsonApiDotNetCore.Models.RootLinks": "JsonApiDotNetCore.Models.RootLinks.yml", + "JsonApiDotNetCore.Models.RootLinks.First": "JsonApiDotNetCore.Models.RootLinks.yml", + "JsonApiDotNetCore.Models.RootLinks.Last": "JsonApiDotNetCore.Models.RootLinks.yml", + "JsonApiDotNetCore.Models.RootLinks.Next": "JsonApiDotNetCore.Models.RootLinks.yml", + "JsonApiDotNetCore.Models.RootLinks.Prev": "JsonApiDotNetCore.Models.RootLinks.yml", + "JsonApiDotNetCore.Models.RootLinks.Self": "JsonApiDotNetCore.Models.RootLinks.yml", + "JsonApiDotNetCore.Models.RootLinks.ShouldSerializeFirst": "JsonApiDotNetCore.Models.RootLinks.yml", + "JsonApiDotNetCore.Models.RootLinks.ShouldSerializeLast": "JsonApiDotNetCore.Models.RootLinks.yml", + "JsonApiDotNetCore.Models.RootLinks.ShouldSerializeNext": "JsonApiDotNetCore.Models.RootLinks.yml", + "JsonApiDotNetCore.Models.RootLinks.ShouldSerializePrev": "JsonApiDotNetCore.Models.RootLinks.yml", + "JsonApiDotNetCore.Models.RootLinks.ShouldSerializeSelf": "JsonApiDotNetCore.Models.RootLinks.yml", + "JsonApiDotNetCore.Serialization": "JsonApiDotNetCore.Serialization.yml", + "JsonApiDotNetCore.Serialization.DasherizedResolver": "JsonApiDotNetCore.Serialization.DasherizedResolver.yml", + "JsonApiDotNetCore.Serialization.DasherizedResolver.CreateProperty(System.Reflection.MemberInfo,Newtonsoft.Json.MemberSerialization)": "JsonApiDotNetCore.Serialization.DasherizedResolver.yml", + "JsonApiDotNetCore.Serialization.IJsonApiDeSerializer": "JsonApiDotNetCore.Serialization.IJsonApiDeSerializer.yml", + "JsonApiDotNetCore.Serialization.IJsonApiDeSerializer.Deserialize(System.String)": "JsonApiDotNetCore.Serialization.IJsonApiDeSerializer.yml", + "JsonApiDotNetCore.Serialization.IJsonApiDeSerializer.Deserialize``1(System.String)": "JsonApiDotNetCore.Serialization.IJsonApiDeSerializer.yml", + "JsonApiDotNetCore.Serialization.IJsonApiDeSerializer.DeserializeList``1(System.String)": "JsonApiDotNetCore.Serialization.IJsonApiDeSerializer.yml", + "JsonApiDotNetCore.Serialization.IJsonApiDeSerializer.DeserializeRelationship(System.String)": "JsonApiDotNetCore.Serialization.IJsonApiDeSerializer.yml", + "JsonApiDotNetCore.Serialization.IJsonApiDeSerializer.DocumentToObject(JsonApiDotNetCore.Models.DocumentData)": "JsonApiDotNetCore.Serialization.IJsonApiDeSerializer.yml", + "JsonApiDotNetCore.Serialization.IJsonApiSerializer": "JsonApiDotNetCore.Serialization.IJsonApiSerializer.yml", + "JsonApiDotNetCore.Serialization.IJsonApiSerializer.Serialize(System.Object)": "JsonApiDotNetCore.Serialization.IJsonApiSerializer.yml", + "JsonApiDotNetCore.Serialization.JsonApiDeSerializer": "JsonApiDotNetCore.Serialization.JsonApiDeSerializer.yml", + "JsonApiDotNetCore.Serialization.JsonApiDeSerializer.#ctor(JsonApiDotNetCore.Services.IJsonApiContext,JsonApiDotNetCore.Internal.Generics.IGenericProcessorFactory)": "JsonApiDotNetCore.Serialization.JsonApiDeSerializer.yml", + "JsonApiDotNetCore.Serialization.JsonApiDeSerializer.Deserialize(System.String)": "JsonApiDotNetCore.Serialization.JsonApiDeSerializer.yml", + "JsonApiDotNetCore.Serialization.JsonApiDeSerializer.Deserialize``1(System.String)": "JsonApiDotNetCore.Serialization.JsonApiDeSerializer.yml", + "JsonApiDotNetCore.Serialization.JsonApiDeSerializer.DeserializeList``1(System.String)": "JsonApiDotNetCore.Serialization.JsonApiDeSerializer.yml", + "JsonApiDotNetCore.Serialization.JsonApiDeSerializer.DeserializeRelationship(System.String)": "JsonApiDotNetCore.Serialization.JsonApiDeSerializer.yml", + "JsonApiDotNetCore.Serialization.JsonApiDeSerializer.DocumentToObject(JsonApiDotNetCore.Models.DocumentData)": "JsonApiDotNetCore.Serialization.JsonApiDeSerializer.yml", + "JsonApiDotNetCore.Serialization.JsonApiSerializer": "JsonApiDotNetCore.Serialization.JsonApiSerializer.yml", + "JsonApiDotNetCore.Serialization.JsonApiSerializer.#ctor(JsonApiDotNetCore.Services.IJsonApiContext,JsonApiDotNetCore.Builders.IDocumentBuilder)": "JsonApiDotNetCore.Serialization.JsonApiSerializer.yml", + "JsonApiDotNetCore.Serialization.JsonApiSerializer.#ctor(JsonApiDotNetCore.Services.IJsonApiContext,JsonApiDotNetCore.Builders.IDocumentBuilder,Microsoft.Extensions.Logging.ILoggerFactory)": "JsonApiDotNetCore.Serialization.JsonApiSerializer.yml", + "JsonApiDotNetCore.Serialization.JsonApiSerializer.Serialize(System.Object)": "JsonApiDotNetCore.Serialization.JsonApiSerializer.yml", + "JsonApiDotNetCore.Services": "JsonApiDotNetCore.Services.yml", + "JsonApiDotNetCore.Services.ControllerContext": "JsonApiDotNetCore.Services.ControllerContext.yml", + "JsonApiDotNetCore.Services.ControllerContext.ControllerType": "JsonApiDotNetCore.Services.ControllerContext.yml", + "JsonApiDotNetCore.Services.ControllerContext.GetControllerAttribute``1": "JsonApiDotNetCore.Services.ControllerContext.yml", + "JsonApiDotNetCore.Services.ControllerContext.RequestEntity": "JsonApiDotNetCore.Services.ControllerContext.yml", + "JsonApiDotNetCore.Services.EntityResourceService`1": "JsonApiDotNetCore.Services.EntityResourceService-1.yml", + "JsonApiDotNetCore.Services.EntityResourceService`1.#ctor(JsonApiDotNetCore.Services.IJsonApiContext,JsonApiDotNetCore.Data.IEntityRepository{`0},Microsoft.Extensions.Logging.ILoggerFactory)": "JsonApiDotNetCore.Services.EntityResourceService-1.yml", + "JsonApiDotNetCore.Services.EntityResourceService`2": "JsonApiDotNetCore.Services.EntityResourceService-2.yml", + "JsonApiDotNetCore.Services.EntityResourceService`2.#ctor(JsonApiDotNetCore.Services.IJsonApiContext,JsonApiDotNetCore.Data.IEntityRepository{`0,`1},Microsoft.Extensions.Logging.ILoggerFactory)": "JsonApiDotNetCore.Services.EntityResourceService-2.yml", + "JsonApiDotNetCore.Services.EntityResourceService`2.CreateAsync(`0)": "JsonApiDotNetCore.Services.EntityResourceService-2.yml", + "JsonApiDotNetCore.Services.EntityResourceService`2.DeleteAsync(`1)": "JsonApiDotNetCore.Services.EntityResourceService-2.yml", + "JsonApiDotNetCore.Services.EntityResourceService`2.GetAsync": "JsonApiDotNetCore.Services.EntityResourceService-2.yml", + "JsonApiDotNetCore.Services.EntityResourceService`2.GetAsync(`1)": "JsonApiDotNetCore.Services.EntityResourceService-2.yml", + "JsonApiDotNetCore.Services.EntityResourceService`2.GetRelationshipAsync(`1,System.String)": "JsonApiDotNetCore.Services.EntityResourceService-2.yml", + "JsonApiDotNetCore.Services.EntityResourceService`2.GetRelationshipsAsync(`1,System.String)": "JsonApiDotNetCore.Services.EntityResourceService-2.yml", + "JsonApiDotNetCore.Services.EntityResourceService`2.UpdateAsync(`1,`0)": "JsonApiDotNetCore.Services.EntityResourceService-2.yml", + "JsonApiDotNetCore.Services.EntityResourceService`2.UpdateRelationshipsAsync(`1,System.String,System.Collections.Generic.List{JsonApiDotNetCore.Models.DocumentData})": "JsonApiDotNetCore.Services.EntityResourceService-2.yml", + "JsonApiDotNetCore.Services.IControllerContext": "JsonApiDotNetCore.Services.IControllerContext.yml", + "JsonApiDotNetCore.Services.IControllerContext.ControllerType": "JsonApiDotNetCore.Services.IControllerContext.yml", + "JsonApiDotNetCore.Services.IControllerContext.GetControllerAttribute``1": "JsonApiDotNetCore.Services.IControllerContext.yml", + "JsonApiDotNetCore.Services.IControllerContext.RequestEntity": "JsonApiDotNetCore.Services.IControllerContext.yml", + "JsonApiDotNetCore.Services.ICreateService`1": "JsonApiDotNetCore.Services.ICreateService-1.yml", + "JsonApiDotNetCore.Services.ICreateService`2": "JsonApiDotNetCore.Services.ICreateService-2.yml", + "JsonApiDotNetCore.Services.ICreateService`2.CreateAsync(`0)": "JsonApiDotNetCore.Services.ICreateService-2.yml", + "JsonApiDotNetCore.Services.IDeleteService`1": "JsonApiDotNetCore.Services.IDeleteService-1.yml", + "JsonApiDotNetCore.Services.IDeleteService`2": "JsonApiDotNetCore.Services.IDeleteService-2.yml", + "JsonApiDotNetCore.Services.IDeleteService`2.DeleteAsync(`1)": "JsonApiDotNetCore.Services.IDeleteService-2.yml", + "JsonApiDotNetCore.Services.IGetAllService`1": "JsonApiDotNetCore.Services.IGetAllService-1.yml", + "JsonApiDotNetCore.Services.IGetAllService`2": "JsonApiDotNetCore.Services.IGetAllService-2.yml", + "JsonApiDotNetCore.Services.IGetAllService`2.GetAsync": "JsonApiDotNetCore.Services.IGetAllService-2.yml", + "JsonApiDotNetCore.Services.IGetByIdService`1": "JsonApiDotNetCore.Services.IGetByIdService-1.yml", + "JsonApiDotNetCore.Services.IGetByIdService`2": "JsonApiDotNetCore.Services.IGetByIdService-2.yml", + "JsonApiDotNetCore.Services.IGetByIdService`2.GetAsync(`1)": "JsonApiDotNetCore.Services.IGetByIdService-2.yml", + "JsonApiDotNetCore.Services.IGetRelationshipService`1": "JsonApiDotNetCore.Services.IGetRelationshipService-1.yml", + "JsonApiDotNetCore.Services.IGetRelationshipService`2": "JsonApiDotNetCore.Services.IGetRelationshipService-2.yml", + "JsonApiDotNetCore.Services.IGetRelationshipService`2.GetRelationshipAsync(`1,System.String)": "JsonApiDotNetCore.Services.IGetRelationshipService-2.yml", + "JsonApiDotNetCore.Services.IGetRelationshipsService`1": "JsonApiDotNetCore.Services.IGetRelationshipsService-1.yml", + "JsonApiDotNetCore.Services.IGetRelationshipsService`2": "JsonApiDotNetCore.Services.IGetRelationshipsService-2.yml", + "JsonApiDotNetCore.Services.IGetRelationshipsService`2.GetRelationshipsAsync(`1,System.String)": "JsonApiDotNetCore.Services.IGetRelationshipsService-2.yml", + "JsonApiDotNetCore.Services.IJsonApiContext": "JsonApiDotNetCore.Services.IJsonApiContext.yml", + "JsonApiDotNetCore.Services.IJsonApiContext.ApplyContext``1(System.Object)": "JsonApiDotNetCore.Services.IJsonApiContext.yml", + "JsonApiDotNetCore.Services.IJsonApiContext.AttributesToUpdate": "JsonApiDotNetCore.Services.IJsonApiContext.yml", + "JsonApiDotNetCore.Services.IJsonApiContext.BasePath": "JsonApiDotNetCore.Services.IJsonApiContext.yml", + "JsonApiDotNetCore.Services.IJsonApiContext.ContextGraph": "JsonApiDotNetCore.Services.IJsonApiContext.yml", + "JsonApiDotNetCore.Services.IJsonApiContext.ControllerType": "JsonApiDotNetCore.Services.IJsonApiContext.yml", + "JsonApiDotNetCore.Services.IJsonApiContext.DocumentMeta": "JsonApiDotNetCore.Services.IJsonApiContext.yml", + "JsonApiDotNetCore.Services.IJsonApiContext.GenericProcessorFactory": "JsonApiDotNetCore.Services.IJsonApiContext.yml", + "JsonApiDotNetCore.Services.IJsonApiContext.GetControllerAttribute``1": "JsonApiDotNetCore.Services.IJsonApiContext.yml", + "JsonApiDotNetCore.Services.IJsonApiContext.IncludedRelationships": "JsonApiDotNetCore.Services.IJsonApiContext.yml", + "JsonApiDotNetCore.Services.IJsonApiContext.IsBulkOperationRequest": "JsonApiDotNetCore.Services.IJsonApiContext.yml", + "JsonApiDotNetCore.Services.IJsonApiContext.IsRelationshipData": "JsonApiDotNetCore.Services.IJsonApiContext.yml", + "JsonApiDotNetCore.Services.IJsonApiContext.IsRelationshipPath": "JsonApiDotNetCore.Services.IJsonApiContext.yml", + "JsonApiDotNetCore.Services.IJsonApiContext.MetaBuilder": "JsonApiDotNetCore.Services.IJsonApiContext.yml", + "JsonApiDotNetCore.Services.IJsonApiContext.Options": "JsonApiDotNetCore.Services.IJsonApiContext.yml", + "JsonApiDotNetCore.Services.IJsonApiContext.PageManager": "JsonApiDotNetCore.Services.IJsonApiContext.yml", + "JsonApiDotNetCore.Services.IJsonApiContext.QuerySet": "JsonApiDotNetCore.Services.IJsonApiContext.yml", + "JsonApiDotNetCore.Services.IJsonApiContext.RelationshipsToUpdate": "JsonApiDotNetCore.Services.IJsonApiContext.yml", + "JsonApiDotNetCore.Services.IJsonApiContext.RequestEntity": "JsonApiDotNetCore.Services.IJsonApiContext.yml", + "JsonApiDotNetCore.Services.IQueryAccessor": "JsonApiDotNetCore.Services.IQueryAccessor.yml", + "JsonApiDotNetCore.Services.IQueryAccessor.GetRequired``1(System.String)": "JsonApiDotNetCore.Services.IQueryAccessor.yml", + "JsonApiDotNetCore.Services.IQueryAccessor.TryGetValue``1(System.String,``0@)": "JsonApiDotNetCore.Services.IQueryAccessor.yml", + "JsonApiDotNetCore.Services.IQueryParser": "JsonApiDotNetCore.Services.IQueryParser.yml", + "JsonApiDotNetCore.Services.IQueryParser.Parse(Microsoft.AspNetCore.Http.IQueryCollection)": "JsonApiDotNetCore.Services.IQueryParser.yml", + "JsonApiDotNetCore.Services.IRequestMeta": "JsonApiDotNetCore.Services.IRequestMeta.yml", + "JsonApiDotNetCore.Services.IRequestMeta.GetMeta": "JsonApiDotNetCore.Services.IRequestMeta.yml", + "JsonApiDotNetCore.Services.IResourceCmdService`1": "JsonApiDotNetCore.Services.IResourceCmdService-1.yml", + "JsonApiDotNetCore.Services.IResourceCmdService`2": "JsonApiDotNetCore.Services.IResourceCmdService-2.yml", + "JsonApiDotNetCore.Services.IResourceQueryService`1": "JsonApiDotNetCore.Services.IResourceQueryService-1.yml", + "JsonApiDotNetCore.Services.IResourceQueryService`2": "JsonApiDotNetCore.Services.IResourceQueryService-2.yml", + "JsonApiDotNetCore.Services.IResourceService`1": "JsonApiDotNetCore.Services.IResourceService-1.yml", + "JsonApiDotNetCore.Services.IResourceService`2": "JsonApiDotNetCore.Services.IResourceService-2.yml", + "JsonApiDotNetCore.Services.IScopedServiceProvider": "JsonApiDotNetCore.Services.IScopedServiceProvider.yml", + "JsonApiDotNetCore.Services.IUpdateRelationshipService`1": "JsonApiDotNetCore.Services.IUpdateRelationshipService-1.yml", + "JsonApiDotNetCore.Services.IUpdateRelationshipService`2": "JsonApiDotNetCore.Services.IUpdateRelationshipService-2.yml", + "JsonApiDotNetCore.Services.IUpdateRelationshipService`2.UpdateRelationshipsAsync(`1,System.String,System.Collections.Generic.List{JsonApiDotNetCore.Models.DocumentData})": "JsonApiDotNetCore.Services.IUpdateRelationshipService-2.yml", + "JsonApiDotNetCore.Services.IUpdateService`1": "JsonApiDotNetCore.Services.IUpdateService-1.yml", + "JsonApiDotNetCore.Services.IUpdateService`2": "JsonApiDotNetCore.Services.IUpdateService-2.yml", + "JsonApiDotNetCore.Services.IUpdateService`2.UpdateAsync(`1,`0)": "JsonApiDotNetCore.Services.IUpdateService-2.yml", + "JsonApiDotNetCore.Services.JsonApiContext": "JsonApiDotNetCore.Services.JsonApiContext.yml", + "JsonApiDotNetCore.Services.JsonApiContext.#ctor(JsonApiDotNetCore.Internal.IContextGraph,Microsoft.AspNetCore.Http.IHttpContextAccessor,JsonApiDotNetCore.Configuration.JsonApiOptions,JsonApiDotNetCore.Builders.IMetaBuilder,JsonApiDotNetCore.Internal.Generics.IGenericProcessorFactory,JsonApiDotNetCore.Services.IQueryParser,JsonApiDotNetCore.Services.IControllerContext)": "JsonApiDotNetCore.Services.JsonApiContext.yml", + "JsonApiDotNetCore.Services.JsonApiContext.ApplyContext``1(System.Object)": "JsonApiDotNetCore.Services.JsonApiContext.yml", + "JsonApiDotNetCore.Services.JsonApiContext.AttributesToUpdate": "JsonApiDotNetCore.Services.JsonApiContext.yml", + "JsonApiDotNetCore.Services.JsonApiContext.BasePath": "JsonApiDotNetCore.Services.JsonApiContext.yml", + "JsonApiDotNetCore.Services.JsonApiContext.ContextGraph": "JsonApiDotNetCore.Services.JsonApiContext.yml", + "JsonApiDotNetCore.Services.JsonApiContext.ControllerType": "JsonApiDotNetCore.Services.JsonApiContext.yml", + "JsonApiDotNetCore.Services.JsonApiContext.DocumentMeta": "JsonApiDotNetCore.Services.JsonApiContext.yml", + "JsonApiDotNetCore.Services.JsonApiContext.GenericProcessorFactory": "JsonApiDotNetCore.Services.JsonApiContext.yml", + "JsonApiDotNetCore.Services.JsonApiContext.GetControllerAttribute``1": "JsonApiDotNetCore.Services.JsonApiContext.yml", + "JsonApiDotNetCore.Services.JsonApiContext.IncludedRelationships": "JsonApiDotNetCore.Services.JsonApiContext.yml", + "JsonApiDotNetCore.Services.JsonApiContext.IsBulkOperationRequest": "JsonApiDotNetCore.Services.JsonApiContext.yml", + "JsonApiDotNetCore.Services.JsonApiContext.IsRelationshipData": "JsonApiDotNetCore.Services.JsonApiContext.yml", + "JsonApiDotNetCore.Services.JsonApiContext.IsRelationshipPath": "JsonApiDotNetCore.Services.JsonApiContext.yml", + "JsonApiDotNetCore.Services.JsonApiContext.MetaBuilder": "JsonApiDotNetCore.Services.JsonApiContext.yml", + "JsonApiDotNetCore.Services.JsonApiContext.Options": "JsonApiDotNetCore.Services.JsonApiContext.yml", + "JsonApiDotNetCore.Services.JsonApiContext.PageManager": "JsonApiDotNetCore.Services.JsonApiContext.yml", + "JsonApiDotNetCore.Services.JsonApiContext.QuerySet": "JsonApiDotNetCore.Services.JsonApiContext.yml", + "JsonApiDotNetCore.Services.JsonApiContext.RelationshipsToUpdate": "JsonApiDotNetCore.Services.JsonApiContext.yml", + "JsonApiDotNetCore.Services.JsonApiContext.RequestEntity": "JsonApiDotNetCore.Services.JsonApiContext.yml", + "JsonApiDotNetCore.Services.Operations": "JsonApiDotNetCore.Services.Operations.yml", + "JsonApiDotNetCore.Services.Operations.IOperationProcessorResolver": "JsonApiDotNetCore.Services.Operations.IOperationProcessorResolver.yml", + "JsonApiDotNetCore.Services.Operations.IOperationProcessorResolver.LocateCreateService(JsonApiDotNetCore.Models.Operations.Operation)": "JsonApiDotNetCore.Services.Operations.IOperationProcessorResolver.yml", + "JsonApiDotNetCore.Services.Operations.IOperationProcessorResolver.LocateGetService(JsonApiDotNetCore.Models.Operations.Operation)": "JsonApiDotNetCore.Services.Operations.IOperationProcessorResolver.yml", + "JsonApiDotNetCore.Services.Operations.IOperationProcessorResolver.LocateRemoveService(JsonApiDotNetCore.Models.Operations.Operation)": "JsonApiDotNetCore.Services.Operations.IOperationProcessorResolver.yml", + "JsonApiDotNetCore.Services.Operations.IOperationProcessorResolver.LocateUpdateService(JsonApiDotNetCore.Models.Operations.Operation)": "JsonApiDotNetCore.Services.Operations.IOperationProcessorResolver.yml", + "JsonApiDotNetCore.Services.Operations.IOperationsProcessor": "JsonApiDotNetCore.Services.Operations.IOperationsProcessor.yml", + "JsonApiDotNetCore.Services.Operations.IOperationsProcessor.ProcessAsync(System.Collections.Generic.List{JsonApiDotNetCore.Models.Operations.Operation})": "JsonApiDotNetCore.Services.Operations.IOperationsProcessor.yml", + "JsonApiDotNetCore.Services.Operations.IOpProcessor": "JsonApiDotNetCore.Services.Operations.IOpProcessor.yml", + "JsonApiDotNetCore.Services.Operations.IOpProcessor.ProcessAsync(JsonApiDotNetCore.Models.Operations.Operation)": "JsonApiDotNetCore.Services.Operations.IOpProcessor.yml", + "JsonApiDotNetCore.Services.Operations.OperationProcessorResolver": "JsonApiDotNetCore.Services.Operations.OperationProcessorResolver.yml", + "JsonApiDotNetCore.Services.Operations.OperationProcessorResolver.#ctor(JsonApiDotNetCore.Internal.Generics.IGenericProcessorFactory,JsonApiDotNetCore.Services.IJsonApiContext)": "JsonApiDotNetCore.Services.Operations.OperationProcessorResolver.yml", + "JsonApiDotNetCore.Services.Operations.OperationProcessorResolver.LocateCreateService(JsonApiDotNetCore.Models.Operations.Operation)": "JsonApiDotNetCore.Services.Operations.OperationProcessorResolver.yml", + "JsonApiDotNetCore.Services.Operations.OperationProcessorResolver.LocateGetService(JsonApiDotNetCore.Models.Operations.Operation)": "JsonApiDotNetCore.Services.Operations.OperationProcessorResolver.yml", + "JsonApiDotNetCore.Services.Operations.OperationProcessorResolver.LocateRemoveService(JsonApiDotNetCore.Models.Operations.Operation)": "JsonApiDotNetCore.Services.Operations.OperationProcessorResolver.yml", + "JsonApiDotNetCore.Services.Operations.OperationProcessorResolver.LocateUpdateService(JsonApiDotNetCore.Models.Operations.Operation)": "JsonApiDotNetCore.Services.Operations.OperationProcessorResolver.yml", + "JsonApiDotNetCore.Services.Operations.OperationsProcessor": "JsonApiDotNetCore.Services.Operations.OperationsProcessor.yml", + "JsonApiDotNetCore.Services.Operations.OperationsProcessor.#ctor(JsonApiDotNetCore.Services.Operations.IOperationProcessorResolver,JsonApiDotNetCore.Data.IDbContextResolver)": "JsonApiDotNetCore.Services.Operations.OperationsProcessor.yml", + "JsonApiDotNetCore.Services.Operations.OperationsProcessor.ProcessAsync(System.Collections.Generic.List{JsonApiDotNetCore.Models.Operations.Operation})": "JsonApiDotNetCore.Services.Operations.OperationsProcessor.yml", + "JsonApiDotNetCore.Services.Operations.Processors": "JsonApiDotNetCore.Services.Operations.Processors.yml", + "JsonApiDotNetCore.Services.Operations.Processors.CreateOpProcessor`1": "JsonApiDotNetCore.Services.Operations.Processors.CreateOpProcessor-1.yml", + "JsonApiDotNetCore.Services.Operations.Processors.CreateOpProcessor`1.#ctor(JsonApiDotNetCore.Services.ICreateService{`0,System.Int32},JsonApiDotNetCore.Serialization.IJsonApiDeSerializer,JsonApiDotNetCore.Builders.IDocumentBuilder,JsonApiDotNetCore.Internal.IContextGraph)": "JsonApiDotNetCore.Services.Operations.Processors.CreateOpProcessor-1.yml", + "JsonApiDotNetCore.Services.Operations.Processors.CreateOpProcessor`2": "JsonApiDotNetCore.Services.Operations.Processors.CreateOpProcessor-2.yml", + "JsonApiDotNetCore.Services.Operations.Processors.CreateOpProcessor`2.#ctor(JsonApiDotNetCore.Services.ICreateService{`0,`1},JsonApiDotNetCore.Serialization.IJsonApiDeSerializer,JsonApiDotNetCore.Builders.IDocumentBuilder,JsonApiDotNetCore.Internal.IContextGraph)": "JsonApiDotNetCore.Services.Operations.Processors.CreateOpProcessor-2.yml", + "JsonApiDotNetCore.Services.Operations.Processors.CreateOpProcessor`2.ProcessAsync(JsonApiDotNetCore.Models.Operations.Operation)": "JsonApiDotNetCore.Services.Operations.Processors.CreateOpProcessor-2.yml", + "JsonApiDotNetCore.Services.Operations.Processors.GetOpProcessor`1": "JsonApiDotNetCore.Services.Operations.Processors.GetOpProcessor-1.yml", + "JsonApiDotNetCore.Services.Operations.Processors.GetOpProcessor`1.#ctor(JsonApiDotNetCore.Services.IGetAllService{`0,System.Int32},JsonApiDotNetCore.Services.IGetByIdService{`0,System.Int32},JsonApiDotNetCore.Services.IGetRelationshipService{`0,System.Int32},JsonApiDotNetCore.Serialization.IJsonApiDeSerializer,JsonApiDotNetCore.Builders.IDocumentBuilder,JsonApiDotNetCore.Internal.IContextGraph,JsonApiDotNetCore.Services.IJsonApiContext)": "JsonApiDotNetCore.Services.Operations.Processors.GetOpProcessor-1.yml", + "JsonApiDotNetCore.Services.Operations.Processors.GetOpProcessor`2": "JsonApiDotNetCore.Services.Operations.Processors.GetOpProcessor-2.yml", + "JsonApiDotNetCore.Services.Operations.Processors.GetOpProcessor`2.#ctor(JsonApiDotNetCore.Services.IGetAllService{`0,`1},JsonApiDotNetCore.Services.IGetByIdService{`0,`1},JsonApiDotNetCore.Services.IGetRelationshipService{`0,`1},JsonApiDotNetCore.Serialization.IJsonApiDeSerializer,JsonApiDotNetCore.Builders.IDocumentBuilder,JsonApiDotNetCore.Internal.IContextGraph,JsonApiDotNetCore.Services.IJsonApiContext)": "JsonApiDotNetCore.Services.Operations.Processors.GetOpProcessor-2.yml", + "JsonApiDotNetCore.Services.Operations.Processors.GetOpProcessor`2.ProcessAsync(JsonApiDotNetCore.Models.Operations.Operation)": "JsonApiDotNetCore.Services.Operations.Processors.GetOpProcessor-2.yml", + "JsonApiDotNetCore.Services.Operations.Processors.ICreateOpProcessor`1": "JsonApiDotNetCore.Services.Operations.Processors.ICreateOpProcessor-1.yml", + "JsonApiDotNetCore.Services.Operations.Processors.ICreateOpProcessor`2": "JsonApiDotNetCore.Services.Operations.Processors.ICreateOpProcessor-2.yml", + "JsonApiDotNetCore.Services.Operations.Processors.IGetOpProcessor`1": "JsonApiDotNetCore.Services.Operations.Processors.IGetOpProcessor-1.yml", + "JsonApiDotNetCore.Services.Operations.Processors.IGetOpProcessor`2": "JsonApiDotNetCore.Services.Operations.Processors.IGetOpProcessor-2.yml", + "JsonApiDotNetCore.Services.Operations.Processors.IRemoveOpProcessor`1": "JsonApiDotNetCore.Services.Operations.Processors.IRemoveOpProcessor-1.yml", + "JsonApiDotNetCore.Services.Operations.Processors.IRemoveOpProcessor`2": "JsonApiDotNetCore.Services.Operations.Processors.IRemoveOpProcessor-2.yml", + "JsonApiDotNetCore.Services.Operations.Processors.IUpdateOpProcessor`1": "JsonApiDotNetCore.Services.Operations.Processors.IUpdateOpProcessor-1.yml", + "JsonApiDotNetCore.Services.Operations.Processors.IUpdateOpProcessor`2": "JsonApiDotNetCore.Services.Operations.Processors.IUpdateOpProcessor-2.yml", + "JsonApiDotNetCore.Services.Operations.Processors.RemoveOpProcessor`1": "JsonApiDotNetCore.Services.Operations.Processors.RemoveOpProcessor-1.yml", + "JsonApiDotNetCore.Services.Operations.Processors.RemoveOpProcessor`1.#ctor(JsonApiDotNetCore.Services.IDeleteService{`0,System.Int32},JsonApiDotNetCore.Serialization.IJsonApiDeSerializer,JsonApiDotNetCore.Builders.IDocumentBuilder,JsonApiDotNetCore.Internal.IContextGraph)": "JsonApiDotNetCore.Services.Operations.Processors.RemoveOpProcessor-1.yml", + "JsonApiDotNetCore.Services.Operations.Processors.RemoveOpProcessor`2": "JsonApiDotNetCore.Services.Operations.Processors.RemoveOpProcessor-2.yml", + "JsonApiDotNetCore.Services.Operations.Processors.RemoveOpProcessor`2.#ctor(JsonApiDotNetCore.Services.IDeleteService{`0,`1},JsonApiDotNetCore.Serialization.IJsonApiDeSerializer,JsonApiDotNetCore.Builders.IDocumentBuilder,JsonApiDotNetCore.Internal.IContextGraph)": "JsonApiDotNetCore.Services.Operations.Processors.RemoveOpProcessor-2.yml", + "JsonApiDotNetCore.Services.Operations.Processors.RemoveOpProcessor`2.ProcessAsync(JsonApiDotNetCore.Models.Operations.Operation)": "JsonApiDotNetCore.Services.Operations.Processors.RemoveOpProcessor-2.yml", + "JsonApiDotNetCore.Services.Operations.Processors.UpdateOpProcessor`1": "JsonApiDotNetCore.Services.Operations.Processors.UpdateOpProcessor-1.yml", + "JsonApiDotNetCore.Services.Operations.Processors.UpdateOpProcessor`1.#ctor(JsonApiDotNetCore.Services.IUpdateService{`0,System.Int32},JsonApiDotNetCore.Serialization.IJsonApiDeSerializer,JsonApiDotNetCore.Builders.IDocumentBuilder,JsonApiDotNetCore.Internal.IContextGraph)": "JsonApiDotNetCore.Services.Operations.Processors.UpdateOpProcessor-1.yml", + "JsonApiDotNetCore.Services.Operations.Processors.UpdateOpProcessor`2": "JsonApiDotNetCore.Services.Operations.Processors.UpdateOpProcessor-2.yml", + "JsonApiDotNetCore.Services.Operations.Processors.UpdateOpProcessor`2.#ctor(JsonApiDotNetCore.Services.IUpdateService{`0,`1},JsonApiDotNetCore.Serialization.IJsonApiDeSerializer,JsonApiDotNetCore.Builders.IDocumentBuilder,JsonApiDotNetCore.Internal.IContextGraph)": "JsonApiDotNetCore.Services.Operations.Processors.UpdateOpProcessor-2.yml", + "JsonApiDotNetCore.Services.Operations.Processors.UpdateOpProcessor`2.ProcessAsync(JsonApiDotNetCore.Models.Operations.Operation)": "JsonApiDotNetCore.Services.Operations.Processors.UpdateOpProcessor-2.yml", + "JsonApiDotNetCore.Services.QueryAccessor": "JsonApiDotNetCore.Services.QueryAccessor.yml", + "JsonApiDotNetCore.Services.QueryAccessor.#ctor(JsonApiDotNetCore.Services.IJsonApiContext,Microsoft.Extensions.Logging.ILogger{JsonApiDotNetCore.Services.QueryAccessor})": "JsonApiDotNetCore.Services.QueryAccessor.yml", + "JsonApiDotNetCore.Services.QueryAccessor.GetRequired``1(System.String)": "JsonApiDotNetCore.Services.QueryAccessor.yml", + "JsonApiDotNetCore.Services.QueryAccessor.TryGetValue``1(System.String,``0@)": "JsonApiDotNetCore.Services.QueryAccessor.yml", + "JsonApiDotNetCore.Services.QueryParser": "JsonApiDotNetCore.Services.QueryParser.yml", + "JsonApiDotNetCore.Services.QueryParser.#ctor(JsonApiDotNetCore.Services.IControllerContext,JsonApiDotNetCore.Configuration.JsonApiOptions)": "JsonApiDotNetCore.Services.QueryParser.yml", + "JsonApiDotNetCore.Services.QueryParser.GetAttribute(System.String)": "JsonApiDotNetCore.Services.QueryParser.yml", + "JsonApiDotNetCore.Services.QueryParser.Parse(Microsoft.AspNetCore.Http.IQueryCollection)": "JsonApiDotNetCore.Services.QueryParser.yml", + "JsonApiDotNetCore.Services.QueryParser.ParseFieldsQuery(System.String,System.String)": "JsonApiDotNetCore.Services.QueryParser.yml", + "JsonApiDotNetCore.Services.QueryParser.ParseFilterOperation(System.String)": "JsonApiDotNetCore.Services.QueryParser.yml", + "JsonApiDotNetCore.Services.QueryParser.ParseFilterQuery(System.String,System.String)": "JsonApiDotNetCore.Services.QueryParser.yml", + "JsonApiDotNetCore.Services.QueryParser.ParseIncludedRelationships(System.String)": "JsonApiDotNetCore.Services.QueryParser.yml", + "JsonApiDotNetCore.Services.QueryParser.ParsePageQuery(JsonApiDotNetCore.Internal.Query.PageQuery,System.String,System.String)": "JsonApiDotNetCore.Services.QueryParser.yml", + "JsonApiDotNetCore.Services.QueryParser.ParseSortParameters(System.String)": "JsonApiDotNetCore.Services.QueryParser.yml", + "JsonApiDotNetCore.Services.RequestScopedServiceProvider": "JsonApiDotNetCore.Services.RequestScopedServiceProvider.yml", + "JsonApiDotNetCore.Services.RequestScopedServiceProvider.#ctor(Microsoft.AspNetCore.Http.IHttpContextAccessor)": "JsonApiDotNetCore.Services.RequestScopedServiceProvider.yml", + "JsonApiDotNetCore.Services.RequestScopedServiceProvider.GetService(System.Type)": "JsonApiDotNetCore.Services.RequestScopedServiceProvider.yml" +} \ No newline at end of file diff --git a/src/JsonApiDotNetCore/api/index.md b/src/JsonApiDotNetCore/api/index.md new file mode 100644 index 0000000000..78dc9c0057 --- /dev/null +++ b/src/JsonApiDotNetCore/api/index.md @@ -0,0 +1,2 @@ +# PLACEHOLDER +TODO: Add .NET projects to the *src* folder and run `docfx` to generate **REAL** *API Documentation*! diff --git a/src/JsonApiDotNetCore/articles/intro.md b/src/JsonApiDotNetCore/articles/intro.md new file mode 100644 index 0000000000..c0478cedea --- /dev/null +++ b/src/JsonApiDotNetCore/articles/intro.md @@ -0,0 +1 @@ +# Add your introductions here! diff --git a/src/JsonApiDotNetCore/articles/toc.yml b/src/JsonApiDotNetCore/articles/toc.yml new file mode 100644 index 0000000000..ff89ef1fe0 --- /dev/null +++ b/src/JsonApiDotNetCore/articles/toc.yml @@ -0,0 +1,2 @@ +- name: Introduction + href: intro.md diff --git a/src/JsonApiDotNetCore/docfx.json b/src/JsonApiDotNetCore/docfx.json new file mode 100644 index 0000000000..5c46dcbd88 --- /dev/null +++ b/src/JsonApiDotNetCore/docfx.json @@ -0,0 +1,52 @@ +{ + "metadata": [ + { + "src": [ + { + "files": [ "**.csproj" ], + "src": "C:\\Users\\jnance\\dev\\json-api-dotnet-core\\src\\JsonApiDotNetCore" + } + ], + "dest": "api", + "disableGitFeatures": false, + "properties": { + "targetFramework": "netstandard2.0" + } + } + ], + "build": { + "content": [ + { + "files": [ "api/**.yml", "api/index.md" ] + }, + { + "files": [ + "articles/**.md", + "articles/**/toc.yml", + "toc.yml", + "*.md" + ] + } + ], + "resource": [ + { + "files": [ "images/**" ] + } + ], + "overwrite": [ + { + "files": [ "apidoc/**.md" ], + "exclude": [ "obj/**", "_site/**" ] + } + ], + "dest": "_site", + "globalMetadataFiles": [], + "fileMetadataFiles": [], + "template": [ "default" ], + "postProcessors": [], + "noLangKeyword": false, + "keepFileLink": false, + "cleanupCacheHistory": false, + "disableGitFeatures": false + } +} diff --git a/src/JsonApiDotNetCore/index.md b/src/JsonApiDotNetCore/index.md new file mode 100644 index 0000000000..3ae2506361 --- /dev/null +++ b/src/JsonApiDotNetCore/index.md @@ -0,0 +1,4 @@ +# This is the **HOMEPAGE**. +Refer to [Markdown](http://daringfireball.net/projects/markdown/) for how to write markdown files. +## Quick Start Notes: +1. Add images to the *images* folder if the file is referencing an image. diff --git a/src/JsonApiDotNetCore/toc.yml b/src/JsonApiDotNetCore/toc.yml new file mode 100644 index 0000000000..59f8010471 --- /dev/null +++ b/src/JsonApiDotNetCore/toc.yml @@ -0,0 +1,5 @@ +- name: Articles + href: articles/ +- name: Api Documentation + href: api/ + homepage: api/index.md diff --git a/test/JsonApiDotNetCoreExampleTests/Acceptance/CamelCasedModelsControllerTests.cs b/test/JsonApiDotNetCoreExampleTests/Acceptance/CamelCasedModelsControllerTests.cs index 3cc920544f..533c59839a 100644 --- a/test/JsonApiDotNetCoreExampleTests/Acceptance/CamelCasedModelsControllerTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/Acceptance/CamelCasedModelsControllerTests.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using System.Net; using System.Net.Http; using System.Net.Http.Headers; @@ -19,12 +19,12 @@ namespace JsonApiDotNetCoreExampleTests.Acceptance [Collection("WebHostCollection")] public class CamelCasedModelsControllerTests { - private TestFixture _fixture; + private TestFixture _fixture; private AppDbContext _context; private IJsonApiContext _jsonApiContext; private Faker _faker; - public CamelCasedModelsControllerTests(TestFixture fixture) + public CamelCasedModelsControllerTests(TestFixture fixture) { _fixture = fixture; _context = fixture.GetService(); @@ -35,7 +35,6 @@ public CamelCasedModelsControllerTests(TestFixture fixture) [Fact] public async Task Can_Get_CamelCasedModels() - { // Arrange var model = _faker.Generate(); @@ -59,7 +58,7 @@ public async Task Can_Get_CamelCasedModels() // Assert Assert.Equal(HttpStatusCode.OK, response.StatusCode); Assert.NotEmpty(deserializedBody); - Assert.True(deserializedBody.Count > 0); + Assert.True(deserializedBody.Count > 0); } [Fact] @@ -115,7 +114,7 @@ public async Task Can_Post_CamelCasedModels() var request = new HttpRequestMessage(httpMethod, route); request.Content = new StringContent(JsonConvert.SerializeObject(content)); request.Content.Headers.ContentType = new MediaTypeHeaderValue("application/vnd.api+json"); - + // Act var response = await client.SendAsync(request); var body = await response.Content.ReadAsStringAsync(); @@ -159,7 +158,7 @@ public async Task Can_Patch_CamelCasedModels() var request = new HttpRequestMessage(httpMethod, route); request.Content = new StringContent(JsonConvert.SerializeObject(content)); request.Content.Headers.ContentType = new MediaTypeHeaderValue("application/vnd.api+json"); - + // Act var response = await client.SendAsync(request); var body = await response.Content.ReadAsStringAsync(); @@ -174,4 +173,4 @@ public async Task Can_Patch_CamelCasedModels() Assert.Equal(newModel.CompoundAttr, deserializedBody.CompoundAttr); } } -} \ No newline at end of file +} diff --git a/test/JsonApiDotNetCoreExampleTests/Acceptance/Extensibility/CustomControllerTests.cs b/test/JsonApiDotNetCoreExampleTests/Acceptance/Extensibility/CustomControllerTests.cs index 9b28ee48de..478f40f14f 100644 --- a/test/JsonApiDotNetCoreExampleTests/Acceptance/Extensibility/CustomControllerTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/Acceptance/Extensibility/CustomControllerTests.cs @@ -17,11 +17,11 @@ namespace JsonApiDotNetCoreExampleTests.Acceptance.Extensibility [Collection("WebHostCollection")] public class CustomControllerTests { - private TestFixture _fixture; + private TestFixture _fixture; private Faker _todoItemFaker; private Faker _personFaker; - public CustomControllerTests(TestFixture fixture) + public CustomControllerTests(TestFixture fixture) { _fixture = fixture; _todoItemFaker = new Faker() diff --git a/test/JsonApiDotNetCoreExampleTests/Acceptance/Extensibility/CustomErrorTests.cs b/test/JsonApiDotNetCoreExampleTests/Acceptance/Extensibility/CustomErrorTests.cs index ce2b541f5b..fcc6e5ffde 100644 --- a/test/JsonApiDotNetCoreExampleTests/Acceptance/Extensibility/CustomErrorTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/Acceptance/Extensibility/CustomErrorTests.cs @@ -11,7 +11,7 @@ public class CustomErrorTests public void Can_Return_Custom_Error_Types() { // arrange - var error = new CustomError("507", "title", "detail", "custom"); + var error = new CustomError(507, "title", "detail", "custom"); var errorCollection = new ErrorCollection(); errorCollection.Add(error); @@ -36,7 +36,7 @@ public void Can_Return_Custom_Error_Types() } class CustomError : Error { - public CustomError(string status, string title, string detail, string myProp) + public CustomError(int status, string title, string detail, string myProp) : base(status, title, detail) { MyCustomProperty = myProp; diff --git a/test/JsonApiDotNetCoreExampleTests/Acceptance/Extensibility/NullValuedAttributeHandlingTests.cs b/test/JsonApiDotNetCoreExampleTests/Acceptance/Extensibility/NullValuedAttributeHandlingTests.cs new file mode 100644 index 0000000000..05c348a553 --- /dev/null +++ b/test/JsonApiDotNetCoreExampleTests/Acceptance/Extensibility/NullValuedAttributeHandlingTests.cs @@ -0,0 +1,105 @@ +using System; +using System.Net.Http; +using System.Threading.Tasks; +using JsonApiDotNetCore.Configuration; +using JsonApiDotNetCore.Models; +using JsonApiDotNetCoreExample.Data; +using JsonApiDotNetCoreExample.Models; +using Newtonsoft.Json; +using Xunit; + +namespace JsonApiDotNetCoreExampleTests.Acceptance.Extensibility +{ + [Collection("WebHostCollection")] + public class NullValuedAttributeHandlingTests : IAsyncLifetime + { + private readonly TestFixture _fixture; + private readonly AppDbContext _dbContext; + private readonly TodoItem _todoItem; + + public NullValuedAttributeHandlingTests(TestFixture fixture) + { + _fixture = fixture; + _dbContext = fixture.GetService(); + _todoItem = new TodoItem + { + Description = null, + Ordinal = 1, + CreatedDate = DateTime.Now, + AchievedDate = DateTime.Now.AddDays(2) + }; + _todoItem = _dbContext.TodoItems.Add(_todoItem).Entity; + } + + public async Task InitializeAsync() + { + await _dbContext.SaveChangesAsync(); + } + + public Task DisposeAsync() + { + return Task.CompletedTask; + } + + [Theory] + [InlineData(null, null, null, false)] + [InlineData(true, null, null, true)] + [InlineData(false, true, "true", true)] + [InlineData(false, false, "true", false)] + [InlineData(true, true, "false", false)] + [InlineData(true, false, "false", true)] + [InlineData(null, false, "false", false)] + [InlineData(null, false, "true", false)] + [InlineData(null, true, "true", true)] + [InlineData(null, true, "false", false)] + [InlineData(null, true, "foo", false)] + [InlineData(null, false, "foo", false)] + [InlineData(true, true, "foo", true)] + [InlineData(true, false, "foo", true)] + [InlineData(null, true, null, false)] + [InlineData(null, false, null, false)] + public async Task CheckNullBehaviorCombination(bool? omitNullValuedAttributes, bool? allowClientOverride, + string clientOverride, bool omitsNulls) + { + + // Override some null handling options + NullAttributeResponseBehavior nullAttributeResponseBehavior; + if (omitNullValuedAttributes.HasValue && allowClientOverride.HasValue) + { + nullAttributeResponseBehavior = new NullAttributeResponseBehavior(omitNullValuedAttributes.Value, allowClientOverride.Value); + } + else if (omitNullValuedAttributes.HasValue) + { + nullAttributeResponseBehavior = new NullAttributeResponseBehavior(omitNullValuedAttributes.Value); + } + else if (allowClientOverride.HasValue) + { + nullAttributeResponseBehavior = new NullAttributeResponseBehavior(allowClientOverride: allowClientOverride.Value); + } + else + { + nullAttributeResponseBehavior = new NullAttributeResponseBehavior(); + } + var jsonApiOptions = _fixture.GetService(); + jsonApiOptions.NullAttributeResponseBehavior = nullAttributeResponseBehavior; + jsonApiOptions.AllowCustomQueryParameters = true; + + var httpMethod = new HttpMethod("GET"); + var queryString = allowClientOverride.HasValue + ? $"?omitNullValuedAttributes={clientOverride}" + : ""; + var route = $"/api/v1/todo-items/{_todoItem.Id}{queryString}"; + var request = new HttpRequestMessage(httpMethod, route); + + // act + var response = await _fixture.Client.SendAsync(request); + var body = await response.Content.ReadAsStringAsync(); + var deserializeBody = JsonConvert.DeserializeObject(body); + + // assert. does response contain a null valued attribute + Assert.Equal(omitsNulls, !deserializeBody.Data.Attributes.ContainsKey("description")); + + } + } + +} diff --git a/test/JsonApiDotNetCoreExampleTests/Acceptance/Extensibility/RepositoryOverrideTests.cs b/test/JsonApiDotNetCoreExampleTests/Acceptance/Extensibility/RepositoryOverrideTests.cs index 2813151ad3..95ea814a5d 100644 --- a/test/JsonApiDotNetCoreExampleTests/Acceptance/Extensibility/RepositoryOverrideTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/Acceptance/Extensibility/RepositoryOverrideTests.cs @@ -3,7 +3,6 @@ using System.Threading.Tasks; using JsonApiDotNetCore.Serialization; using JsonApiDotNetCore.Services; -using JsonApiDotNetCoreExample; using JsonApiDotNetCoreExample.Data; using JsonApiDotNetCoreExample.Models; using JsonApiDotNetCoreExampleTests.Services; @@ -17,9 +16,9 @@ namespace JsonApiDotNetCoreExampleTests.Acceptance.Extensibility [Collection("WebHostCollection")] public class RepositoryOverrideTests { - private TestFixture _fixture; + private TestFixture _fixture; - public RepositoryOverrideTests(TestFixture fixture) + public RepositoryOverrideTests(TestFixture fixture) { _fixture = fixture; } diff --git a/test/JsonApiDotNetCoreExampleTests/Acceptance/Extensibility/RequestMetaTests.cs b/test/JsonApiDotNetCoreExampleTests/Acceptance/Extensibility/RequestMetaTests.cs index 9420ea6891..4f9198619a 100644 --- a/test/JsonApiDotNetCoreExampleTests/Acceptance/Extensibility/RequestMetaTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/Acceptance/Extensibility/RequestMetaTests.cs @@ -5,7 +5,6 @@ using Microsoft.AspNetCore.TestHost; using Xunit; using JsonApiDotNetCoreExample.Models; -using JsonApiDotNetCoreExample; using Newtonsoft.Json; using JsonApiDotNetCore.Models; using System.Collections; @@ -16,9 +15,9 @@ namespace JsonApiDotNetCoreExampleTests.Acceptance.Extensibility [Collection("WebHostCollection")] public class RequestMetaTests { - private TestFixture _fixture; + private TestFixture _fixture; - public RequestMetaTests(TestFixture fixture) + public RequestMetaTests(TestFixture fixture) { _fixture = fixture; } diff --git a/test/JsonApiDotNetCoreExampleTests/Acceptance/ResourceDefinitions/OutputAttrs_Tests.cs b/test/JsonApiDotNetCoreExampleTests/Acceptance/ResourceDefinitions/OutputAttrs_Tests.cs new file mode 100644 index 0000000000..c5a6c054a4 --- /dev/null +++ b/test/JsonApiDotNetCoreExampleTests/Acceptance/ResourceDefinitions/OutputAttrs_Tests.cs @@ -0,0 +1,148 @@ +using System.Collections.Generic; +using System.Linq; +using System.Net; +using System.Net.Http; +using System.Net.Http.Headers; +using System.Threading.Tasks; +using Bogus; +using JsonApiDotNetCore.Models; +using JsonApiDotNetCore.Serialization; +using JsonApiDotNetCoreExample.Data; +using JsonApiDotNetCoreExample.Models; +using Microsoft.EntityFrameworkCore; +using Newtonsoft.Json; +using Xunit; + +namespace JsonApiDotNetCoreExampleTests.Acceptance +{ + [Collection("WebHostCollection")] + public class OutputAttrs_Tests + { + private TestFixture _fixture; + private AppDbContext _context; + private Faker _userFaker; + + public OutputAttrs_Tests(TestFixture fixture) + { + _fixture = fixture; + _context = fixture.GetService(); + _userFaker = new Faker() + .RuleFor(u => u.Username, f => f.Internet.UserName()) + .RuleFor(u => u.Password, f => f.Internet.Password()); + } + + [Fact] + public async Task Password_Is_Not_Included_In_Response_Payload() + { + // Arrange + var user = _userFaker.Generate(); + _context.Users.Add(user); + _context.SaveChanges(); + + var httpMethod = new HttpMethod("GET"); + var route = $"/api/v1/users/{user.Id}"; + var request = new HttpRequestMessage(httpMethod, route); + + // Act + var response = await _fixture.Client.SendAsync(request); + + // Assert + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + var body = await response.Content.ReadAsStringAsync(); + var document = JsonConvert.DeserializeObject(body); + Assert.False(document.Data.Attributes.ContainsKey("password")); + } + + [Fact] + public async Task Can_Create_User_With_Password() + { + // Arrange + var user = _userFaker.Generate(); + var content = new + { + data = new + { + type = "users", + attributes = new Dictionary() + { + { "username", user.Username }, + { "password", user.Password }, + } + } + }; + + var httpMethod = new HttpMethod("POST"); + var route = $"/api/v1/users"; + + var request = new HttpRequestMessage(httpMethod, route); + request.Content = new StringContent(JsonConvert.SerializeObject(content)); + request.Content.Headers.ContentType = new MediaTypeHeaderValue("application/vnd.api+json"); + + // Act + var response = await _fixture.Client.SendAsync(request); + + // Assert + Assert.Equal(HttpStatusCode.Created, response.StatusCode); + + // response assertions + var body = await response.Content.ReadAsStringAsync(); + var deserializedBody = (User)_fixture.GetService().Deserialize(body); + var document = JsonConvert.DeserializeObject(body); + Assert.False(document.Data.Attributes.ContainsKey("password")); + Assert.Equal(user.Username, document.Data.Attributes["username"]); + + // db assertions + var dbUser = await _context.Users.FindAsync(deserializedBody.Id); + Assert.Equal(user.Username, dbUser.Username); + Assert.Equal(user.Password, dbUser.Password); + } + + [Fact] + public async Task Can_Update_User_Password() + { + // Arrange + var user = _userFaker.Generate(); + _context.Users.Add(user); + _context.SaveChanges(); + + var newPassword = _userFaker.Generate().Password; + + var content = new + { + data = new + { + type = "users", + id = user.Id, + attributes = new Dictionary() + { + { "password", newPassword }, + } + } + }; + + var httpMethod = new HttpMethod("PATCH"); + var route = $"/api/v1/users/{user.Id}"; + + var request = new HttpRequestMessage(httpMethod, route); + request.Content = new StringContent(JsonConvert.SerializeObject(content)); + request.Content.Headers.ContentType = new MediaTypeHeaderValue("application/vnd.api+json"); + + // Act + var response = await _fixture.Client.SendAsync(request); + + // Assert + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + + // response assertions + var body = await response.Content.ReadAsStringAsync(); + var deserializedBody = (User)_fixture.GetService().Deserialize(body); + var document = JsonConvert.DeserializeObject(body); + Assert.False(document.Data.Attributes.ContainsKey("password")); + Assert.Equal(user.Username, document.Data.Attributes["username"]); + + // db assertions + var dbUser = _context.Users.AsNoTracking().Single(u => u.Id == user.Id); + Assert.Equal(newPassword, dbUser.Password); + } + } +} diff --git a/test/JsonApiDotNetCoreExampleTests/Acceptance/Spec/AttributeFilterTests.cs b/test/JsonApiDotNetCoreExampleTests/Acceptance/Spec/AttributeFilterTests.cs index 740a61193c..9e154f9b47 100644 --- a/test/JsonApiDotNetCoreExampleTests/Acceptance/Spec/AttributeFilterTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/Acceptance/Spec/AttributeFilterTests.cs @@ -1,15 +1,14 @@ -using System.Linq; +using System; +using System.Collections.Generic; +using System.Linq; using System.Net; using System.Net.Http; using System.Threading.Tasks; using Bogus; using JsonApiDotNetCore.Models; using JsonApiDotNetCore.Serialization; -using JsonApiDotNetCoreExample; using JsonApiDotNetCoreExample.Data; using JsonApiDotNetCoreExample.Models; -using Microsoft.AspNetCore.Hosting; -using Microsoft.AspNetCore.TestHost; using Newtonsoft.Json; using Xunit; using Person = JsonApiDotNetCoreExample.Models.Person; @@ -19,11 +18,11 @@ namespace JsonApiDotNetCoreExampleTests.Acceptance.Spec [Collection("WebHostCollection")] public class AttributeFilterTests { - private TestFixture _fixture; + private TestFixture _fixture; private Faker _todoItemFaker; private readonly Faker _personFaker; - public AttributeFilterTests(TestFixture fixture) + public AttributeFilterTests(TestFixture fixture) { _fixture = fixture; _todoItemFaker = new Faker() @@ -44,17 +43,13 @@ public async Task Can_Filter_On_Guid_Properties() var todoItem = _todoItemFaker.Generate(); context.TodoItems.Add(todoItem); await context.SaveChangesAsync(); - - var builder = new WebHostBuilder() - .UseStartup(); + var httpMethod = new HttpMethod("GET"); var route = $"/api/v1/todo-items?filter[guid-property]={todoItem.GuidProperty}"; - var server = new TestServer(builder); - var client = server.CreateClient(); var request = new HttpRequestMessage(httpMethod, route); // act - var response = await client.SendAsync(request); + var response = await _fixture.Client.SendAsync(request); var body = await response.Content.ReadAsStringAsync(); var deserializedBody = _fixture .GetService() @@ -68,7 +63,6 @@ public async Task Can_Filter_On_Guid_Properties() Assert.Equal(todoItem.GuidProperty, todoItemResponse.GuidProperty); } - [Fact] public async Task Can_Filter_On_Related_Attrs() { @@ -79,17 +73,13 @@ public async Task Can_Filter_On_Related_Attrs() todoItem.Owner = person; context.TodoItems.Add(todoItem); await context.SaveChangesAsync(); - - var builder = new WebHostBuilder() - .UseStartup(); + var httpMethod = new HttpMethod("GET"); var route = $"/api/v1/todo-items?include=owner&filter[owner.first-name]={person.FirstName}"; - var server = new TestServer(builder); - var client = server.CreateClient(); var request = new HttpRequestMessage(httpMethod, route); // act - var response = await client.SendAsync(request); + var response = await _fixture.Client.SendAsync(request); var body = await response.Content.ReadAsStringAsync(); var documents = JsonConvert.DeserializeObject(await response.Content.ReadAsStringAsync()); var included = documents.Included; @@ -98,8 +88,126 @@ public async Task Can_Filter_On_Related_Attrs() Assert.Equal(HttpStatusCode.OK, response.StatusCode); Assert.NotNull(included); Assert.NotEmpty(included); - foreach(var item in included) + foreach (var item in included) Assert.Equal(person.FirstName, item.Attributes["first-name"]); } + + [Fact] + public async Task Cannot_Filter_If_Explicitly_Forbidden() + { + // arrange + var httpMethod = new HttpMethod("GET"); + var route = $"/api/v1/todo-items?include=owner&filter[achieved-date]={DateTime.UtcNow.Date}"; + var request = new HttpRequestMessage(httpMethod, route); + + // act + var response = await _fixture.Client.SendAsync(request); + + // assert + Assert.Equal(HttpStatusCode.BadRequest, response.StatusCode); + } + + [Fact] + public async Task Can_Filter_On_Not_Equal_Values() + { + // arrange + var context = _fixture.GetService(); + var todoItem = _todoItemFaker.Generate(); + context.TodoItems.Add(todoItem); + await context.SaveChangesAsync(); + + var totalCount = context.TodoItems.Count(); + var httpMethod = new HttpMethod("GET"); + var route = $"/api/v1/todo-items?page[size]={totalCount}&filter[ordinal]=ne:{todoItem.Ordinal}"; + var request = new HttpRequestMessage(httpMethod, route); + + // act + var response = await _fixture.Client.SendAsync(request); + var body = await response.Content.ReadAsStringAsync(); + var deserializedTodoItems = _fixture + .GetService() + .DeserializeList(body); + + // assert + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + Assert.DoesNotContain(deserializedTodoItems, x => x.Ordinal == todoItem.Ordinal); + } + + [Fact] + public async Task Can_Filter_On_In_Array_Values() + { + // arrange + var context = _fixture.GetService(); + var todoItems = _todoItemFaker.Generate(5); + var guids = new List(); + var notInGuids = new List(); + foreach (var item in todoItems) + { + context.TodoItems.Add(item); + // Exclude 2 items + if (guids.Count < (todoItems.Count() - 2)) + guids.Add(item.GuidProperty); + else + notInGuids.Add(item.GuidProperty); + } + context.SaveChanges(); + + var totalCount = context.TodoItems.Count(); + var httpMethod = new HttpMethod("GET"); + var route = $"/api/v1/todo-items?filter[guid-property]=in:{string.Join(",", guids)}"; + var request = new HttpRequestMessage(httpMethod, route); + + // act + var response = await _fixture.Client.SendAsync(request); + var body = await response.Content.ReadAsStringAsync(); + var deserializedTodoItems = _fixture + .GetService() + .DeserializeList(body); + + // assert + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + Assert.Equal(guids.Count(), deserializedTodoItems.Count()); + foreach (var item in deserializedTodoItems) + { + Assert.Contains(item.GuidProperty, guids); + Assert.DoesNotContain(item.GuidProperty, notInGuids); + } + } + + [Fact] + public async Task Can_Filter_On_Related_In_Array_Values() + { + // arrange + var context = _fixture.GetService(); + var todoItems = _todoItemFaker.Generate(3); + var ownerFirstNames = new List(); + foreach (var item in todoItems) + { + var person = _personFaker.Generate(); + ownerFirstNames.Add(person.FirstName); + item.Owner = person; + context.TodoItems.Add(item); + } + context.SaveChanges(); + + var httpMethod = new HttpMethod("GET"); + var route = $"/api/v1/todo-items?include=owner&filter[owner.first-name]=in:{string.Join(",", ownerFirstNames)}"; + var request = new HttpRequestMessage(httpMethod, route); + + // act + var response = await _fixture.Client.SendAsync(request); + var body = await response.Content.ReadAsStringAsync(); + var documents = JsonConvert.DeserializeObject(await response.Content.ReadAsStringAsync()); + var included = documents.Included; + + // assert + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + Assert.Equal(ownerFirstNames.Count(), documents.Data.Count()); + Assert.NotNull(included); + Assert.NotEmpty(included); + foreach (var item in included) + Assert.Contains(item.Attributes["first-name"], ownerFirstNames); + + } } } diff --git a/test/JsonApiDotNetCoreExampleTests/Acceptance/Spec/AttributeSortTests.cs b/test/JsonApiDotNetCoreExampleTests/Acceptance/Spec/AttributeSortTests.cs new file mode 100644 index 0000000000..4aef3817fe --- /dev/null +++ b/test/JsonApiDotNetCoreExampleTests/Acceptance/Spec/AttributeSortTests.cs @@ -0,0 +1,33 @@ +using System.Net; +using System.Net.Http; +using System.Threading.Tasks; +using Xunit; + +namespace JsonApiDotNetCoreExampleTests.Acceptance.Spec +{ + [Collection("WebHostCollection")] + public class AttributeSortTests + { + private TestFixture _fixture; + + public AttributeSortTests(TestFixture fixture) + { + _fixture = fixture; + } + + [Fact] + public async Task Cannot_Sort_If_Explicitly_Forbidden() + { + // arrange + var httpMethod = new HttpMethod("GET"); + var route = $"/api/v1/todo-items?include=owner&sort=achieved-date"; + var request = new HttpRequestMessage(httpMethod, route); + + // act + var response = await _fixture.Client.SendAsync(request); + + // assert + Assert.Equal(HttpStatusCode.BadRequest, response.StatusCode); + } + } +} diff --git a/test/JsonApiDotNetCoreExampleTests/Acceptance/Spec/ContentNegotiation.cs b/test/JsonApiDotNetCoreExampleTests/Acceptance/Spec/ContentNegotiation.cs index 8f76735ee9..76f5fa4aa7 100644 --- a/test/JsonApiDotNetCoreExampleTests/Acceptance/Spec/ContentNegotiation.cs +++ b/test/JsonApiDotNetCoreExampleTests/Acceptance/Spec/ContentNegotiation.cs @@ -12,8 +12,8 @@ namespace JsonApiDotNetCoreExampleTests.Acceptance.Spec [Collection("WebHostCollection")] public class ContentNegotiation { - private TestFixture _fixture; - public ContentNegotiation(TestFixture fixture) + private TestFixture _fixture; + public ContentNegotiation(TestFixture fixture) { _fixture = fixture; } diff --git a/test/JsonApiDotNetCoreExampleTests/Acceptance/Spec/CreatingDataTests.cs b/test/JsonApiDotNetCoreExampleTests/Acceptance/Spec/CreatingDataTests.cs index e011cb8679..015d79cdbd 100644 --- a/test/JsonApiDotNetCoreExampleTests/Acceptance/Spec/CreatingDataTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/Acceptance/Spec/CreatingDataTests.cs @@ -23,11 +23,11 @@ namespace JsonApiDotNetCoreExampleTests.Acceptance.Spec [Collection("WebHostCollection")] public class CreatingDataTests { - private TestFixture _fixture; + private TestFixture _fixture; private IJsonApiContext _jsonApiContext; private Faker _todoItemFaker; - public CreatingDataTests(TestFixture fixture) + public CreatingDataTests(TestFixture fixture) { _fixture = fixture; _jsonApiContext = fixture.GetService(); @@ -106,7 +106,7 @@ public async Task Cannot_Create_Entity_With_Client_Generate_Id() attributes = new { description = todoItem.Description, - ordinal = todoItem.Ordinal, + ordinal = todoItem.Ordinal, createdDate = DateTime.Now } } @@ -174,7 +174,7 @@ public async Task Can_Create_Guid_Identifiable_Entity_With_Client_Defined_Id_If_ var httpMethod = new HttpMethod("POST"); var server = new TestServer(builder); var client = server.CreateClient(); - + var context = _fixture.GetService(); var owner = new JsonApiDotNetCoreExample.Models.Person(); @@ -272,6 +272,8 @@ public async Task Can_Create_And_Set_HasMany_Relationships() var body = await response.Content.ReadAsStringAsync(); var deserializedBody = (TodoItemCollection)_fixture.GetService().Deserialize(body); var newId = deserializedBody.Id; + + context = _fixture.GetService(); var contextCollection = context.TodoItemCollections .Include(c => c.Owner) .Include(c => c.TodoItems) @@ -283,6 +285,63 @@ public async Task Can_Create_And_Set_HasMany_Relationships() Assert.NotEmpty(contextCollection.TodoItems); } + [Fact] + public async Task Can_Create_And_Set_HasOne_Relationships() + { + // arrange + var builder = new WebHostBuilder() + .UseStartup(); + var httpMethod = new HttpMethod("POST"); + var server = new TestServer(builder); + var client = server.CreateClient(); + + var context = _fixture.GetService(); + + var todoItem = new TodoItem(); + var owner = new JsonApiDotNetCoreExample.Models.Person(); + context.People.Add(owner); + await context.SaveChangesAsync(); + + var route = "/api/v1/todo-items"; + var request = new HttpRequestMessage(httpMethod, route); + var content = new + { + data = new + { + type = "todo-items", + relationships = new Dictionary + { + { "owner", new { + data = new + { + type = "people", + id = owner.Id.ToString() + } + } } + } + } + }; + + request.Content = new StringContent(JsonConvert.SerializeObject(content)); + request.Content.Headers.ContentType = new MediaTypeHeaderValue("application/vnd.api+json"); + + // act + var response = await client.SendAsync(request); + var body = await response.Content.ReadAsStringAsync(); + + // assert + Assert.Equal(HttpStatusCode.Created, response.StatusCode); + var deserializedBody = (TodoItem)_fixture.GetService().Deserialize(body); + var newId = deserializedBody.Id; + + context = _fixture.GetService(); + var todoItemResult = context.TodoItems + .Include(c => c.Owner) + .SingleOrDefault(c => c.Id == newId); + + Assert.Equal(owner.Id, todoItemResult.OwnerId); + } + [Fact] public async Task ShouldReceiveLocationHeader_InResponse() { diff --git a/test/JsonApiDotNetCoreExampleTests/Acceptance/Spec/DeletingDataTests.cs b/test/JsonApiDotNetCoreExampleTests/Acceptance/Spec/DeletingDataTests.cs index 8ddb9a56a1..8c506f4a33 100644 --- a/test/JsonApiDotNetCoreExampleTests/Acceptance/Spec/DeletingDataTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/Acceptance/Spec/DeletingDataTests.cs @@ -1,4 +1,4 @@ -using System.Linq; +using System.Linq; using System.Net; using System.Net.Http; using System.Threading.Tasks; @@ -15,11 +15,11 @@ namespace JsonApiDotNetCoreExampleTests.Acceptance.Spec [Collection("WebHostCollection")] public class DeletingDataTests { - private TestFixture _fixture; + private TestFixture _fixture; private AppDbContext _context; private Faker _todoItemFaker; - public DeletingDataTests(TestFixture fixture) + public DeletingDataTests(TestFixture fixture) { _fixture = fixture; _context = fixture.GetService(); @@ -40,7 +40,7 @@ public async Task Respond_404_If_EntityDoesNotExist() var server = new TestServer(builder); var client = server.CreateClient(); - + var httpMethod = new HttpMethod("DELETE"); var route = $"/api/v1/todo-items/{maxPersonId + 100}"; var request = new HttpRequestMessage(httpMethod, route); diff --git a/test/JsonApiDotNetCoreExampleTests/Acceptance/Spec/DocumentTests/Included.cs b/test/JsonApiDotNetCoreExampleTests/Acceptance/Spec/DocumentTests/Included.cs index 6ca456d680..cfe842616b 100644 --- a/test/JsonApiDotNetCoreExampleTests/Acceptance/Spec/DocumentTests/Included.cs +++ b/test/JsonApiDotNetCoreExampleTests/Acceptance/Spec/DocumentTests/Included.cs @@ -1,4 +1,4 @@ -using System.Linq; +using System.Linq; using System.Net; using System.Net.Http; using System.Threading.Tasks; @@ -18,13 +18,13 @@ namespace JsonApiDotNetCoreExampleTests.Acceptance.Spec.DocumentTests [Collection("WebHostCollection")] public class Included { - private TestFixture _fixture; + private TestFixture _fixture; private AppDbContext _context; private Bogus.Faker _personFaker; private Faker _todoItemFaker; private Faker _todoItemCollectionFaker; - public Included(TestFixture fixture) + public Included(TestFixture fixture) { _fixture = fixture; _context = fixture.GetService(); @@ -45,8 +45,14 @@ public Included(TestFixture fixture) public async Task GET_Included_Contains_SideloadedData_ForManyToOne() { // arrange - var builder = new WebHostBuilder() - .UseStartup(); + var person = _personFaker.Generate(); + var todoItem = _todoItemFaker.Generate(); + todoItem.Owner = person; + _context.TodoItems.RemoveRange(_context.TodoItems); + _context.TodoItems.Add(todoItem); + _context.SaveChanges(); + + var builder = new WebHostBuilder().UseStartup(); var httpMethod = new HttpMethod("GET"); var route = $"/api/v1/todo-items?include=owner"; @@ -57,13 +63,16 @@ public async Task GET_Included_Contains_SideloadedData_ForManyToOne() // act var response = await client.SendAsync(request); - var documents = JsonConvert.DeserializeObject(await response.Content.ReadAsStringAsync()); - var data = documents.Data[0]; // assert + var json = await response.Content.ReadAsStringAsync(); + var documents = JsonConvert.DeserializeObject(json); + // we only care about counting the todo-items that have owners + var expectedCount = documents.Data.Count(d => d.Relationships["owner"].SingleData != null); + Assert.Equal(HttpStatusCode.OK, response.StatusCode); Assert.NotEmpty(documents.Included); - Assert.Equal(documents.Data.Count, documents.Included.Count); + Assert.Equal(expectedCount, documents.Included.Count); } [Fact] @@ -164,7 +173,7 @@ public async Task GET_Included_DoesNot_Duplicate_Records_ForMultipleRelationship // assert Assert.Equal(HttpStatusCode.OK, response.StatusCode); Assert.NotEmpty(documents.Included); - Assert.Equal(1, documents.Included.Count); + Assert.Single(documents.Included); } [Fact] @@ -199,7 +208,7 @@ public async Task GET_Included_DoesNot_Duplicate_Records_If_HasOne_Exists_Twice( // assert Assert.Equal(HttpStatusCode.OK, response.StatusCode); Assert.NotEmpty(documents.Included); - Assert.Equal(1, documents.Included.Count); + Assert.Single(documents.Included); } [Fact] @@ -325,5 +334,29 @@ public async Task Request_ToIncludeDeeplyNestedRelationships_Returns_400() // assert Assert.Equal(HttpStatusCode.BadRequest, response.StatusCode); } + + [Fact] + public async Task Request_ToIncludeRelationshipMarkedCanIncludeFalse_Returns_400() + { + // arrange + var person = _context.People.First(); + + var builder = new WebHostBuilder() + .UseStartup(); + + var httpMethod = new HttpMethod("GET"); + + var route = $"/api/v1/people/{person.Id}?include=unincludeable-item"; + + var server = new TestServer(builder); + var client = server.CreateClient(); + var request = new HttpRequestMessage(httpMethod, route); + + // act + var response = await client.SendAsync(request); + + // assert + Assert.Equal(HttpStatusCode.BadRequest, response.StatusCode); + } } } diff --git a/test/JsonApiDotNetCoreExampleTests/Acceptance/Spec/DocumentTests/Meta.cs b/test/JsonApiDotNetCoreExampleTests/Acceptance/Spec/DocumentTests/Meta.cs index 5316753245..2b6b1e251b 100644 --- a/test/JsonApiDotNetCoreExampleTests/Acceptance/Spec/DocumentTests/Meta.cs +++ b/test/JsonApiDotNetCoreExampleTests/Acceptance/Spec/DocumentTests/Meta.cs @@ -1,6 +1,7 @@ using System.Collections; using System.Net; using System.Net.Http; +using System.Net.Http.Headers; using System.Threading.Tasks; using JsonApiDotNetCore.Models; using JsonApiDotNetCoreExample; @@ -17,9 +18,9 @@ namespace JsonApiDotNetCoreExampleTests.Acceptance.Spec.DocumentTests [Collection("WebHostCollection")] public class Meta { - private TestFixture _fixture; + private TestFixture _fixture; private AppDbContext _context; - public Meta(TestFixture fixture) + public Meta(TestFixture fixture) { _fixture = fixture; _context = fixture.GetService(); @@ -47,13 +48,123 @@ public async Task Total_Record_Count_Included() var response = await client.SendAsync(request); var responseBody = await response.Content.ReadAsStringAsync(); var documents = JsonConvert.DeserializeObject(responseBody); - + // assert Assert.Equal(HttpStatusCode.OK, response.StatusCode); Assert.NotNull(documents.Meta); Assert.Equal((long)expectedCount, (long)documents.Meta["total-records"]); } + [Fact] + public async Task Total_Record_Count_Included_When_None() + { + // arrange + _context.TodoItems.RemoveRange(_context.TodoItems); + _context.SaveChanges(); + var builder = new WebHostBuilder() + .UseStartup(); + + var httpMethod = new HttpMethod("GET"); + var route = $"/api/v1/todo-items"; + + var server = new TestServer(builder); + var client = server.CreateClient(); + var request = new HttpRequestMessage(httpMethod, route); + + // act + var response = await client.SendAsync(request); + var responseBody = await response.Content.ReadAsStringAsync(); + var documents = JsonConvert.DeserializeObject(responseBody); + + // assert + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + Assert.NotNull(documents.Meta); + Assert.Equal(0, (long)documents.Meta["total-records"]); + } + + [Fact] + public async Task Total_Record_Count_Not_Included_In_POST_Response() + { + // arrange + _context.TodoItems.RemoveRange(_context.TodoItems); + _context.SaveChanges(); + var builder = new WebHostBuilder() + .UseStartup(); + + var httpMethod = new HttpMethod("POST"); + var route = $"/api/v1/todo-items"; + + var server = new TestServer(builder); + var client = server.CreateClient(); + var request = new HttpRequestMessage(httpMethod, route); + var content = new + { + data = new + { + type = "todo-items", + attributes = new + { + description = "New Description", + } + } + }; + + request.Content = new StringContent(JsonConvert.SerializeObject(content)); + request.Content.Headers.ContentType = new MediaTypeHeaderValue("application/vnd.api+json"); + + // act + var response = await client.SendAsync(request); + var responseBody = await response.Content.ReadAsStringAsync(); + var documents = JsonConvert.DeserializeObject(responseBody); + + // assert + Assert.Equal(HttpStatusCode.Created, response.StatusCode); + Assert.False(documents.Meta.ContainsKey("total-records")); + } + + [Fact] + public async Task Total_Record_Count_Not_Included_In_PATCH_Response() + { + // arrange + _context.TodoItems.RemoveRange(_context.TodoItems); + TodoItem todoItem = new TodoItem(); + _context.TodoItems.Add(todoItem); + _context.SaveChanges(); + var builder = new WebHostBuilder() + .UseStartup(); + + var httpMethod = new HttpMethod("PATCH"); + var route = $"/api/v1/todo-items/{todoItem.Id}"; + + var server = new TestServer(builder); + var client = server.CreateClient(); + var request = new HttpRequestMessage(httpMethod, route); + var content = new + { + data = new + { + type = "todo-items", + id = todoItem.Id, + attributes = new + { + description = "New Description", + } + } + }; + + request.Content = new StringContent(JsonConvert.SerializeObject(content)); + request.Content.Headers.ContentType = new MediaTypeHeaderValue("application/vnd.api+json"); + + // act + var response = await client.SendAsync(request); + var responseBody = await response.Content.ReadAsStringAsync(); + var documents = JsonConvert.DeserializeObject(responseBody); + + // assert + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + Assert.False(documents.Meta.ContainsKey("total-records")); + } + [Fact] public async Task EntityThatImplements_IHasMeta_Contains_MetaData() { @@ -73,26 +184,26 @@ public async Task EntityThatImplements_IHasMeta_Contains_MetaData() // act var response = await client.SendAsync(request); var documents = JsonConvert.DeserializeObject(await response.Content.ReadAsStringAsync()); - + // assert Assert.Equal(HttpStatusCode.OK, response.StatusCode); Assert.NotNull(documents.Meta); Assert.NotNull(expectedMeta); Assert.NotEmpty(expectedMeta); - - foreach(var hash in expectedMeta) + + foreach (var hash in expectedMeta) { - if(hash.Value is IList) + if (hash.Value is IList) { var listValue = (IList)hash.Value; - for(var i=0; i < listValue.Count; i++) + for (var i = 0; i < listValue.Count; i++) Assert.Equal(listValue[i].ToString(), ((IList)documents.Meta[hash.Key])[i].ToString()); } else { Assert.Equal(hash.Value, documents.Meta[hash.Key]); } - } + } } } } diff --git a/test/JsonApiDotNetCoreExampleTests/Acceptance/Spec/DocumentTests/PagingTests.cs b/test/JsonApiDotNetCoreExampleTests/Acceptance/Spec/DocumentTests/PagingTests.cs index 0aa4ede88b..e50032fce1 100644 --- a/test/JsonApiDotNetCoreExampleTests/Acceptance/Spec/DocumentTests/PagingTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/Acceptance/Spec/DocumentTests/PagingTests.cs @@ -1,4 +1,4 @@ -using System.Net; +using System.Net; using System.Net.Http; using System.Threading.Tasks; using JsonApiDotNetCoreExample; @@ -6,7 +6,6 @@ using Microsoft.AspNetCore.TestHost; using Newtonsoft.Json; using Xunit; -using Person = JsonApiDotNetCoreExample.Models.Person; using JsonApiDotNetCore.Models; using JsonApiDotNetCoreExample.Data; using Bogus; @@ -18,27 +17,16 @@ namespace JsonApiDotNetCoreExampleTests.Acceptance.Spec.DocumentTests [Collection("WebHostCollection")] public class PagingTests { - private TestFixture _fixture; - private AppDbContext _context; - private Faker _personFaker; - private Faker _todoItemFaker; - private Faker _todoItemCollectionFaker; + private readonly AppDbContext _context; + private readonly Faker _todoItemFaker; - public PagingTests(TestFixture fixture) + public PagingTests(TestFixture fixture) { - _fixture = fixture; _context = fixture.GetService(); - _personFaker = new Faker() - .RuleFor(p => p.FirstName, f => f.Name.FirstName()) - .RuleFor(p => p.LastName, f => f.Name.LastName()); - _todoItemFaker = new Faker() .RuleFor(t => t.Description, f => f.Lorem.Sentence()) .RuleFor(t => t.Ordinal, f => f.Random.Number()) .RuleFor(t => t.CreatedDate, f => f.Date.Past()); - - _todoItemCollectionFaker = new Faker() - .RuleFor(t => t.Name, f => f.Company.CatchPhrase()); } [Fact] diff --git a/test/JsonApiDotNetCoreExampleTests/Acceptance/Spec/DocumentTests/Relationships.cs b/test/JsonApiDotNetCoreExampleTests/Acceptance/Spec/DocumentTests/Relationships.cs index 5c0018354d..6c4bf56839 100644 --- a/test/JsonApiDotNetCoreExampleTests/Acceptance/Spec/DocumentTests/Relationships.cs +++ b/test/JsonApiDotNetCoreExampleTests/Acceptance/Spec/DocumentTests/Relationships.cs @@ -17,11 +17,11 @@ namespace JsonApiDotNetCoreExampleTests.Acceptance.Spec.DocumentTests [Collection("WebHostCollection")] public class Relationships { - private TestFixture _fixture; + private TestFixture _fixture; private AppDbContext _context; private Faker _todoItemFaker; - public Relationships(TestFixture fixture) + public Relationships(TestFixture fixture) { _fixture = fixture; _context = fixture.GetService(); diff --git a/test/JsonApiDotNetCoreExampleTests/Acceptance/Spec/FetchingDataTests.cs b/test/JsonApiDotNetCoreExampleTests/Acceptance/Spec/FetchingDataTests.cs index 208ec2f72d..9c8d5f8214 100644 --- a/test/JsonApiDotNetCoreExampleTests/Acceptance/Spec/FetchingDataTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/Acceptance/Spec/FetchingDataTests.cs @@ -20,12 +20,12 @@ namespace JsonApiDotNetCoreExampleTests.Acceptance.Spec [Collection("WebHostCollection")] public class FetchingDataTests { - private TestFixture _fixture; + private TestFixture _fixture; private IJsonApiContext _jsonApiContext; private Faker _todoItemFaker; private Faker _personFaker; - public FetchingDataTests(TestFixture fixture) + public FetchingDataTests(TestFixture fixture) { _fixture = fixture; _jsonApiContext = fixture.GetService(); @@ -53,8 +53,10 @@ public async Task Request_ForEmptyCollection_Returns_EmptyDataCollection() var server = new TestServer(builder); var client = server.CreateClient(); var request = new HttpRequestMessage(httpMethod, route); - var expectedBody = JsonConvert.SerializeObject(new { - data = new List() + var expectedBody = JsonConvert.SerializeObject(new + { + data = new List(), + meta = new Dictionary { { "total-records", 0 } } }); // act diff --git a/test/JsonApiDotNetCoreExampleTests/Acceptance/Spec/FetchingRelationshipsTests.cs b/test/JsonApiDotNetCoreExampleTests/Acceptance/Spec/FetchingRelationshipsTests.cs index 51356222ba..9c9ea29ccb 100644 --- a/test/JsonApiDotNetCoreExampleTests/Acceptance/Spec/FetchingRelationshipsTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/Acceptance/Spec/FetchingRelationshipsTests.cs @@ -1,5 +1,4 @@ -using System.Linq; -using System.Net; +using System.Net; using System.Net.Http; using System.Threading.Tasks; using Bogus; @@ -16,11 +15,11 @@ namespace JsonApiDotNetCoreExampleTests.Acceptance.Spec [Collection("WebHostCollection")] public class FetchingRelationshipsTests { - private TestFixture _fixture; + private TestFixture _fixture; private IJsonApiContext _jsonApiContext; private Faker _todoItemFaker; - public FetchingRelationshipsTests(TestFixture fixture) + public FetchingRelationshipsTests(TestFixture fixture) { _fixture = fixture; _jsonApiContext = fixture.GetService(); @@ -66,7 +65,11 @@ public async Task Request_ForRelationshipLink_ThatDoesNotExist_Returns_404() { // arrange var context = _fixture.GetService(); - var todoItem = context.TodoItems.First(); + + var todoItem = _todoItemFaker.Generate(); + context.TodoItems.Add(todoItem); + await context.SaveChangesAsync(); + var todoItemId = todoItem.Id; context.TodoItems.Remove(todoItem); await context.SaveChangesAsync(); diff --git a/test/JsonApiDotNetCoreExampleTests/Acceptance/Spec/PagingTests.cs b/test/JsonApiDotNetCoreExampleTests/Acceptance/Spec/PagingTests.cs new file mode 100644 index 0000000000..0667b51756 --- /dev/null +++ b/test/JsonApiDotNetCoreExampleTests/Acceptance/Spec/PagingTests.cs @@ -0,0 +1,121 @@ +using System.Collections.Generic; +using System.Linq; +using System.Net; +using System.Threading.Tasks; +using Bogus; +using JsonApiDotNetCore.Models; +using JsonApiDotNetCore.Serialization; +using JsonApiDotNetCoreExample.Models; +using Xunit; +using Person = JsonApiDotNetCoreExample.Models.Person; + +namespace JsonApiDotNetCoreExampleTests.Acceptance.Spec +{ + public class PagingTests : TestFixture + { + private readonly Faker _todoItemFaker = new Faker() + .RuleFor(t => t.Description, f => f.Lorem.Sentence()) + .RuleFor(t => t.Ordinal, f => f.Random.Number()) + .RuleFor(t => t.CreatedDate, f => f.Date.Past()); + + [Fact] + public async Task Can_Paginate_TodoItems() + { + // Arrange + const int expectedEntitiesPerPage = 2; + var totalCount = expectedEntitiesPerPage * 2; + var person = new Person(); + var todoItems = _todoItemFaker.Generate(totalCount); + + foreach (var todoItem in todoItems) + todoItem.Owner = person; + + Context.TodoItems.AddRange(todoItems); + Context.SaveChanges(); + + var route = $"/api/v1/todo-items?page[size]={expectedEntitiesPerPage}"; + + // Act + var response = await Client.GetAsync(route); + + // Assert + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + + var body = await response.Content.ReadAsStringAsync(); + var deserializedBody = GetService().DeserializeList(body); + + Assert.NotEmpty(deserializedBody); + Assert.Equal(expectedEntitiesPerPage, deserializedBody.Count); + } + + [Fact] + public async Task Can_Paginate_TodoItems_From_Start() + { + // Arrange + const int expectedEntitiesPerPage = 2; + var totalCount = expectedEntitiesPerPage * 2; + var person = new Person(); + var todoItems = _todoItemFaker.Generate(totalCount).ToList(); + + foreach (var todoItem in todoItems) + todoItem.Owner = person; + + Context.TodoItems.RemoveRange(Context.TodoItems); + Context.TodoItems.AddRange(todoItems); + Context.SaveChanges(); + + var route = $"/api/v1/todo-items?page[size]={expectedEntitiesPerPage}&page[number]=1"; + + // Act + var response = await Client.GetAsync(route); + + // Assert + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + + var body = await response.Content.ReadAsStringAsync(); + var deserializedBody = GetService().DeserializeList(body); + + var expectedTodoItems = new[] { todoItems[0], todoItems[1] }; + Assert.Equal(expectedTodoItems, deserializedBody, new IdComparer()); + } + + [Fact] + public async Task Can_Paginate_TodoItems_From_End() + { + // Arrange + const int expectedEntitiesPerPage = 2; + var totalCount = expectedEntitiesPerPage * 2; + var person = new Person(); + var todoItems = _todoItemFaker.Generate(totalCount).ToList(); + + foreach (var todoItem in todoItems) + todoItem.Owner = person; + + Context.TodoItems.RemoveRange(Context.TodoItems); + Context.TodoItems.AddRange(todoItems); + Context.SaveChanges(); + + var route = $"/api/v1/todo-items?page[size]={expectedEntitiesPerPage}&page[number]=-1"; + + // Act + var response = await Client.GetAsync(route); + + // Assert + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + + var body = await response.Content.ReadAsStringAsync(); + var deserializedBody = GetService().DeserializeList(body); + + var expectedTodoItems = new[] { todoItems[totalCount - 2], todoItems[totalCount - 1] }; + Assert.Equal(expectedTodoItems, deserializedBody, new IdComparer()); + } + + private class IdComparer : IEqualityComparer + where T : IIdentifiable + { + public bool Equals(T x, T y) => x?.StringId == y?.StringId; + + public int GetHashCode(T obj) => obj?.StringId?.GetHashCode() ?? 0; + } + } +} diff --git a/test/JsonApiDotNetCoreExampleTests/Acceptance/Spec/QueryParameters.cs b/test/JsonApiDotNetCoreExampleTests/Acceptance/Spec/QueryParameters.cs index c5a02cb6b7..58b2323da5 100644 --- a/test/JsonApiDotNetCoreExampleTests/Acceptance/Spec/QueryParameters.cs +++ b/test/JsonApiDotNetCoreExampleTests/Acceptance/Spec/QueryParameters.cs @@ -13,8 +13,8 @@ namespace JsonApiDotNetCoreExampleTests.Acceptance.Spec [Collection("WebHostCollection")] public class QueryParameters { - private TestFixture _fixture; - public QueryParameters(TestFixture fixture) + private TestFixture _fixture; + public QueryParameters(TestFixture fixture) { _fixture = fixture; } @@ -39,7 +39,7 @@ public async Task Server_Returns_400_ForUnknownQueryParam() // assert Assert.Equal(HttpStatusCode.BadRequest, response.StatusCode); - Assert.Equal(1, body.Errors.Count); + Assert.Single(body.Errors); Assert.Equal($"[{queryKey}, {queryValue}] is not a valid query.", body.Errors[0].Title); } } diff --git a/test/JsonApiDotNetCoreExampleTests/Acceptance/Spec/SparseFieldSetTests.cs b/test/JsonApiDotNetCoreExampleTests/Acceptance/Spec/SparseFieldSetTests.cs index 8c5c6b5249..7286a94fc5 100644 --- a/test/JsonApiDotNetCoreExampleTests/Acceptance/Spec/SparseFieldSetTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/Acceptance/Spec/SparseFieldSetTests.cs @@ -21,10 +21,10 @@ namespace JsonApiDotNetCoreExampleTests.Acceptance.Spec [Collection("WebHostCollection")] public class SparseFieldSetTests { - private TestFixture _fixture; + private TestFixture _fixture; private readonly AppDbContext _dbContext; - public SparseFieldSetTests(TestFixture fixture) + public SparseFieldSetTests(TestFixture fixture) { _fixture = fixture; _dbContext = fixture.GetService(); diff --git a/test/JsonApiDotNetCoreExampleTests/Acceptance/Spec/UpdatingDataTests.cs b/test/JsonApiDotNetCoreExampleTests/Acceptance/Spec/UpdatingDataTests.cs index d39f69a855..3edb8fa901 100644 --- a/test/JsonApiDotNetCoreExampleTests/Acceptance/Spec/UpdatingDataTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/Acceptance/Spec/UpdatingDataTests.cs @@ -1,10 +1,12 @@ using System; +using System.Collections.Generic; using System.Linq; using System.Net; using System.Net.Http; using System.Net.Http.Headers; using System.Threading.Tasks; using Bogus; +using JsonApiDotNetCore.Models; using JsonApiDotNetCoreExample; using JsonApiDotNetCoreExample.Data; using JsonApiDotNetCoreExample.Models; @@ -20,12 +22,12 @@ namespace JsonApiDotNetCoreExampleTests.Acceptance.Spec [Collection("WebHostCollection")] public class UpdatingDataTests { - private TestFixture _fixture; + private TestFixture _fixture; private AppDbContext _context; private Faker _todoItemFaker; private Faker _personFaker; - public UpdatingDataTests(TestFixture fixture) + public UpdatingDataTests(TestFixture fixture) { _fixture = fixture; _context = fixture.GetService(); @@ -49,7 +51,7 @@ public async Task Respond_404_If_EntityDoesNotExist() var server = new TestServer(builder); var client = server.CreateClient(); - + var content = new { data = new @@ -78,6 +80,124 @@ public async Task Respond_404_If_EntityDoesNotExist() Assert.Equal(HttpStatusCode.NotFound, response.StatusCode); } + + [Fact] + public async Task Can_Patch_Entity() + { + // arrange + var todoItem = _todoItemFaker.Generate(); + var person = _personFaker.Generate(); + todoItem.Owner = person; + _context.TodoItems.Add(todoItem); + _context.SaveChanges(); + + var newTodoItem = _todoItemFaker.Generate(); + + var builder = new WebHostBuilder().UseStartup(); + var server = new TestServer(builder); + var client = server.CreateClient(); + + var content = new + { + data = new + { + type = "todo-items", + attributes = new + { + description = newTodoItem.Description, + ordinal = newTodoItem.Ordinal + } + } + }; + + var httpMethod = new HttpMethod("PATCH"); + var route = $"/api/v1/todo-items/{todoItem.Id}"; + var request = new HttpRequestMessage(httpMethod, route); + + request.Content = new StringContent(JsonConvert.SerializeObject(content)); + request.Content.Headers.ContentType = new MediaTypeHeaderValue("application/vnd.api+json"); + + // Act + var response = await client.SendAsync(request); + + // Assert -- response + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + var body = await response.Content.ReadAsStringAsync(); + var document = JsonConvert.DeserializeObject(body); + Assert.NotNull(document); + Assert.NotNull(document.Data); + Assert.NotNull(document.Data.Attributes); + Assert.Equal(newTodoItem.Description, document.Data.Attributes["description"]); + Assert.Equal(newTodoItem.Ordinal, (long)document.Data.Attributes["ordinal"]); + Assert.True(document.Data.Relationships.ContainsKey("owner")); + Assert.NotNull(document.Data.Relationships["owner"].SingleData); + Assert.Equal(person.Id.ToString(), document.Data.Relationships["owner"].SingleData.Id); + Assert.Equal("people", document.Data.Relationships["owner"].SingleData.Type); + + // Assert -- database + var updatedTodoItem = _context.TodoItems.AsNoTracking() + .Include(t => t.Owner) + .SingleOrDefault(t => t.Id == todoItem.Id); + + Assert.Equal(person.Id, updatedTodoItem.OwnerId); + Assert.Equal(newTodoItem.Description, updatedTodoItem.Description); + Assert.Equal(newTodoItem.Ordinal, updatedTodoItem.Ordinal); + } + + [Fact] + public async Task Patch_Entity_With_HasMany_Does_Not_Included_Relationships() + { + // arrange + var todoItem = _todoItemFaker.Generate(); + var person = _personFaker.Generate(); + todoItem.Owner = person; + _context.TodoItems.Add(todoItem); + _context.SaveChanges(); + + var newPerson = _personFaker.Generate(); + + var builder = new WebHostBuilder().UseStartup(); + var server = new TestServer(builder); + var client = server.CreateClient(); + + var content = new + { + data = new + { + type = "people", + attributes = new Dictionary + { + { "last-name", newPerson.LastName }, + { "first-name", newPerson.FirstName}, + } + } + }; + + var httpMethod = new HttpMethod("PATCH"); + var route = $"/api/v1/people/{person.Id}"; + var request = new HttpRequestMessage(httpMethod, route); + + request.Content = new StringContent(JsonConvert.SerializeObject(content)); + request.Content.Headers.ContentType = new MediaTypeHeaderValue("application/vnd.api+json"); + + // Act + var response = await client.SendAsync(request); + + // Assert -- response + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + var body = await response.Content.ReadAsStringAsync(); + var document = JsonConvert.DeserializeObject(body); + Console.WriteLine(body); + Assert.NotNull(document); + Assert.NotNull(document.Data); + Assert.NotNull(document.Data.Attributes); + Assert.Equal(newPerson.LastName, document.Data.Attributes["last-name"]); + Assert.Equal(newPerson.FirstName, document.Data.Attributes["first-name"]); + Assert.True(document.Data.Relationships.ContainsKey("todo-items")); + Assert.Null(document.Data.Relationships["todo-items"].ManyData); + Assert.Null(document.Data.Relationships["todo-items"].SingleData); + } + [Fact] public async Task Can_Patch_Entity_And_HasOne_Relationships() { @@ -92,7 +212,7 @@ public async Task Can_Patch_Entity_And_HasOne_Relationships() .UseStartup(); var server = new TestServer(builder); var client = server.CreateClient(); - + var content = new { data = new diff --git a/test/JsonApiDotNetCoreExampleTests/Acceptance/Spec/UpdatingRelationshipsTests.cs b/test/JsonApiDotNetCoreExampleTests/Acceptance/Spec/UpdatingRelationshipsTests.cs index d17a10c1d7..067483a1b3 100644 --- a/test/JsonApiDotNetCoreExampleTests/Acceptance/Spec/UpdatingRelationshipsTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/Acceptance/Spec/UpdatingRelationshipsTests.cs @@ -20,12 +20,12 @@ namespace JsonApiDotNetCoreExampleTests.Acceptance.Spec [Collection("WebHostCollection")] public class UpdatingRelationshipsTests { - private TestFixture _fixture; + private TestFixture _fixture; private AppDbContext _context; private Bogus.Faker _personFaker; private Faker _todoItemFaker; - public UpdatingRelationshipsTests(TestFixture fixture) + public UpdatingRelationshipsTests(TestFixture fixture) { _fixture = fixture; _context = fixture.GetService(); @@ -77,6 +77,7 @@ public async Task Can_Update_ToMany_Relationship_ThroughLink() // Act var response = await client.SendAsync(request); + _context = _fixture.GetService(); var personsTodoItems = _context.People.Include(p => p.TodoItems).Single(p => p.Id == person.Id).TodoItems; // Assert @@ -126,5 +127,100 @@ public async Task Can_Update_ToOne_Relationship_ThroughLink() Assert.Equal(HttpStatusCode.OK, response.StatusCode); Assert.NotNull(todoItemsOwner); } + + [Fact] + public async Task Can_Delete_Relationship_By_Patching_Resource() + { + // arrange + var person = _personFaker.Generate(); + var todoItem = _todoItemFaker.Generate(); + todoItem.Owner = person; + + _context.People.Add(person); + _context.TodoItems.Add(todoItem); + _context.SaveChanges(); + + var builder = new WebHostBuilder() + .UseStartup(); + + var server = new TestServer(builder); + var client = server.CreateClient(); + + var content = new + { + data = new + { + type = "todo-items", + relationships = new + { + owner = new + { + data = (object)null + } + } + } + }; + + var httpMethod = new HttpMethod("PATCH"); + var route = $"/api/v1/todo-items/{todoItem.Id}"; + var request = new HttpRequestMessage(httpMethod, route); + request.Content = new StringContent(JsonConvert.SerializeObject(content)); + request.Content.Headers.ContentType = new MediaTypeHeaderValue("application/vnd.api+json"); + + // Act + var response = await client.SendAsync(request); + + // Assert + var todoItemResult = _context.TodoItems + .AsNoTracking() + .Include(t => t.Owner) + .Single(t => t.Id == todoItem.Id); + + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + Assert.Null(todoItemResult.Owner); + } + + [Fact] + public async Task Can_Delete_Relationship_By_Patching_Relationship() + { + // arrange + var person = _personFaker.Generate(); + var todoItem = _todoItemFaker.Generate(); + todoItem.Owner = person; + + _context.People.Add(person); + _context.TodoItems.Add(todoItem); + _context.SaveChanges(); + + var builder = new WebHostBuilder() + .UseStartup(); + + var server = new TestServer(builder); + var client = server.CreateClient(); + + var content = new + { + data = (object)null + }; + + var httpMethod = new HttpMethod("PATCH"); + var route = $"/api/v1/todo-items/{todoItem.Id}/relationships/owner"; + var request = new HttpRequestMessage(httpMethod, route); + + request.Content = new StringContent(JsonConvert.SerializeObject(content)); + request.Content.Headers.ContentType = new MediaTypeHeaderValue("application/vnd.api+json"); + + // Act + var response = await client.SendAsync(request); + + // Assert + var todoItemResult = _context.TodoItems + .AsNoTracking() + .Include(t => t.Owner) + .Single(t => t.Id == todoItem.Id); + + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + Assert.Null(todoItemResult.Owner); + } } } diff --git a/test/JsonApiDotNetCoreExampleTests/TestFixture.cs b/test/JsonApiDotNetCoreExampleTests/Acceptance/TestFixture.cs similarity index 56% rename from test/JsonApiDotNetCoreExampleTests/TestFixture.cs rename to test/JsonApiDotNetCoreExampleTests/Acceptance/TestFixture.cs index 424163f956..ce70fced84 100644 --- a/test/JsonApiDotNetCoreExampleTests/TestFixture.cs +++ b/test/JsonApiDotNetCoreExampleTests/Acceptance/TestFixture.cs @@ -1,12 +1,15 @@ -using System; +using System; using System.Net.Http; +using JsonApiDotNetCore.Serialization; +using JsonApiDotNetCoreExample.Data; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.TestHost; +using JsonApiDotNetCore.Services; +using JsonApiDotNetCore.Data; -namespace JsonApiDotNetCoreExampleTests +namespace JsonApiDotNetCoreExampleTests.Acceptance { - public class TestFixture : IDisposable - where TStartup : class + public class TestFixture : IDisposable where TStartup : class { private readonly TestServer _server; private IServiceProvider _services; @@ -18,15 +21,18 @@ public TestFixture() _server = new TestServer(builder); _services = _server.Host.Services; + Client = _server.CreateClient(); + Context = GetService().GetContext() as AppDbContext; + DeSerializer = GetService(); + JsonApiContext = GetService(); } public HttpClient Client { get; set; } - - public T GetService() - { - return (T)_services.GetService(typeof(T)); - } + public AppDbContext Context { get; private set; } + public IJsonApiDeSerializer DeSerializer { get; private set; } + public IJsonApiContext JsonApiContext { get; private set; } + public T GetService() => (T)_services.GetService(typeof(T)); private bool disposedValue = false; protected virtual void Dispose(bool disposing) diff --git a/test/JsonApiDotNetCoreExampleTests/Acceptance/TodoItemsControllerTests.cs b/test/JsonApiDotNetCoreExampleTests/Acceptance/TodoItemsControllerTests.cs index da1e3f0804..0600fb402b 100644 --- a/test/JsonApiDotNetCoreExampleTests/Acceptance/TodoItemsControllerTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/Acceptance/TodoItemsControllerTests.cs @@ -1,15 +1,16 @@ -using System.Collections.Generic; +using System.Collections.Generic; using System.Linq; using System.Net; using System.Net.Http; using System.Net.Http.Headers; using System.Threading.Tasks; using Bogus; +using JsonApiDotNetCore.Models; using JsonApiDotNetCore.Serialization; using JsonApiDotNetCore.Services; -using JsonApiDotNetCoreExample; using JsonApiDotNetCoreExample.Data; using JsonApiDotNetCoreExample.Models; +using Microsoft.EntityFrameworkCore; using Newtonsoft.Json; using Xunit; using Person = JsonApiDotNetCoreExample.Models.Person; @@ -19,12 +20,12 @@ namespace JsonApiDotNetCoreExampleTests.Acceptance [Collection("WebHostCollection")] public class TodoItemControllerTests { - private TestFixture _fixture; + private TestFixture _fixture; private AppDbContext _context; private IJsonApiContext _jsonApiContext; private Faker _todoItemFaker; - public TodoItemControllerTests(TestFixture fixture) + public TodoItemControllerTests(TestFixture fixture) { _fixture = fixture; _context = fixture.GetService(); @@ -61,32 +62,6 @@ public async Task Can_Get_TodoItems() Assert.True(deserializedBody.Count <= expectedEntitiesPerPage); } - [Fact] - public async Task Can_Paginate_TodoItems() - { - // Arrange - const int expectedEntitiesPerPage = 2; - var person = new Person(); - var todoItem = _todoItemFaker.Generate(); - todoItem.Owner = person; - _context.TodoItems.Add(todoItem); - _context.SaveChanges(); - - var httpMethod = new HttpMethod("GET"); - var route = $"/api/v1/todo-items?page[size]={expectedEntitiesPerPage}"; - var request = new HttpRequestMessage(httpMethod, route); - - // Act - var response = await _fixture.Client.SendAsync(request); - var body = await response.Content.ReadAsStringAsync(); - var deserializedBody = _fixture.GetService().DeserializeList(body); - - // Assert - Assert.Equal(HttpStatusCode.OK, response.StatusCode); - Assert.NotEmpty(deserializedBody); - Assert.True(deserializedBody.Count <= expectedEntitiesPerPage); - } - [Fact] public async Task Can_Filter_TodoItems() { @@ -101,7 +76,7 @@ public async Task Can_Filter_TodoItems() var httpMethod = new HttpMethod("GET"); var route = $"/api/v1/todo-items?filter[ordinal]={todoItem.Ordinal}"; var request = new HttpRequestMessage(httpMethod, route); - + // Act var response = await _fixture.Client.SendAsync(request); var body = await response.Content.ReadAsStringAsync(); @@ -178,7 +153,7 @@ public async Task Can_Sort_TodoItems_By_Ordinal_Ascending() { Assert.True(todoItemResult.Ordinal > priorOrdinal); priorOrdinal = todoItemResult.Ordinal; - } + } } [Fact] @@ -217,7 +192,7 @@ public async Task Can_Sort_TodoItems_By_Ordinal_Descending() { Assert.True(todoItemResult.Ordinal < priorOrdinal); priorOrdinal = todoItemResult.Ordinal; - } + } } [Fact] @@ -245,7 +220,7 @@ public async Task Can_Get_TodoItem_ById() Assert.Equal(todoItem.Description, deserializedBody.Description); Assert.Equal(todoItem.Ordinal, deserializedBody.Ordinal); Assert.Equal(todoItem.CreatedDate.ToString("G"), deserializedBody.CreatedDate.ToString("G")); - Assert.Equal(null, deserializedBody.AchievedDate); + Assert.Null(deserializedBody.AchievedDate); } [Fact] @@ -274,7 +249,7 @@ public async Task Can_Get_TodoItem_WithOwner() Assert.Equal(todoItem.Description, deserializedBody.Description); Assert.Equal(todoItem.Ordinal, deserializedBody.Ordinal); Assert.Equal(todoItem.CreatedDate.ToString("G"), deserializedBody.CreatedDate.ToString("G")); - Assert.Equal(null, deserializedBody.AchievedDate); + Assert.Null(deserializedBody.AchievedDate); } [Fact] @@ -320,21 +295,90 @@ public async Task Can_Post_TodoItem() // Act var response = await _fixture.Client.SendAsync(request); - var body = await response.Content.ReadAsStringAsync(); - var deserializedBody = (TodoItem)_fixture.GetService().Deserialize(body); // Assert Assert.Equal(HttpStatusCode.Created, response.StatusCode); + var body = await response.Content.ReadAsStringAsync(); + var deserializedBody = (TodoItem)_fixture.GetService().Deserialize(body); + Assert.Equal(HttpStatusCode.Created, response.StatusCode); Assert.Equal(todoItem.Description, deserializedBody.Description); Assert.Equal(todoItem.CreatedDate.ToString("G"), deserializedBody.CreatedDate.ToString("G")); - Assert.Equal(null, deserializedBody.AchievedDate); + Assert.Null(deserializedBody.AchievedDate); + } + + + [Fact] + public async Task Can_Post_TodoItem_With_Different_Owner_And_Assignee() + { + // Arrange + var person1 = new Person(); + var person2 = new Person(); + _context.People.Add(person1); + _context.People.Add(person2); + _context.SaveChanges(); + + var todoItem = _todoItemFaker.Generate(); + var content = new + { + data = new + { + type = "todo-items", + attributes = new Dictionary() + { + { "description", todoItem.Description }, + { "ordinal", todoItem.Ordinal }, + { "created-date", todoItem.CreatedDate } + }, + relationships = new + { + owner = new + { + data = new + { + type = "people", + id = person1.Id.ToString() + } + }, + assignee = new + { + data = new + { + type = "people", + id = person2.Id.ToString() + } + } + } + } + }; + + var httpMethod = new HttpMethod("POST"); + var route = $"/api/v1/todo-items"; + + var request = new HttpRequestMessage(httpMethod, route); + request.Content = new StringContent(JsonConvert.SerializeObject(content)); + request.Content.Headers.ContentType = new MediaTypeHeaderValue("application/vnd.api+json"); + + // Act + var response = await _fixture.Client.SendAsync(request); + + // Assert -- response + Assert.Equal(HttpStatusCode.Created, response.StatusCode); + var body = await response.Content.ReadAsStringAsync(); + var document = JsonConvert.DeserializeObject(body); + var resultId = int.Parse(document.Data.Id); + + // Assert -- database + var todoItemResult = await _context.TodoItems.SingleAsync(t => t.Id == resultId); + + Assert.Equal(person1.Id, todoItemResult.OwnerId); + Assert.Equal(person2.Id, todoItemResult.AssigneeId); } [Fact] public async Task Can_Patch_TodoItem() { // Arrange - var person = new Person(); + var person = new Person(); _context.People.Add(person); _context.SaveChanges(); @@ -365,7 +409,7 @@ public async Task Can_Patch_TodoItem() var request = new HttpRequestMessage(httpMethod, route); request.Content = new StringContent(JsonConvert.SerializeObject(content)); request.Content.Headers.ContentType = new MediaTypeHeaderValue("application/vnd.api+json"); - + // Act var response = await _fixture.Client.SendAsync(request); var body = await response.Content.ReadAsStringAsync(); @@ -376,7 +420,7 @@ public async Task Can_Patch_TodoItem() Assert.Equal(newTodoItem.Description, deserializedBody.Description); Assert.Equal(newTodoItem.Ordinal, deserializedBody.Ordinal); Assert.Equal(newTodoItem.CreatedDate.ToString("G"), deserializedBody.CreatedDate.ToString("G")); - Assert.Equal(null, deserializedBody.AchievedDate); + Assert.Null(deserializedBody.AchievedDate); } [Fact] @@ -479,14 +523,14 @@ public async Task Can_Patch_TodoItemWithNullValue() Assert.Equal(newTodoItem.Description, deserializedBody.Description); Assert.Equal(newTodoItem.Ordinal, deserializedBody.Ordinal); Assert.Equal(newTodoItem.CreatedDate.ToString("G"), deserializedBody.CreatedDate.ToString("G")); - Assert.Equal(null, deserializedBody.AchievedDate); + Assert.Null(deserializedBody.AchievedDate); } [Fact] public async Task Can_Delete_TodoItem() { // Arrange - var person = new Person(); + var person = new Person(); _context.People.Add(person); _context.SaveChanges(); @@ -510,4 +554,4 @@ public async Task Can_Delete_TodoItem() Assert.Null(_context.TodoItems.FirstOrDefault(t => t.Id == todoItem.Id)); } } -} \ No newline at end of file +} diff --git a/test/JsonApiDotNetCoreExampleTests/Helpers/Extensions/IQueryableExtensions.cs b/test/JsonApiDotNetCoreExampleTests/Helpers/Extensions/IQueryableExtensions.cs index a40dfb4a5a..9298d93a05 100644 --- a/test/JsonApiDotNetCoreExampleTests/Helpers/Extensions/IQueryableExtensions.cs +++ b/test/JsonApiDotNetCoreExampleTests/Helpers/Extensions/IQueryableExtensions.cs @@ -4,43 +4,38 @@ using Microsoft.EntityFrameworkCore.Internal; using Microsoft.EntityFrameworkCore.Query; using Microsoft.EntityFrameworkCore.Query.Internal; -using Remotion.Linq.Parsing.Structure; +using Microsoft.EntityFrameworkCore.Storage; using Database = Microsoft.EntityFrameworkCore.Storage.Database; namespace JsonApiDotNetCoreExampleTests.Helpers.Extensions { - public static class IQueryableExtensions { - private static readonly TypeInfo QueryCompilerTypeInfo = typeof(QueryCompiler).GetTypeInfo(); - - private static readonly FieldInfo QueryCompilerField = typeof(EntityQueryProvider).GetTypeInfo().DeclaredFields.First(x => x.Name == "_queryCompiler"); + private static readonly FieldInfo QueryCompilerField = typeof(EntityQueryProvider).GetTypeInfo().DeclaredFields.Single(x => x.Name == "_queryCompiler"); - private static readonly PropertyInfo NodeTypeProviderField = QueryCompilerTypeInfo.DeclaredProperties.Single(x => x.Name == "NodeTypeProvider"); + private static readonly TypeInfo QueryCompilerTypeInfo = typeof(QueryCompiler).GetTypeInfo(); - private static readonly MethodInfo CreateQueryParserMethod = QueryCompilerTypeInfo.DeclaredMethods.First(x => x.Name == "CreateQueryParser"); + private static readonly FieldInfo QueryModelGeneratorField = QueryCompilerTypeInfo.DeclaredFields.Single(x => x.Name == "_queryModelGenerator"); - private static readonly FieldInfo DataBaseField = QueryCompilerTypeInfo.DeclaredFields.Single(x => x.Name == "_database"); + private static readonly FieldInfo DatabaseField = QueryCompilerTypeInfo.DeclaredFields.Single(x => x.Name == "_database"); - private static readonly FieldInfo QueryCompilationContextFactoryField = typeof(Database).GetTypeInfo().DeclaredFields.Single(x => x.Name == "_queryCompilationContextFactory"); + private static readonly PropertyInfo DependenciesProperty = typeof(Database).GetTypeInfo().DeclaredProperties.Single(x => x.Name == "Dependencies"); - public static string ToSql(this IQueryable query) where TEntity : class + public static string ToSql(this IQueryable queryable) + where TEntity : class { - if (!(query is EntityQueryable) && !(query is InternalDbSet)) - throw new ArgumentException("Invalid query"); - - var queryCompiler = (IQueryCompiler)QueryCompilerField.GetValue(query.Provider); - var nodeTypeProvider = (INodeTypeProvider)NodeTypeProviderField.GetValue(queryCompiler); - var parser = (IQueryParser)CreateQueryParserMethod.Invoke(queryCompiler, new object[] { nodeTypeProvider }); - var queryModel = parser.GetParsedQuery(query.Expression); - var database = DataBaseField.GetValue(queryCompiler); - var queryCompilationContextFactory = (IQueryCompilationContextFactory)QueryCompilationContextFactoryField.GetValue(database); + if (!(queryable is EntityQueryable) && !(queryable is InternalDbSet)) + throw new ArgumentException(); + + var queryCompiler = (IQueryCompiler)QueryCompilerField.GetValue(queryable.Provider); + var queryModelGenerator = (IQueryModelGenerator)QueryModelGeneratorField.GetValue(queryCompiler); + var queryModel = queryModelGenerator.ParseQuery(queryable.Expression); + var database = DatabaseField.GetValue(queryCompiler); + var queryCompilationContextFactory = ((DatabaseDependencies)DependenciesProperty.GetValue(database)).QueryCompilationContextFactory; var queryCompilationContext = queryCompilationContextFactory.Create(false); var modelVisitor = (RelationalQueryModelVisitor)queryCompilationContext.CreateQueryModelVisitor(); modelVisitor.CreateQueryExecutor(queryModel); - var sql = modelVisitor.Queries.First().ToString(); - - return sql; + return modelVisitor.Queries.Join(Environment.NewLine + Environment.NewLine); } } -} \ No newline at end of file +} diff --git a/test/JsonApiDotNetCoreExampleTests/Helpers/Extensions/StringExtensions.cs b/test/JsonApiDotNetCoreExampleTests/Helpers/Extensions/StringExtensions.cs index 19c7491d2a..dbe6b19feb 100644 --- a/test/JsonApiDotNetCoreExampleTests/Helpers/Extensions/StringExtensions.cs +++ b/test/JsonApiDotNetCoreExampleTests/Helpers/Extensions/StringExtensions.cs @@ -2,14 +2,14 @@ namespace JsonApiDotNetCoreExampleTests.Helpers.Extensions { - public static class StringExtensions { public static string Normalize(this string input) { return Regex.Replace(input, @"\s+", string.Empty) .ToUpper() - .Replace('"', '\''); + .Replace("\"", string.Empty) + .Replace("'", string.Empty); } } -} \ No newline at end of file +} diff --git a/test/JsonApiDotNetCoreExampleTests/Helpers/Repositories/AuthorizedTodoItemsRepository.cs b/test/JsonApiDotNetCoreExampleTests/Helpers/Repositories/AuthorizedTodoItemsRepository.cs index 7e9abf3784..4ce5da35d8 100644 --- a/test/JsonApiDotNetCoreExampleTests/Helpers/Repositories/AuthorizedTodoItemsRepository.cs +++ b/test/JsonApiDotNetCoreExampleTests/Helpers/Repositories/AuthorizedTodoItemsRepository.cs @@ -1,7 +1,6 @@ using System.Linq; using JsonApiDotNetCore.Data; using JsonApiDotNetCore.Services; -using JsonApiDotNetCoreExample.Data; using JsonApiDotNetCoreExample.Models; using JsonApiDotNetCoreExampleTests.Services; using Microsoft.Extensions.Logging; @@ -16,8 +15,9 @@ public class AuthorizedTodoItemsRepository : DefaultEntityRepository public AuthorizedTodoItemsRepository( ILoggerFactory loggerFactory, IJsonApiContext jsonApiContext, + IDbContextResolver contextResolver, IAuthorizationService authService) - : base(loggerFactory, jsonApiContext) + : base(loggerFactory, jsonApiContext, contextResolver) { _logger = loggerFactory.CreateLogger(); _authService = authService; diff --git a/test/JsonApiDotNetCoreExampleTests/Helpers/Startups/AuthorizedStartup.cs b/test/JsonApiDotNetCoreExampleTests/Helpers/Startups/AuthorizedStartup.cs index 21cfa0e0dc..12a207fea8 100644 --- a/test/JsonApiDotNetCoreExampleTests/Helpers/Startups/AuthorizedStartup.cs +++ b/test/JsonApiDotNetCoreExampleTests/Helpers/Startups/AuthorizedStartup.cs @@ -11,14 +11,16 @@ using JsonApiDotNetCore.Data; using JsonApiDotNetCoreExample.Models; using JsonApiDotNetCoreExampleTests.Repositories; +using UnitTests; +using JsonApiDotNetCore.Services; namespace JsonApiDotNetCoreExampleTests.Startups { public class AuthorizedStartup : Startup { public AuthorizedStartup(IHostingEnvironment env) - : base (env) - { } + : base(env) + { } public override IServiceProvider ConfigureServices(IServiceCollection services) { @@ -46,6 +48,8 @@ public override IServiceProvider ConfigureServices(IServiceCollection services) services.AddSingleton(authServicMock.Object); services.AddScoped, AuthorizedTodoItemsRepository>(); + services.AddScoped(); + return services.BuildServiceProvider(); } } diff --git a/test/JsonApiDotNetCoreExampleTests/Helpers/Startups/MetaStartup.cs b/test/JsonApiDotNetCoreExampleTests/Helpers/Startups/MetaStartup.cs index 0001878a50..6bc5a08016 100644 --- a/test/JsonApiDotNetCoreExampleTests/Helpers/Startups/MetaStartup.cs +++ b/test/JsonApiDotNetCoreExampleTests/Helpers/Startups/MetaStartup.cs @@ -20,25 +20,18 @@ public MetaStartup(IHostingEnvironment env) public override IServiceProvider ConfigureServices(IServiceCollection services) { var loggerFactory = new LoggerFactory(); - - loggerFactory - .AddConsole(LogLevel.Trace); - - services.AddSingleton(loggerFactory); - - services.AddDbContext(options => - { - options.UseNpgsql(GetDbConnectionString()); - }, ServiceLifetime.Transient); - - services.AddJsonApi(opt => - { - opt.Namespace = "api/v1"; - opt.DefaultPageSize = 5; - opt.IncludeTotalRecordCount = true; - }); - - services.AddScoped(); + loggerFactory.AddConsole(LogLevel.Warning); + + services + .AddSingleton(loggerFactory) + .AddDbContext(options => + options.UseNpgsql(GetDbConnectionString()), ServiceLifetime.Transient) + .AddJsonApi(options => { + options.Namespace = "api/v1"; + options.DefaultPageSize = 5; + options.IncludeTotalRecordCount = true; + }) + .AddScoped(); return services.BuildServiceProvider(); } diff --git a/test/JsonApiDotNetCoreExampleTests/JsonApiDotNetCoreExampleTests.csproj b/test/JsonApiDotNetCoreExampleTests/JsonApiDotNetCoreExampleTests.csproj index b22953dc23..c0c410f7c7 100755 --- a/test/JsonApiDotNetCoreExampleTests/JsonApiDotNetCoreExampleTests.csproj +++ b/test/JsonApiDotNetCoreExampleTests/JsonApiDotNetCoreExampleTests.csproj @@ -1,13 +1,7 @@  - $(NetCoreAppVersion) - true - JsonApiDotNetCoreExampleTests - Exe - JsonApiDotNetCoreExampleTests - true - true + false @@ -19,16 +13,20 @@ + - + + + + diff --git a/test/JsonApiDotNetCoreExampleTests/TestStartup.cs b/test/JsonApiDotNetCoreExampleTests/TestStartup.cs new file mode 100644 index 0000000000..886d6b3424 --- /dev/null +++ b/test/JsonApiDotNetCoreExampleTests/TestStartup.cs @@ -0,0 +1,22 @@ +using JsonApiDotNetCore.Services; +using JsonApiDotNetCoreExample; +using Microsoft.AspNetCore.Hosting; +using Microsoft.Extensions.DependencyInjection; +using System; +using UnitTests; + +namespace JsonApiDotNetCoreExampleTests +{ + public class TestStartup : Startup + { + public TestStartup(IHostingEnvironment env) : base(env) + { } + + public override IServiceProvider ConfigureServices(IServiceCollection services) + { + base.ConfigureServices(services); + services.AddScoped(); + return services.BuildServiceProvider(); + } + } +} diff --git a/test/JsonApiDotNetCoreExampleTests/WebHostCollection.cs b/test/JsonApiDotNetCoreExampleTests/WebHostCollection.cs index 01b3ace217..561d86bbb0 100644 --- a/test/JsonApiDotNetCoreExampleTests/WebHostCollection.cs +++ b/test/JsonApiDotNetCoreExampleTests/WebHostCollection.cs @@ -1,10 +1,10 @@ -using JsonApiDotNetCoreExample; +using JsonApiDotNetCoreExampleTests.Acceptance; using Xunit; namespace JsonApiDotNetCoreExampleTests { [CollectionDefinition("WebHostCollection")] public class WebHostCollection - : ICollectionFixture> + : ICollectionFixture> { } } diff --git a/test/JsonApiDotNetCoreExampleTests/appsettings.json b/test/JsonApiDotNetCoreExampleTests/appsettings.json index 7067b2bee0..84f8cf4220 100644 --- a/test/JsonApiDotNetCoreExampleTests/appsettings.json +++ b/test/JsonApiDotNetCoreExampleTests/appsettings.json @@ -1,14 +1,15 @@ { - "Data": { - "DefaultConnection": - "Host=localhost;Port=5432;Database=JsonApiDotNetCoreExample;User ID=postgres;Password=" - }, - "Logging": { - "IncludeScopes": false, - "LogLevel": { - "Default": "Debug", - "System": "Information", - "Microsoft": "Information" + "Data": { + "DefaultConnection": + "Host=localhost;Port=5432;Database=JsonApiDotNetCoreExample;User ID=postgres;Password=postgres" + }, + "Logging": { + "IncludeScopes": false, + "LogLevel": { + "Default": "Warning", + "System": "Warning", + "Microsoft": "Warning", + "JsonApiDotNetCore.Middleware.JsonApiExceptionFilter": "Critical" + } } - } } diff --git a/test/JsonApiDotNetCoreExampleTests/results b/test/JsonApiDotNetCoreExampleTests/results new file mode 100644 index 0000000000..09e896913c --- /dev/null +++ b/test/JsonApiDotNetCoreExampleTests/results @@ -0,0 +1,19364 @@ +Build started, please wait... +Build completed. + +Test run for /Users/jarednance/dev/json-api-dotnet-core/test/JsonApiDotNetCoreExampleTests/bin/Debug/netcoreapp2.0/JsonApiDotNetCoreExampleTests.dll(.NETCoreApp,Version=v2.0) +Microsoft (R) Test Execution Command Line Tool Version 15.3.0-preview-20170628-02 +Copyright (c) Microsoft Corporation. All rights reserved. + +Starting test execution, please wait... +[xUnit.net 00:00:01.5429620] Discovering: JsonApiDotNetCoreExampleTests +[xUnit.net 00:00:01.7795750] Discovered: JsonApiDotNetCoreExampleTests +[xUnit.net 00:00:01.9136060] Starting: JsonApiDotNetCoreExampleTests +dbug: Microsoft.EntityFrameworkCore.Infrastructure[10401] + An 'IServiceProvider' was created for internal use by Entity Framework. +info: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[0] + User profile is available. Using '/Users/jarednance/.aspnet/DataProtection-Keys' as key repository; keys will not be encrypted at rest. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-b040dd03-33c5-451e-8f42-3c9dd4e0dfec.xml'. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-c8147b66-2deb-407c-9421-1553f0e16d67.xml'. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-f7fa4a09-6d65-426e-a653-cbd2969e5073.xml'. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {b040dd03-33c5-451e-8f42-3c9dd4e0dfec}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {c8147b66-2deb-407c-9421-1553f0e16d67}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {f7fa4a09-6d65-426e-a653-cbd2969e5073}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.DefaultKeyResolver[13] + Considering key {c8147b66-2deb-407c-9421-1553f0e16d67} with expiration date 2018-03-03 16:22:35Z as default key. +dbug: Microsoft.AspNetCore.DataProtection.TypeForwardingActivator[0] + Forwarded activator type request from Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Version=1.1.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60 to Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Culture=neutral, PublicKeyToken=adb9793829ddae60 +dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptorFactory[11] + Using managed symmetric algorithm 'System.Security.Cryptography.Aes'. +dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptorFactory[10] + Using managed keyed hash algorithm 'System.Security.Cryptography.HMACSHA256'. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingProvider[2] + Using key {c8147b66-2deb-407c-9421-1553f0e16d67} as the default key. +dbug: Microsoft.AspNetCore.DataProtection.Internal.DataProtectionStartupFilter[0] + Key ring with default key {c8147b66-2deb-407c-9421-1553f0e16d67} was loaded during application startup. +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[], CommandType='Text', CommandTimeout='30'] + + SELECT CASE WHEN COUNT(*) = 0 THEN FALSE ELSE TRUE END + FROM information_schema.tables + WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema') +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (46ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + + SELECT CASE WHEN COUNT(*) = 0 THEN FALSE ELSE TRUE END + FROM information_schema.tables + WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema') +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[3] + Hosting starting +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[4] + Hosting started +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[0] + Loaded hosting startup assembly JsonApiDotNetCoreExample +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20200] + Beginning transaction with isolation level 'ReadCommitted'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@p0='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "CamelCasedModels" ("CompoundAttr") + VALUES (@p0) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (21ms) [Parameters=[@p0='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "CamelCasedModels" ("CompoundAttr") + VALUES (@p0) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (21ms) [Parameters=[@p0='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "CamelCasedModels" ("CompoundAttr") + VALUES (@p0) + RETURNING "Id"; +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20202] + Committing transaction. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20204] + Disposing transaction. +dbug: Microsoft.EntityFrameworkCore.Infrastructure[10401] + An 'IServiceProvider' was created for internal use by Entity Framework. +info: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[0] + User profile is available. Using '/Users/jarednance/.aspnet/DataProtection-Keys' as key repository; keys will not be encrypted at rest. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-b040dd03-33c5-451e-8f42-3c9dd4e0dfec.xml'. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-c8147b66-2deb-407c-9421-1553f0e16d67.xml'. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-f7fa4a09-6d65-426e-a653-cbd2969e5073.xml'. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {b040dd03-33c5-451e-8f42-3c9dd4e0dfec}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {c8147b66-2deb-407c-9421-1553f0e16d67}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {f7fa4a09-6d65-426e-a653-cbd2969e5073}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.DefaultKeyResolver[13] + Considering key {c8147b66-2deb-407c-9421-1553f0e16d67} with expiration date 2018-03-03 16:22:35Z as default key. +dbug: Microsoft.AspNetCore.DataProtection.TypeForwardingActivator[0] + Forwarded activator type request from Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Version=1.1.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60 to Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Culture=neutral, PublicKeyToken=adb9793829ddae60 +dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptorFactory[11] + Using managed symmetric algorithm 'System.Security.Cryptography.Aes'. +dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptorFactory[10] + Using managed keyed hash algorithm 'System.Security.Cryptography.HMACSHA256'. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingProvider[2] + Using key {c8147b66-2deb-407c-9421-1553f0e16d67} as the default key. +dbug: Microsoft.AspNetCore.DataProtection.Internal.DataProtectionStartupFilter[0] + Key ring with default key {c8147b66-2deb-407c-9421-1553f0e16d67} was loaded during application startup. +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[], CommandType='Text', CommandTimeout='30'] + + SELECT CASE WHEN COUNT(*) = 0 THEN FALSE ELSE TRUE END + FROM information_schema.tables + WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema') +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (2ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + + SELECT CASE WHEN COUNT(*) = 0 THEN FALSE ELSE TRUE END + FROM information_schema.tables + WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema') +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[3] + Hosting starting +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[4] + Hosting started +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[0] + Loaded hosting startup assembly JsonApiDotNetCoreExample +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 GET http://localhost/camelCasedModels +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 GET http://localhost/camelCasedModels +dbug: Microsoft.AspNetCore.Routing.Tree.TreeRouter[1] + Request successfully matched the route with name '(null)' and template 'CamelCasedModels'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.CamelCasedModelsController.PostAsync (JsonApiDotNetCoreExample)' with id 'c71c760f-c1d1-4899-8d4b-62a4348b63f7' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action JsonApiDotNetCoreExample.Controllers.CamelCasedModelsController.GetAsync (JsonApiDotNetCoreExample) +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.CamelCasedModelsController.GetAsync (JsonApiDotNetCoreExample) with arguments ((null)) - ModelState is Valid +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.CamelCasedModelsController.GetAsync (JsonApiDotNetCoreExample) with arguments ((null)) - ModelState is Valid +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Query[10101] + Compiling query model: + '(from CamelCasedModel _1 in DbSet + select [_1]).Count()' +dbug: Microsoft.EntityFrameworkCore.Query[10104] + Optimized query model: + '(from CamelCasedModel _1 in DbSet + select [_1]).Count()' +dbug: Microsoft.EntityFrameworkCore.Query[10107] + (QueryContext queryContext) => IAsyncEnumerable _InterceptExceptions( + source: IAsyncEnumerable _ToSequence(Task GetResult( + valueBuffers: IAsyncEnumerable _Query( + queryContext: queryContext, + shaperCommandContext: SelectExpression: + SELECT COUNT(*)::INT4 + FROM "CamelCasedModels" AS "c"), + throwOnNullResult: False, + cancellationToken: queryContext.CancellationToken)), + contextType: JsonApiDotNetCoreExample.Data.AppDbContext, + logger: DiagnosticsLogger, + queryContext: queryContext) +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[], CommandType='Text', CommandTimeout='30'] + SELECT COUNT(*)::INT4 + FROM "CamelCasedModels" AS "c" +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (9ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + SELECT COUNT(*)::INT4 + FROM "CamelCasedModels" AS "c" +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (9ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + SELECT COUNT(*)::INT4 + FROM "CamelCasedModels" AS "c" +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +info: JsonApiDotNetCore.Services.EntityResourceService[0] + Applying paging query. Fetching page 0 with 5 entities +dbug: Microsoft.EntityFrameworkCore.Query[10101] + Compiling query model: + '(from CamelCasedModel _2 in DbSet + select [_2]) + .Skip(__p_0) + .Take(__p_1)' +warn: Microsoft.EntityFrameworkCore.Query[10102] + Query: '(from CamelCasedModel _2 in DbSet select [_2]).Skip(__p_0).Ta...' uses a row limiting operation (Skip/Take) without OrderBy which may lead to unpredictable results. +warn: Microsoft.EntityFrameworkCore.Query[10102] + Query: '(from CamelCasedModel _2 in DbSet select [_2]).Skip(__p_0).Ta...' uses a row limiting operation (Skip/Take) without OrderBy which may lead to unpredictable results. +dbug: Microsoft.EntityFrameworkCore.Query[10104] + Optimized query model: + '(from CamelCasedModel _2 in DbSet + select [_2]) + .Skip(__p_0) + .Take(__p_1)' +dbug: Microsoft.EntityFrameworkCore.Query[10107] + (QueryContext queryContext) => IAsyncEnumerable _InterceptExceptions( + source: IAsyncEnumerable _TrackEntities( + results: IAsyncEnumerable _ShapedQuery( + queryContext: queryContext, + shaperCommandContext: SelectExpression: + SELECT "c"."Id", "c"."CompoundAttr" + FROM "CamelCasedModels" AS "c" + LIMIT @__p_1 OFFSET @__p_0, + shaper: UnbufferedEntityShaper), + queryContext: queryContext, + entityTrackingInfos: { itemType: CamelCasedModel }, + entityAccessors: List> + { + Func, + } + ), + contextType: JsonApiDotNetCoreExample.Data.AppDbContext, + logger: DiagnosticsLogger, + queryContext: queryContext) +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@__p_1='?', @__p_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "c"."Id", "c"."CompoundAttr" + FROM "CamelCasedModels" AS "c" + LIMIT @__p_1 OFFSET @__p_0 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (17ms) [Parameters=[@__p_1='?', @__p_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "c"."Id", "c"."CompoundAttr" + FROM "CamelCasedModels" AS "c" + LIMIT @__p_1 OFFSET @__p_0 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (17ms) [Parameters=[@__p_1='?', @__p_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "c"."Id", "c"."CompoundAttr" + FROM "CamelCasedModels" AS "c" + LIMIT @__p_1 OFFSET @__p_0 +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action method JsonApiDotNetCoreExample.Controllers.CamelCasedModelsController.GetAsync (JsonApiDotNetCoreExample), returned result Microsoft.AspNetCore.Mvc.OkObjectResult. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[4] + No information found on request to perform content negotiation. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[2] + Selected output formatter 'JsonApiDotNetCore.Formatters.JsonApiOutputFormatter' and content type '' to write the response. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: JsonApiDotNetCore.Formatters.JsonApiWriter[0] + Formatting response as JSONAPI +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.CamelCasedModelsController.GetAsync (JsonApiDotNetCoreExample) in 797.042ms +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.CamelCasedModelsController.GetAsync (JsonApiDotNetCoreExample) in 797.042ms +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 1177.077ms 200 application/vnd.api+json +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 1177.077ms 200 application/vnd.api+json +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20200] + Beginning transaction with isolation level 'ReadCommitted'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@p0='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "CamelCasedModels" ("CompoundAttr") + VALUES (@p0) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p0='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "CamelCasedModels" ("CompoundAttr") + VALUES (@p0) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p0='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "CamelCasedModels" ("CompoundAttr") + VALUES (@p0) + RETURNING "Id"; +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20202] + Committing transaction. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20204] + Disposing transaction. +dbug: Microsoft.EntityFrameworkCore.Infrastructure[10401] + An 'IServiceProvider' was created for internal use by Entity Framework. +: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[0] + User profile is available. Using '/Users/jarednance/.aspnet/DataProtection-Keys' as key repository; keys will not be encrypted at rest. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-b040dd03-33c5-451e-8f42-3c9dd4e0dfec.xml'. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-c8147b66-2deb-407c-9421-1553f0e16d67.xml'. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-f7fa4a09-6d65-426e-a653-cbd2969e5073.xml'. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {b040dd03-33c5-451e-8f42-3c9dd4e0dfec}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {c8147b66-2deb-407c-9421-1553f0e16d67}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {f7fa4a09-6d65-426e-a653-cbd2969e5073}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.DefaultKeyResolver[13] + Considering key {c8147b66-2deb-407c-9421-1553f0e16d67} with expiration date 2018-03-03 16:22:35Z as default key. +dbug: Microsoft.AspNetCore.DataProtection.TypeForwardingActivator[0] + Forwarded activator type request from Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Version=1.1.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60 to Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Culture=neutral, PublicKeyToken=adb9793829ddae60 +dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptorFactory[11] + Using managed symmetric algorithm 'System.Security.Cryptography.Aes'. +dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptorFactory[10] + Using managed keyed hash algorithm 'System.Security.Cryptography.HMACSHA256'. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingProvider[2] + Using key {c8147b66-2deb-407c-9421-1553f0e16d67} as the default key. +dbug: Microsoft.AspNetCore.DataProtection.Internal.DataProtectionStartupFilter[0] + Key ring with default key {c8147b66-2deb-407c-9421-1553f0e16d67} was loaded during application startup. +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[], CommandType='Text', CommandTimeout='30'] + + SELECT CASE WHEN COUNT(*) = 0 THEN FALSE ELSE TRUE END + FROM information_schema.tables + WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema') +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (2ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + + SELECT CASE WHEN COUNT(*) = 0 THEN FALSE ELSE TRUE END + FROM information_schema.tables + WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema') +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[3] + Hosting starting +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[4] + Hosting started +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[0] + Loaded hosting startup assembly JsonApiDotNetCoreExample +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 PATCH http://localhost/camelCasedModels/118 application/vnd.api+json +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 PATCH http://localhost/camelCasedModels/118 application/vnd.api+json +dbug: Microsoft.AspNetCore.Routing.Tree.TreeRouter[1] + Request successfully matched the route with name '(null)' and template 'CamelCasedModels/{id}'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.CamelCasedModelsController.GetAsync (JsonApiDotNetCoreExample)' with id '56304397-4d3c-4262-91df-9d2020a11d38' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.CamelCasedModelsController.DeleteAsync (JsonApiDotNetCoreExample)' with id 'b4ae66ce-aa8f-4c8e-869c-4b784d8bff92' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action JsonApiDotNetCoreExample.Controllers.CamelCasedModelsController.PatchAsync (JsonApiDotNetCoreExample) +dbug: Microsoft.AspNetCore.Mvc.ModelBinding.Binders.BodyModelBinder[1] + Selected input formatter 'JsonApiDotNetCore.Formatters.JsonApiInputFormatter' for content type 'application/vnd.api+json'. +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.CamelCasedModelsController.PatchAsync (JsonApiDotNetCoreExample) with arguments (118, JsonApiDotNetCoreExample.Models.CamelCasedModel) - ModelState is Valid +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.CamelCasedModelsController.PatchAsync (JsonApiDotNetCoreExample) with arguments (118, JsonApiDotNetCoreExample.Models.CamelCasedModel) - ModelState is Valid +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Query[10101] + Compiling query model: + '(from CamelCasedModel e in DbSet + where bool [e].Id.Equals((object)__id_0) + select [e]).SingleOrDefault()' +dbug: Microsoft.EntityFrameworkCore.Query[10104] + Optimized query model: + '(from CamelCasedModel e in DbSet + where bool [e].Id.Equals((object)__id_0) + select [e]).SingleOrDefault()' +dbug: Microsoft.EntityFrameworkCore.Query[10107] + (QueryContext queryContext) => IAsyncEnumerable _InterceptExceptions( + source: IAsyncEnumerable _TrackEntities( + results: IAsyncEnumerable _ToSequence(Task SingleOrDefault( + source: IAsyncEnumerable _ShapedQuery( + queryContext: queryContext, + shaperCommandContext: SelectExpression: + SELECT "e"."Id", "e"."CompoundAttr" + FROM "CamelCasedModels" AS "e" + WHERE "e"."Id" = @__id_0 + LIMIT 2, + shaper: UnbufferedEntityShaper), + cancellationToken: queryContext.CancellationToken)), + queryContext: queryContext, + entityTrackingInfos: { itemType: CamelCasedModel }, + entityAccessors: List> + { + Func, + } + ), + contextType: JsonApiDotNetCoreExample.Data.AppDbContext, + logger: DiagnosticsLogger, + queryContext: queryContext) +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "e"."Id", "e"."CompoundAttr" + FROM "CamelCasedModels" AS "e" + WHERE "e"."Id" = @__id_0 + LIMIT 2 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (2ms) [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "e"."Id", "e"."CompoundAttr" + FROM "CamelCasedModels" AS "e" + WHERE "e"."Id" = @__id_0 + LIMIT 2 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (2ms) [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "e"."Id", "e"."CompoundAttr" + FROM "CamelCasedModels" AS "e" + WHERE "e"."Id" = @__id_0 + LIMIT 2 +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20200] + Beginning transaction with isolation level 'ReadCommitted'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@p1='?', @p0='?'], CommandType='Text', CommandTimeout='30'] + UPDATE "CamelCasedModels" SET "CompoundAttr" = @p0 + WHERE "Id" = @p1; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (2ms) [Parameters=[@p1='?', @p0='?'], CommandType='Text', CommandTimeout='30'] + UPDATE "CamelCasedModels" SET "CompoundAttr" = @p0 + WHERE "Id" = @p1; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (2ms) [Parameters=[@p1='?', @p0='?'], CommandType='Text', CommandTimeout='30'] + UPDATE "CamelCasedModels" SET "CompoundAttr" = @p0 + WHERE "Id" = @p1; +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20202] + Committing transaction. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20204] + Disposing transaction. +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action method JsonApiDotNetCoreExample.Controllers.CamelCasedModelsController.PatchAsync (JsonApiDotNetCoreExample), returned result Microsoft.AspNetCore.Mvc.OkObjectResult. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[4] + No information found on request to perform content negotiation. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[2] + Selected output formatter 'JsonApiDotNetCore.Formatters.JsonApiOutputFormatter' and content type '' to write the response. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: JsonApiDotNetCore.Formatters.JsonApiWriter[0] + Formatting response as JSONAPI +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.CamelCasedModelsController.PatchAsync (JsonApiDotNetCoreExample) in 354.058ms +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.CamelCasedModelsController.PatchAsync (JsonApiDotNetCoreExample) in 354.058ms +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 419.972ms 200 application/vnd.api+json +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 419.972ms 200 application/vnd.api+json +dbug: Microsoft.EntityFrameworkCore.Infrastructure[10401] + An 'IServiceProvider' was created for internal use by Entity Framework. +info: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[0] + User profile is available. Using '/Users/jarednance/.aspnet/DataProtection-Keys' as key repository; keys will not be encrypted at rest. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-b040dd03-33c5-451e-8f42-3c9dd4e0dfec.xml'. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-c8147b66-2deb-407c-9421-1553f0e16d67.xml'. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-f7fa4a09-6d65-426e-a653-cbd2969e5073.xml'. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {b040dd03-33c5-451e-8f42-3c9dd4e0dfec}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {c8147b66-2deb-407c-9421-1553f0e16d67}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {f7fa4a09-6d65-426e-a653-cbd2969e5073}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.DefaultKeyResolver[13] + Considering key {c8147b66-2deb-407c-9421-1553f0e16d67} with expiration date 2018-03-03 16:22:35Z as default key. +dbug: Microsoft.AspNetCore.DataProtection.TypeForwardingActivator[0] + Forwarded activator type request from Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Version=1.1.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60 to Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Culture=neutral, PublicKeyToken=adb9793829ddae60 +dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptorFactory[11] + Using managed symmetric algorithm 'System.Security.Cryptography.Aes'. +dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptorFactory[10] + Using managed keyed hash algorithm 'System.Security.Cryptography.HMACSHA256'. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingProvider[2] + Using key {c8147b66-2deb-407c-9421-1553f0e16d67} as the default key. +dbug: Microsoft.AspNetCore.DataProtection.Internal.DataProtectionStartupFilter[0] + Key ring with default key {c8147b66-2deb-407c-9421-1553f0e16d67} was loaded during application startup. +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[], CommandType='Text', CommandTimeout='30'] + + SELECT CASE WHEN COUNT(*) = 0 THEN FALSE ELSE TRUE END + FROM information_schema.tables + WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema') +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (2ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + + SELECT CASE WHEN COUNT(*) = 0 THEN FALSE ELSE TRUE END + FROM information_schema.tables + WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema') +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[3] + Hosting starting +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[4] + Hosting started +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[0] + Loaded hosting startup assembly JsonApiDotNetCoreExample +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 POST http://localhost/camelCasedModels application/vnd.api+json +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 POST http://localhost/camelCasedModels application/vnd.api+json +dbug: Microsoft.AspNetCore.Routing.Tree.TreeRouter[1] + Request successfully matched the route with name '(null)' and template 'CamelCasedModels'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.CamelCasedModelsController.GetAsync (JsonApiDotNetCoreExample)' with id '666fde0d-b734-495f-ad63-c5150103bbae' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action JsonApiDotNetCoreExample.Controllers.CamelCasedModelsController.PostAsync (JsonApiDotNetCoreExample) +dbug: Microsoft.AspNetCore.Mvc.ModelBinding.Binders.BodyModelBinder[1] + Selected input formatter 'JsonApiDotNetCore.Formatters.JsonApiInputFormatter' for content type 'application/vnd.api+json'. +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.CamelCasedModelsController.PostAsync (JsonApiDotNetCoreExample) with arguments (JsonApiDotNetCoreExample.Models.CamelCasedModel) - ModelState is Valid +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.CamelCasedModelsController.PostAsync (JsonApiDotNetCoreExample) with arguments (JsonApiDotNetCoreExample.Models.CamelCasedModel) - ModelState is Valid +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20200] + Beginning transaction with isolation level 'ReadCommitted'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@p0='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "CamelCasedModels" ("CompoundAttr") + VALUES (@p0) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (9ms) [Parameters=[@p0='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "CamelCasedModels" ("CompoundAttr") + VALUES (@p0) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (9ms) [Parameters=[@p0='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "CamelCasedModels" ("CompoundAttr") + VALUES (@p0) + RETURNING "Id"; +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20202] + Committing transaction. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20204] + Disposing transaction. +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action method JsonApiDotNetCoreExample.Controllers.CamelCasedModelsController.PostAsync (JsonApiDotNetCoreExample), returned result Microsoft.AspNetCore.Mvc.CreatedResult. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[4] + No information found on request to perform content negotiation. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[2] + Selected output formatter 'JsonApiDotNetCore.Formatters.JsonApiOutputFormatter' and content type '' to write the response. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: JsonApiDotNetCore.Formatters.JsonApiWriter[0] + Formatting response as JSONAPI +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.CamelCasedModelsController.PostAsync (JsonApiDotNetCoreExample) in 53.052ms +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 68.79ms 201 application/vnd.api+json +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.CamelCasedModelsController.PostAsync (JsonApiDotNetCoreExample) in 53.052ms +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 68.79ms 201 application/vnd.api+json +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20200] + Beginning transaction with isolation level 'ReadCommitted'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@p0='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "CamelCasedModels" ("CompoundAttr") + VALUES (@p0) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p0='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "CamelCasedModels" ("CompoundAttr") + VALUES (@p0) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p0='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "CamelCasedModels" ("CompoundAttr") + VALUES (@p0) + RETURNING "Id"; +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20202] + Committing transaction. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20204] + Disposing transaction. +dbug: Microsoft.EntityFrameworkCore.Infrastructure[10401] + An 'IServiceProvider' was created for internal use by Entity Framework. +: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[0] + User profile is available. Using '/Users/jarednance/.aspnet/DataProtection-Keys' as key repository; keys will not be encrypted at rest. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-b040dd03-33c5-451e-8f42-3c9dd4e0dfec.xml'. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-c8147b66-2deb-407c-9421-1553f0e16d67.xml'. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-f7fa4a09-6d65-426e-a653-cbd2969e5073.xml'. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {b040dd03-33c5-451e-8f42-3c9dd4e0dfec}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {c8147b66-2deb-407c-9421-1553f0e16d67}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {f7fa4a09-6d65-426e-a653-cbd2969e5073}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.DefaultKeyResolver[13] + Considering key {c8147b66-2deb-407c-9421-1553f0e16d67} with expiration date 2018-03-03 16:22:35Z as default key. +dbug: Microsoft.AspNetCore.DataProtection.TypeForwardingActivator[0] + Forwarded activator type request from Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Version=1.1.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60 to Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Culture=neutral, PublicKeyToken=adb9793829ddae60 +dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptorFactory[11] + Using managed symmetric algorithm 'System.Security.Cryptography.Aes'. +dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptorFactory[10] + Using managed keyed hash algorithm 'System.Security.Cryptography.HMACSHA256'. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingProvider[2] + Using key {c8147b66-2deb-407c-9421-1553f0e16d67} as the default key. +dbug: Microsoft.AspNetCore.DataProtection.Internal.DataProtectionStartupFilter[0] + Key ring with default key {c8147b66-2deb-407c-9421-1553f0e16d67} was loaded during application startup. +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[], CommandType='Text', CommandTimeout='30'] + + SELECT CASE WHEN COUNT(*) = 0 THEN FALSE ELSE TRUE END + FROM information_schema.tables + WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema') +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (2ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + + SELECT CASE WHEN COUNT(*) = 0 THEN FALSE ELSE TRUE END + FROM information_schema.tables + WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema') +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[3] + Hosting starting +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[4] + Hosting started +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[0] + Loaded hosting startup assembly JsonApiDotNetCoreExample +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 GET http://localhost/camelCasedModels/120 +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 GET http://localhost/camelCasedModels/120 +dbug: Microsoft.AspNetCore.Routing.Tree.TreeRouter[1] + Request successfully matched the route with name '(null)' and template 'CamelCasedModels/{id}'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.CamelCasedModelsController.PatchAsync (JsonApiDotNetCoreExample)' with id 'e8c838e7-928c-4438-9423-73d694f2a735' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.CamelCasedModelsController.DeleteAsync (JsonApiDotNetCoreExample)' with id 'd3dc7c59-c458-484c-864d-c679f2275710' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action JsonApiDotNetCoreExample.Controllers.CamelCasedModelsController.GetAsync (JsonApiDotNetCoreExample) +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.CamelCasedModelsController.GetAsync (JsonApiDotNetCoreExample) with arguments (120) - ModelState is Valid +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.CamelCasedModelsController.GetAsync (JsonApiDotNetCoreExample) with arguments (120) - ModelState is Valid +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Query[10101] + Compiling query model: + '(from CamelCasedModel e in DbSet + where bool [e].Id.Equals((object)__id_0) + select [e]).SingleOrDefault()' +dbug: Microsoft.EntityFrameworkCore.Query[10104] + Optimized query model: + '(from CamelCasedModel e in DbSet + where bool [e].Id.Equals((object)__id_0) + select [e]).SingleOrDefault()' +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Query[10107] + (QueryContext queryContext) => IAsyncEnumerable _InterceptExceptions( + source: IAsyncEnumerable _TrackEntities( + results: IAsyncEnumerable _ToSequence(Task SingleOrDefault( + source: IAsyncEnumerable _ShapedQuery( + queryContext: queryContext, + shaperCommandContext: SelectExpression: + SELECT "e"."Id", "e"."CompoundAttr" + FROM "CamelCasedModels" AS "e" + WHERE "e"."Id" = @__id_0 + LIMIT 2, + shaper: UnbufferedEntityShaper), + cancellationToken: queryContext.CancellationToken)), + queryContext: queryContext, + entityTrackingInfos: { itemType: CamelCasedModel }, + entityAccessors: List> + { + Func, + } + ), + contextType: JsonApiDotNetCoreExample.Data.AppDbContext, + logger: DiagnosticsLogger, + queryContext: queryContext) +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "e"."Id", "e"."CompoundAttr" + FROM "CamelCasedModels" AS "e" + WHERE "e"."Id" = @__id_0 + LIMIT 2 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (13ms) [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "e"."Id", "e"."CompoundAttr" + FROM "CamelCasedModels" AS "e" + WHERE "e"."Id" = @__id_0 + LIMIT 2 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (13ms) [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "e"."Id", "e"."CompoundAttr" + FROM "CamelCasedModels" AS "e" + WHERE "e"."Id" = @__id_0 + LIMIT 2 +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action method JsonApiDotNetCoreExample.Controllers.CamelCasedModelsController.GetAsync (JsonApiDotNetCoreExample), returned result Microsoft.AspNetCore.Mvc.OkObjectResult. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[4] + No information found on request to perform content negotiation. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[2] + Selected output formatter 'JsonApiDotNetCore.Formatters.JsonApiOutputFormatter' and content type '' to write the response. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: JsonApiDotNetCore.Formatters.JsonApiWriter[0] + Formatting response as JSONAPI +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.CamelCasedModelsController.GetAsync (JsonApiDotNetCoreExample) in 54.591ms +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 73.364ms 200 application/vnd.api+json +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.CamelCasedModelsController.GetAsync (JsonApiDotNetCoreExample) in 54.591ms +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 73.364ms 200 application/vnd.api+json +dbug: Microsoft.EntityFrameworkCore.Infrastructure[10401] + An 'IServiceProvider' was created for internal use by Entity Framework. +info: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[0] + User profile is available. Using '/Users/jarednance/.aspnet/DataProtection-Keys' as key repository; keys will not be encrypted at rest. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-b040dd03-33c5-451e-8f42-3c9dd4e0dfec.xml'. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-c8147b66-2deb-407c-9421-1553f0e16d67.xml'. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-f7fa4a09-6d65-426e-a653-cbd2969e5073.xml'. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {b040dd03-33c5-451e-8f42-3c9dd4e0dfec}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {c8147b66-2deb-407c-9421-1553f0e16d67}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {f7fa4a09-6d65-426e-a653-cbd2969e5073}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.DefaultKeyResolver[13] + Considering key {c8147b66-2deb-407c-9421-1553f0e16d67} with expiration date 2018-03-03 16:22:35Z as default key. +dbug: Microsoft.AspNetCore.DataProtection.TypeForwardingActivator[0] + Forwarded activator type request from Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Version=1.1.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60 to Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Culture=neutral, PublicKeyToken=adb9793829ddae60 +dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptorFactory[11] + Using managed symmetric algorithm 'System.Security.Cryptography.Aes'. +dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptorFactory[10] + Using managed keyed hash algorithm 'System.Security.Cryptography.HMACSHA256'. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingProvider[2] + Using key {c8147b66-2deb-407c-9421-1553f0e16d67} as the default key. +dbug: Microsoft.AspNetCore.DataProtection.Internal.DataProtectionStartupFilter[0] + Key ring with default key {c8147b66-2deb-407c-9421-1553f0e16d67} was loaded during application startup. +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[], CommandType='Text', CommandTimeout='30'] + + SELECT CASE WHEN COUNT(*) = 0 THEN FALSE ELSE TRUE END + FROM information_schema.tables + WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema') +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (2ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + + SELECT CASE WHEN COUNT(*) = 0 THEN FALSE ELSE TRUE END + FROM information_schema.tables + WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema') +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[3] + Hosting starting +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[4] + Hosting started +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[0] + Loaded hosting startup assembly JsonApiDotNetCoreExample +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 PATCH http://localhost/readonly +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 PATCH http://localhost/readonly +dbug: Microsoft.AspNetCore.Routing.Tree.TreeRouter[1] + Request successfully matched the route with name '(null)' and template 'ReadOnly'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.Restricted.ReadOnlyController.Get (JsonApiDotNetCoreExample)' with id '9ceae986-2052-4187-bc60-6db234b1ede5' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.Restricted.ReadOnlyController.Post (JsonApiDotNetCoreExample)' with id '4de72652-5656-423c-b4be-3cd9c940d171' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.Restricted.ReadOnlyController.Delete (JsonApiDotNetCoreExample)' with id '521d748c-b696-4748-b738-371680d2c9e3' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action JsonApiDotNetCoreExample.Controllers.Restricted.ReadOnlyController.Patch (JsonApiDotNetCoreExample) +fail: JsonApiDotNetCore.Middleware.JsonApiExceptionFilter[0] + An unhandled exception occurred during the request +JsonApiDotNetCore.Internal.JsonApiException: This resource does not support PATCH requests. + at JsonApiDotNetCore.Controllers.HttpRestrictAttribute.d__2.MoveNext() in /Users/jarednance/dev/json-api-dotnet-core/src/JsonApiDotNetCore/Controllers/HttpMethodRestrictionFilter.cs:line 21 +--- End of stack trace from previous location where exception was thrown --- + at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) + at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.d__10.MoveNext() +--- End of stack trace from previous location where exception was thrown --- + at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Rethrow(ActionExecutedContext context) + at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) + at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.d__14.MoveNext() +--- End of stack trace from previous location where exception was thrown --- + at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) + at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.d__23.MoveNext() +fail: JsonApiDotNetCore.Middleware.JsonApiExceptionFilter[0] + An unhandled exception occurred during the request +JsonApiDotNetCore.Internal.JsonApiException: This resource does not support PATCH requests. + at JsonApiDotNetCore.Controllers.HttpRestrictAttribute.d__2.MoveNext() in /Users/jarednance/dev/json-api-dotnet-core/src/JsonApiDotNetCore/Controllers/HttpMethodRestrictionFilter.cs:line 21 +--- End of stack trace from previous location where exception was thrown --- + at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) + at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.d__10.MoveNext() +--- End of stack trace from previous location where exception was thrown --- + at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Rethrow(ActionExecutedContext context) + at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) + at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.d__14.MoveNext() +--- End of stack trace from previous location where exception was thrown --- + at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) + at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.d__23.MoveNext() +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[4] + No information found on request to perform content negotiation. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[2] + Selected output formatter 'JsonApiDotNetCore.Formatters.JsonApiOutputFormatter' and content type '' to write the response. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: JsonApiDotNetCore.Formatters.JsonApiWriter[0] + Formatting response as JSONAPI +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.Restricted.ReadOnlyController.Patch (JsonApiDotNetCoreExample) in 25.699ms +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.Restricted.ReadOnlyController.Patch (JsonApiDotNetCoreExample) in 25.699ms +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 41.952ms 405 application/vnd.api+json +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 41.952ms 405 application/vnd.api+json +dbug: Microsoft.EntityFrameworkCore.Infrastructure[10401] + An 'IServiceProvider' was created for internal use by Entity Framework. +: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[0] + User profile is available. Using '/Users/jarednance/.aspnet/DataProtection-Keys' as key repository; keys will not be encrypted at rest. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-b040dd03-33c5-451e-8f42-3c9dd4e0dfec.xml'. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-c8147b66-2deb-407c-9421-1553f0e16d67.xml'. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-f7fa4a09-6d65-426e-a653-cbd2969e5073.xml'. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {b040dd03-33c5-451e-8f42-3c9dd4e0dfec}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {c8147b66-2deb-407c-9421-1553f0e16d67}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {f7fa4a09-6d65-426e-a653-cbd2969e5073}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.DefaultKeyResolver[13] + Considering key {c8147b66-2deb-407c-9421-1553f0e16d67} with expiration date 2018-03-03 16:22:35Z as default key. +dbug: Microsoft.AspNetCore.DataProtection.TypeForwardingActivator[0] + Forwarded activator type request from Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Version=1.1.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60 to Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Culture=neutral, PublicKeyToken=adb9793829ddae60 +dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptorFactory[11] + Using managed symmetric algorithm 'System.Security.Cryptography.Aes'. +dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptorFactory[10] + Using managed keyed hash algorithm 'System.Security.Cryptography.HMACSHA256'. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingProvider[2] + Using key {c8147b66-2deb-407c-9421-1553f0e16d67} as the default key. +dbug: Microsoft.AspNetCore.DataProtection.Internal.DataProtectionStartupFilter[0] + Key ring with default key {c8147b66-2deb-407c-9421-1553f0e16d67} was loaded during application startup. +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[], CommandType='Text', CommandTimeout='30'] + + SELECT CASE WHEN COUNT(*) = 0 THEN FALSE ELSE TRUE END + FROM information_schema.tables + WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema') +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + + SELECT CASE WHEN COUNT(*) = 0 THEN FALSE ELSE TRUE END + FROM information_schema.tables + WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema') +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[3] + Hosting starting +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[4] + Hosting started +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[0] + Loaded hosting startup assembly JsonApiDotNetCoreExample +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 DELETE http://localhost/readonly +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 DELETE http://localhost/readonly +dbug: Microsoft.AspNetCore.Routing.Tree.TreeRouter[1] + Request successfully matched the route with name '(null)' and template 'ReadOnly'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.Restricted.ReadOnlyController.Get (JsonApiDotNetCoreExample)' with id '18714b6d-0833-4259-935e-8efa022d086d' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.Restricted.ReadOnlyController.Post (JsonApiDotNetCoreExample)' with id '0fef2165-3efb-4658-933a-7ae6ef0c7232' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.Restricted.ReadOnlyController.Patch (JsonApiDotNetCoreExample)' with id '1d6daeba-8dfb-4b24-b56b-7a5283a29bc4' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action JsonApiDotNetCoreExample.Controllers.Restricted.ReadOnlyController.Delete (JsonApiDotNetCoreExample) +fail: JsonApiDotNetCore.Middleware.JsonApiExceptionFilter[0] + An unhandled exception occurred during the request +JsonApiDotNetCore.Internal.JsonApiException: This resource does not support DELETE requests. + at JsonApiDotNetCore.Controllers.HttpRestrictAttribute.d__2.MoveNext() in /Users/jarednance/dev/json-api-dotnet-core/src/JsonApiDotNetCore/Controllers/HttpMethodRestrictionFilter.cs:line 21 +--- End of stack trace from previous location where exception was thrown --- + at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) + at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.d__10.MoveNext() +--- End of stack trace from previous location where exception was thrown --- + at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Rethrow(ActionExecutedContext context) + at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) + at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.d__14.MoveNext() +--- End of stack trace from previous location where exception was thrown --- + at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) + at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.d__23.MoveNext() +fail: JsonApiDotNetCore.Middleware.JsonApiExceptionFilter[0] + An unhandled exception occurred during the request +JsonApiDotNetCore.Internal.JsonApiException: This resource does not support DELETE requests. + at JsonApiDotNetCore.Controllers.HttpRestrictAttribute.d__2.MoveNext() in /Users/jarednance/dev/json-api-dotnet-core/src/JsonApiDotNetCore/Controllers/HttpMethodRestrictionFilter.cs:line 21 +--- End of stack trace from previous location where exception was thrown --- + at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) + at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.d__10.MoveNext() +--- End of stack trace from previous location where exception was thrown --- + at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Rethrow(ActionExecutedContext context) + at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) + at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.d__14.MoveNext() +--- End of stack trace from previous location where exception was thrown --- + at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) + at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.d__23.MoveNext() +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[4] + No information found on request to perform content negotiation. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[2] + Selected output formatter 'JsonApiDotNetCore.Formatters.JsonApiOutputFormatter' and content type '' to write the response. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: JsonApiDotNetCore.Formatters.JsonApiWriter[0] + Formatting response as JSONAPI +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.Restricted.ReadOnlyController.Delete (JsonApiDotNetCoreExample) in 6.393ms +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.Restricted.ReadOnlyController.Delete (JsonApiDotNetCoreExample) in 6.393ms +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 18.237ms 405 application/vnd.api+json +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 18.237ms 405 application/vnd.api+json +dbug: Microsoft.EntityFrameworkCore.Infrastructure[10401] + An 'IServiceProvider' was created for internal use by Entity Framework. +: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[0] + User profile is available. Using '/Users/jarednance/.aspnet/DataProtection-Keys' as key repository; keys will not be encrypted at rest. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-b040dd03-33c5-451e-8f42-3c9dd4e0dfec.xml'. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-c8147b66-2deb-407c-9421-1553f0e16d67.xml'. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-f7fa4a09-6d65-426e-a653-cbd2969e5073.xml'. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {b040dd03-33c5-451e-8f42-3c9dd4e0dfec}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {c8147b66-2deb-407c-9421-1553f0e16d67}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {f7fa4a09-6d65-426e-a653-cbd2969e5073}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.DefaultKeyResolver[13] + Considering key {c8147b66-2deb-407c-9421-1553f0e16d67} with expiration date 2018-03-03 16:22:35Z as default key. +dbug: Microsoft.AspNetCore.DataProtection.TypeForwardingActivator[0] + Forwarded activator type request from Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Version=1.1.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60 to Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Culture=neutral, PublicKeyToken=adb9793829ddae60 +dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptorFactory[11] + Using managed symmetric algorithm 'System.Security.Cryptography.Aes'. +dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptorFactory[10] + Using managed keyed hash algorithm 'System.Security.Cryptography.HMACSHA256'. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingProvider[2] + Using key {c8147b66-2deb-407c-9421-1553f0e16d67} as the default key. +dbug: Microsoft.AspNetCore.DataProtection.Internal.DataProtectionStartupFilter[0] + Key ring with default key {c8147b66-2deb-407c-9421-1553f0e16d67} was loaded during application startup. +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[], CommandType='Text', CommandTimeout='30'] + + SELECT CASE WHEN COUNT(*) = 0 THEN FALSE ELSE TRUE END + FROM information_schema.tables + WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema') +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (2ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + + SELECT CASE WHEN COUNT(*) = 0 THEN FALSE ELSE TRUE END + FROM information_schema.tables + WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema') +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[3] + Hosting starting +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[4] + Hosting started +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[0] + Loaded hosting startup assembly JsonApiDotNetCoreExample +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 POST http://localhost/readonly +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 POST http://localhost/readonly +dbug: Microsoft.AspNetCore.Routing.Tree.TreeRouter[1] + Request successfully matched the route with name '(null)' and template 'ReadOnly'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.Restricted.ReadOnlyController.Get (JsonApiDotNetCoreExample)' with id '6a344e07-367a-4086-a290-a9ac9ff653b2' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.Restricted.ReadOnlyController.Patch (JsonApiDotNetCoreExample)' with id '65f4bfd4-7222-41ed-8406-d267a25771cc' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.Restricted.ReadOnlyController.Delete (JsonApiDotNetCoreExample)' with id '7151bfbd-129b-4a37-a514-c5cb1561f85c' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action JsonApiDotNetCoreExample.Controllers.Restricted.ReadOnlyController.Post (JsonApiDotNetCoreExample) +fail: JsonApiDotNetCore.Middleware.JsonApiExceptionFilter[0] + An unhandled exception occurred during the request +JsonApiDotNetCore.Internal.JsonApiException: This resource does not support POST requests. + at JsonApiDotNetCore.Controllers.HttpRestrictAttribute.d__2.MoveNext() in /Users/jarednance/dev/json-api-dotnet-core/src/JsonApiDotNetCore/Controllers/HttpMethodRestrictionFilter.cs:line 21 +--- End of stack trace from previous location where exception was thrown --- + at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) + at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.d__10.MoveNext() +--- End of stack trace from previous location where exception was thrown --- + at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Rethrow(ActionExecutedContext context) + at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) + at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.d__14.MoveNext() +--- End of stack trace from previous location where exception was thrown --- + at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) + at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.d__23.MoveNext() +fail: JsonApiDotNetCore.Middleware.JsonApiExceptionFilter[0] + An unhandled exception occurred during the request +JsonApiDotNetCore.Internal.JsonApiException: This resource does not support POST requests. + at JsonApiDotNetCore.Controllers.HttpRestrictAttribute.d__2.MoveNext() in /Users/jarednance/dev/json-api-dotnet-core/src/JsonApiDotNetCore/Controllers/HttpMethodRestrictionFilter.cs:line 21 +--- End of stack trace from previous location where exception was thrown --- + at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) + at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.d__10.MoveNext() +--- End of stack trace from previous location where exception was thrown --- + at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Rethrow(ActionExecutedContext context) + at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) + at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.d__14.MoveNext() +--- End of stack trace from previous location where exception was thrown --- + at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) + at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.d__23.MoveNext() +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[4] + No information found on request to perform content negotiation. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[2] + Selected output formatter 'JsonApiDotNetCore.Formatters.JsonApiOutputFormatter' and content type '' to write the response. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: JsonApiDotNetCore.Formatters.JsonApiWriter[0] + Formatting response as JSONAPI +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.Restricted.ReadOnlyController.Post (JsonApiDotNetCoreExample) in 3.628ms +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.Restricted.ReadOnlyController.Post (JsonApiDotNetCoreExample) in 3.628ms +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 18.455ms 405 application/vnd.api+json +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 18.455ms 405 application/vnd.api+json +dbug: Microsoft.EntityFrameworkCore.Infrastructure[10401] + An 'IServiceProvider' was created for internal use by Entity Framework. +info: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[0] + User profile is available. Using '/Users/jarednance/.aspnet/DataProtection-Keys' as key repository; keys will not be encrypted at rest. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-b040dd03-33c5-451e-8f42-3c9dd4e0dfec.xml'. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-c8147b66-2deb-407c-9421-1553f0e16d67.xml'. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-f7fa4a09-6d65-426e-a653-cbd2969e5073.xml'. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {b040dd03-33c5-451e-8f42-3c9dd4e0dfec}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {c8147b66-2deb-407c-9421-1553f0e16d67}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {f7fa4a09-6d65-426e-a653-cbd2969e5073}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.DefaultKeyResolver[13] + Considering key {c8147b66-2deb-407c-9421-1553f0e16d67} with expiration date 2018-03-03 16:22:35Z as default key. +dbug: Microsoft.AspNetCore.DataProtection.TypeForwardingActivator[0] + Forwarded activator type request from Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Version=1.1.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60 to Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Culture=neutral, PublicKeyToken=adb9793829ddae60 +dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptorFactory[11] + Using managed symmetric algorithm 'System.Security.Cryptography.Aes'. +dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptorFactory[10] + Using managed keyed hash algorithm 'System.Security.Cryptography.HMACSHA256'. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingProvider[2] + Using key {c8147b66-2deb-407c-9421-1553f0e16d67} as the default key. +dbug: Microsoft.AspNetCore.DataProtection.Internal.DataProtectionStartupFilter[0] + Key ring with default key {c8147b66-2deb-407c-9421-1553f0e16d67} was loaded during application startup. +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[], CommandType='Text', CommandTimeout='30'] + + SELECT CASE WHEN COUNT(*) = 0 THEN FALSE ELSE TRUE END + FROM information_schema.tables + WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema') +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (3ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + + SELECT CASE WHEN COUNT(*) = 0 THEN FALSE ELSE TRUE END + FROM information_schema.tables + WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema') +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[3] + Hosting starting +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[4] + Hosting started +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[0] + Loaded hosting startup assembly JsonApiDotNetCoreExample +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 GET http://localhost/readonly +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 GET http://localhost/readonly +dbug: Microsoft.AspNetCore.Routing.Tree.TreeRouter[1] + Request successfully matched the route with name '(null)' and template 'ReadOnly'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.Restricted.ReadOnlyController.Post (JsonApiDotNetCoreExample)' with id 'd692e0ba-f723-4660-aeb5-bb2fab767d08' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.Restricted.ReadOnlyController.Patch (JsonApiDotNetCoreExample)' with id 'bb9f84b7-1768-4c5c-a5d4-8142f3aa7da2' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.Restricted.ReadOnlyController.Delete (JsonApiDotNetCoreExample)' with id 'cadd349f-7374-4fc1-97df-b7df9a994684' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action JsonApiDotNetCoreExample.Controllers.Restricted.ReadOnlyController.Get (JsonApiDotNetCoreExample) +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.Restricted.ReadOnlyController.Get (JsonApiDotNetCoreExample) with arguments ((null)) - ModelState is Valid +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.Restricted.ReadOnlyController.Get (JsonApiDotNetCoreExample) with arguments ((null)) - ModelState is Valid +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action method JsonApiDotNetCoreExample.Controllers.Restricted.ReadOnlyController.Get (JsonApiDotNetCoreExample), returned result Microsoft.AspNetCore.Mvc.OkResult. +info: Microsoft.AspNetCore.Mvc.StatusCodeResult[1] + Executing HttpStatusCodeResult, setting HTTP status code 200 +info: Microsoft.AspNetCore.Mvc.StatusCodeResult[1] + Executing HttpStatusCodeResult, setting HTTP status code 200 +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.Restricted.ReadOnlyController.Get (JsonApiDotNetCoreExample) in 3.6ms +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.Restricted.ReadOnlyController.Get (JsonApiDotNetCoreExample) in 3.6ms +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 18.744ms 200 +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 18.744ms 200 +dbug: Microsoft.EntityFrameworkCore.Infrastructure[10401] + An 'IServiceProvider' was created for internal use by Entity Framework. +info: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[0] + User profile is available. Using '/Users/jarednance/.aspnet/DataProtection-Keys' as key repository; keys will not be encrypted at rest. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-b040dd03-33c5-451e-8f42-3c9dd4e0dfec.xml'. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-c8147b66-2deb-407c-9421-1553f0e16d67.xml'. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-f7fa4a09-6d65-426e-a653-cbd2969e5073.xml'. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {b040dd03-33c5-451e-8f42-3c9dd4e0dfec}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {c8147b66-2deb-407c-9421-1553f0e16d67}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {f7fa4a09-6d65-426e-a653-cbd2969e5073}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.DefaultKeyResolver[13] + Considering key {c8147b66-2deb-407c-9421-1553f0e16d67} with expiration date 2018-03-03 16:22:35Z as default key. +dbug: Microsoft.AspNetCore.DataProtection.TypeForwardingActivator[0] + Forwarded activator type request from Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Version=1.1.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60 to Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Culture=neutral, PublicKeyToken=adb9793829ddae60 +dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptorFactory[11] + Using managed symmetric algorithm 'System.Security.Cryptography.Aes'. +dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptorFactory[10] + Using managed keyed hash algorithm 'System.Security.Cryptography.HMACSHA256'. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingProvider[2] + Using key {c8147b66-2deb-407c-9421-1553f0e16d67} as the default key. +dbug: Microsoft.AspNetCore.DataProtection.Internal.DataProtectionStartupFilter[0] + Key ring with default key {c8147b66-2deb-407c-9421-1553f0e16d67} was loaded during application startup. +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[], CommandType='Text', CommandTimeout='30'] + + SELECT CASE WHEN COUNT(*) = 0 THEN FALSE ELSE TRUE END + FROM information_schema.tables + WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema') +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (2ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + + SELECT CASE WHEN COUNT(*) = 0 THEN FALSE ELSE TRUE END + FROM information_schema.tables + WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema') +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[3] + Hosting starting +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[4] + Hosting started +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[0] + Loaded hosting startup assembly JsonApiDotNetCoreExample +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 POST http://localhost/nohttpdelete +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 POST http://localhost/nohttpdelete +dbug: Microsoft.AspNetCore.Routing.Tree.TreeRouter[1] + Request successfully matched the route with name '(null)' and template 'NoHttpDelete'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.Restricted.NoHttpDeleteController.Get (JsonApiDotNetCoreExample)' with id 'e8ba1352-03b1-4166-9e79-1ce0c48f95f7' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.Restricted.NoHttpDeleteController.Patch (JsonApiDotNetCoreExample)' with id 'ebe48f67-b775-4198-b4d8-dae0bbabc2e6' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.Restricted.NoHttpDeleteController.Delete (JsonApiDotNetCoreExample)' with id '01ed4864-4f42-4865-af7f-c39b40fea67b' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action JsonApiDotNetCoreExample.Controllers.Restricted.NoHttpDeleteController.Post (JsonApiDotNetCoreExample) +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.Restricted.NoHttpDeleteController.Post (JsonApiDotNetCoreExample) with arguments ((null)) - ModelState is Valid +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.Restricted.NoHttpDeleteController.Post (JsonApiDotNetCoreExample) with arguments ((null)) - ModelState is Valid +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action method JsonApiDotNetCoreExample.Controllers.Restricted.NoHttpDeleteController.Post (JsonApiDotNetCoreExample), returned result Microsoft.AspNetCore.Mvc.OkResult. +info: Microsoft.AspNetCore.Mvc.StatusCodeResult[1] + Executing HttpStatusCodeResult, setting HTTP status code 200 +info: Microsoft.AspNetCore.Mvc.StatusCodeResult[1] + Executing HttpStatusCodeResult, setting HTTP status code 200 +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.Restricted.NoHttpDeleteController.Post (JsonApiDotNetCoreExample) in 0.719ms +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 14.875ms 200 +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.Restricted.NoHttpDeleteController.Post (JsonApiDotNetCoreExample) in 0.719ms +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 14.875ms 200 +dbug: Microsoft.EntityFrameworkCore.Infrastructure[10401] + An 'IServiceProvider' was created for internal use by Entity Framework. +info: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[0] + User profile is available. Using '/Users/jarednance/.aspnet/DataProtection-Keys' as key repository; keys will not be encrypted at rest. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-b040dd03-33c5-451e-8f42-3c9dd4e0dfec.xml'. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-c8147b66-2deb-407c-9421-1553f0e16d67.xml'. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-f7fa4a09-6d65-426e-a653-cbd2969e5073.xml'. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {b040dd03-33c5-451e-8f42-3c9dd4e0dfec}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {c8147b66-2deb-407c-9421-1553f0e16d67}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {f7fa4a09-6d65-426e-a653-cbd2969e5073}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.DefaultKeyResolver[13] + Considering key {c8147b66-2deb-407c-9421-1553f0e16d67} with expiration date 2018-03-03 16:22:35Z as default key. +dbug: Microsoft.AspNetCore.DataProtection.TypeForwardingActivator[0] + Forwarded activator type request from Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Version=1.1.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60 to Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Culture=neutral, PublicKeyToken=adb9793829ddae60 +dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptorFactory[11] + Using managed symmetric algorithm 'System.Security.Cryptography.Aes'. +dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptorFactory[10] + Using managed keyed hash algorithm 'System.Security.Cryptography.HMACSHA256'. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingProvider[2] + Using key {c8147b66-2deb-407c-9421-1553f0e16d67} as the default key. +dbug: Microsoft.AspNetCore.DataProtection.Internal.DataProtectionStartupFilter[0] + Key ring with default key {c8147b66-2deb-407c-9421-1553f0e16d67} was loaded during application startup. +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[], CommandType='Text', CommandTimeout='30'] + + SELECT CASE WHEN COUNT(*) = 0 THEN FALSE ELSE TRUE END + FROM information_schema.tables + WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema') +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (2ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + + SELECT CASE WHEN COUNT(*) = 0 THEN FALSE ELSE TRUE END + FROM information_schema.tables + WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema') +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[3] + Hosting starting +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[4] + Hosting started +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[0] + Loaded hosting startup assembly JsonApiDotNetCoreExample +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 DELETE http://localhost/nohttpdelete +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 DELETE http://localhost/nohttpdelete +dbug: Microsoft.AspNetCore.Routing.Tree.TreeRouter[1] + Request successfully matched the route with name '(null)' and template 'NoHttpDelete'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.Restricted.NoHttpDeleteController.Get (JsonApiDotNetCoreExample)' with id '72b19a09-1b1f-4691-a363-cb0f10df7f44' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.Restricted.NoHttpDeleteController.Post (JsonApiDotNetCoreExample)' with id '37d45424-cba6-4b3a-b19c-66490c70208f' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.Restricted.NoHttpDeleteController.Patch (JsonApiDotNetCoreExample)' with id '6dd43591-857d-4625-8fa4-a261d04da16b' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action JsonApiDotNetCoreExample.Controllers.Restricted.NoHttpDeleteController.Delete (JsonApiDotNetCoreExample) +fail: JsonApiDotNetCore.Middleware.JsonApiExceptionFilter[0] + An unhandled exception occurred during the request +JsonApiDotNetCore.Internal.JsonApiException: This resource does not support DELETE requests. + at JsonApiDotNetCore.Controllers.HttpRestrictAttribute.d__2.MoveNext() in /Users/jarednance/dev/json-api-dotnet-core/src/JsonApiDotNetCore/Controllers/HttpMethodRestrictionFilter.cs:line 21 +--- End of stack trace from previous location where exception was thrown --- + at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) + at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.d__10.MoveNext() +--- End of stack trace from previous location where exception was thrown --- + at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Rethrow(ActionExecutedContext context) + at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) + at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.d__14.MoveNext() +--- End of stack trace from previous location where exception was thrown --- + at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) + at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.d__23.MoveNext() +fail: JsonApiDotNetCore.Middleware.JsonApiExceptionFilter[0] + An unhandled exception occurred during the request +JsonApiDotNetCore.Internal.JsonApiException: This resource does not support DELETE requests. + at JsonApiDotNetCore.Controllers.HttpRestrictAttribute.d__2.MoveNext() in /Users/jarednance/dev/json-api-dotnet-core/src/JsonApiDotNetCore/Controllers/HttpMethodRestrictionFilter.cs:line 21 +--- End of stack trace from previous location where exception was thrown --- + at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) + at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.d__10.MoveNext() +--- End of stack trace from previous location where exception was thrown --- + at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Rethrow(ActionExecutedContext context) + at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) + at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.d__14.MoveNext() +--- End of stack trace from previous location where exception was thrown --- + at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) + at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.d__23.MoveNext() +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[4] + No information found on request to perform content negotiation. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[2] + Selected output formatter 'JsonApiDotNetCore.Formatters.JsonApiOutputFormatter' and content type '' to write the response. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: JsonApiDotNetCore.Formatters.JsonApiWriter[0] + Formatting response as JSONAPI +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.Restricted.NoHttpDeleteController.Delete (JsonApiDotNetCoreExample) in 3.513ms +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.Restricted.NoHttpDeleteController.Delete (JsonApiDotNetCoreExample) in 3.513ms +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 18.684ms 405 application/vnd.api+json +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 18.684ms 405 application/vnd.api+json +dbug: Microsoft.EntityFrameworkCore.Infrastructure[10401] + An 'IServiceProvider' was created for internal use by Entity Framework. +info: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[0] + User profile is available. Using '/Users/jarednance/.aspnet/DataProtection-Keys' as key repository; keys will not be encrypted at rest. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-b040dd03-33c5-451e-8f42-3c9dd4e0dfec.xml'. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-c8147b66-2deb-407c-9421-1553f0e16d67.xml'. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-f7fa4a09-6d65-426e-a653-cbd2969e5073.xml'. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {b040dd03-33c5-451e-8f42-3c9dd4e0dfec}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {c8147b66-2deb-407c-9421-1553f0e16d67}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {f7fa4a09-6d65-426e-a653-cbd2969e5073}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.DefaultKeyResolver[13] + Considering key {c8147b66-2deb-407c-9421-1553f0e16d67} with expiration date 2018-03-03 16:22:35Z as default key. +dbug: Microsoft.AspNetCore.DataProtection.TypeForwardingActivator[0] + Forwarded activator type request from Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Version=1.1.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60 to Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Culture=neutral, PublicKeyToken=adb9793829ddae60 +dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptorFactory[11] + Using managed symmetric algorithm 'System.Security.Cryptography.Aes'. +dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptorFactory[10] + Using managed keyed hash algorithm 'System.Security.Cryptography.HMACSHA256'. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingProvider[2] + Using key {c8147b66-2deb-407c-9421-1553f0e16d67} as the default key. +dbug: Microsoft.AspNetCore.DataProtection.Internal.DataProtectionStartupFilter[0] + Key ring with default key {c8147b66-2deb-407c-9421-1553f0e16d67} was loaded during application startup. +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[], CommandType='Text', CommandTimeout='30'] + + SELECT CASE WHEN COUNT(*) = 0 THEN FALSE ELSE TRUE END + FROM information_schema.tables + WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema') +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (3ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + + SELECT CASE WHEN COUNT(*) = 0 THEN FALSE ELSE TRUE END + FROM information_schema.tables + WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema') +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[3] + Hosting starting +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[4] + Hosting started +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[0] + Loaded hosting startup assembly JsonApiDotNetCoreExample +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 GET http://localhost/nohttpdelete +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 GET http://localhost/nohttpdelete +dbug: Microsoft.AspNetCore.Routing.Tree.TreeRouter[1] + Request successfully matched the route with name '(null)' and template 'NoHttpDelete'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.Restricted.NoHttpDeleteController.Post (JsonApiDotNetCoreExample)' with id 'c95f1a88-8eff-4b37-8f6a-7d8b7398b131' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.Restricted.NoHttpDeleteController.Patch (JsonApiDotNetCoreExample)' with id '9ea775d5-e54f-4b2c-b274-e2d8010d4134' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.Restricted.NoHttpDeleteController.Delete (JsonApiDotNetCoreExample)' with id 'f9ede477-a111-42f0-a8bf-5b81166908ee' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action JsonApiDotNetCoreExample.Controllers.Restricted.NoHttpDeleteController.Get (JsonApiDotNetCoreExample) +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.Restricted.NoHttpDeleteController.Get (JsonApiDotNetCoreExample) with arguments ((null)) - ModelState is Valid +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.Restricted.NoHttpDeleteController.Get (JsonApiDotNetCoreExample) with arguments ((null)) - ModelState is Valid +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action method JsonApiDotNetCoreExample.Controllers.Restricted.NoHttpDeleteController.Get (JsonApiDotNetCoreExample), returned result Microsoft.AspNetCore.Mvc.OkResult. +info: Microsoft.AspNetCore.Mvc.StatusCodeResult[1] + Executing HttpStatusCodeResult, setting HTTP status code 200 +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.Restricted.NoHttpDeleteController.Get (JsonApiDotNetCoreExample) in 0.329ms +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 15.698ms 200 +info: Microsoft.AspNetCore.Mvc.StatusCodeResult[1] + Executing HttpStatusCodeResult, setting HTTP status code 200 +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.Restricted.NoHttpDeleteController.Get (JsonApiDotNetCoreExample) in 0.329ms +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 15.698ms 200 +dbug: Microsoft.EntityFrameworkCore.Infrastructure[10401] + An 'IServiceProvider' was created for internal use by Entity Framework. +: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[0] + User profile is available. Using '/Users/jarednance/.aspnet/DataProtection-Keys' as key repository; keys will not be encrypted at rest. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-b040dd03-33c5-451e-8f42-3c9dd4e0dfec.xml'. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-c8147b66-2deb-407c-9421-1553f0e16d67.xml'. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-f7fa4a09-6d65-426e-a653-cbd2969e5073.xml'. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {b040dd03-33c5-451e-8f42-3c9dd4e0dfec}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {c8147b66-2deb-407c-9421-1553f0e16d67}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {f7fa4a09-6d65-426e-a653-cbd2969e5073}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.DefaultKeyResolver[13] + Considering key {c8147b66-2deb-407c-9421-1553f0e16d67} with expiration date 2018-03-03 16:22:35Z as default key. +dbug: Microsoft.AspNetCore.DataProtection.TypeForwardingActivator[0] + Forwarded activator type request from Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Version=1.1.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60 to Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Culture=neutral, PublicKeyToken=adb9793829ddae60 +dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptorFactory[11] + Using managed symmetric algorithm 'System.Security.Cryptography.Aes'. +dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptorFactory[10] + Using managed keyed hash algorithm 'System.Security.Cryptography.HMACSHA256'. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingProvider[2] + Using key {c8147b66-2deb-407c-9421-1553f0e16d67} as the default key. +dbug: Microsoft.AspNetCore.DataProtection.Internal.DataProtectionStartupFilter[0] + Key ring with default key {c8147b66-2deb-407c-9421-1553f0e16d67} was loaded during application startup. +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[], CommandType='Text', CommandTimeout='30'] + + SELECT CASE WHEN COUNT(*) = 0 THEN FALSE ELSE TRUE END + FROM information_schema.tables + WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema') +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (2ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + + SELECT CASE WHEN COUNT(*) = 0 THEN FALSE ELSE TRUE END + FROM information_schema.tables + WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema') +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[3] + Hosting starting +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[4] + Hosting started +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[0] + Loaded hosting startup assembly JsonApiDotNetCoreExample +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 PATCH http://localhost/nohttpdelete +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 PATCH http://localhost/nohttpdelete +dbug: Microsoft.AspNetCore.Routing.Tree.TreeRouter[1] + Request successfully matched the route with name '(null)' and template 'NoHttpDelete'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.Restricted.NoHttpDeleteController.Get (JsonApiDotNetCoreExample)' with id 'c702b174-b075-49f0-a851-626c2f1dceac' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.Restricted.NoHttpDeleteController.Post (JsonApiDotNetCoreExample)' with id 'a34519c4-5ff5-47fa-a55e-fdcddd23ac7d' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.Restricted.NoHttpDeleteController.Delete (JsonApiDotNetCoreExample)' with id '1cdfd359-36bc-421e-a025-7af36c463692' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action JsonApiDotNetCoreExample.Controllers.Restricted.NoHttpDeleteController.Patch (JsonApiDotNetCoreExample) +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.Restricted.NoHttpDeleteController.Patch (JsonApiDotNetCoreExample) with arguments ((null)) - ModelState is Valid +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action method JsonApiDotNetCoreExample.Controllers.Restricted.NoHttpDeleteController.Patch (JsonApiDotNetCoreExample), returned result Microsoft.AspNetCore.Mvc.OkResult. +info: Microsoft.AspNetCore.Mvc.StatusCodeResult[1] + Executing HttpStatusCodeResult, setting HTTP status code 200 +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.Restricted.NoHttpDeleteController.Patch (JsonApiDotNetCoreExample) in 0.378ms +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 16.973ms 200 +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.Restricted.NoHttpDeleteController.Patch (JsonApiDotNetCoreExample) with arguments ((null)) - ModelState is Valid +info: Microsoft.AspNetCore.Mvc.StatusCodeResult[1] + Executing HttpStatusCodeResult, setting HTTP status code 200 +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.Restricted.NoHttpDeleteController.Patch (JsonApiDotNetCoreExample) in 0.378ms +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 16.973ms 200 +dbug: Microsoft.EntityFrameworkCore.Infrastructure[10401] + An 'IServiceProvider' was created for internal use by Entity Framework. +info: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[0] + User profile is available. Using '/Users/jarednance/.aspnet/DataProtection-Keys' as key repository; keys will not be encrypted at rest. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-b040dd03-33c5-451e-8f42-3c9dd4e0dfec.xml'. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-c8147b66-2deb-407c-9421-1553f0e16d67.xml'. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-f7fa4a09-6d65-426e-a653-cbd2969e5073.xml'. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {b040dd03-33c5-451e-8f42-3c9dd4e0dfec}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {c8147b66-2deb-407c-9421-1553f0e16d67}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {f7fa4a09-6d65-426e-a653-cbd2969e5073}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.DefaultKeyResolver[13] + Considering key {c8147b66-2deb-407c-9421-1553f0e16d67} with expiration date 2018-03-03 16:22:35Z as default key. +dbug: Microsoft.AspNetCore.DataProtection.TypeForwardingActivator[0] + Forwarded activator type request from Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Version=1.1.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60 to Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Culture=neutral, PublicKeyToken=adb9793829ddae60 +dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptorFactory[11] + Using managed symmetric algorithm 'System.Security.Cryptography.Aes'. +dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptorFactory[10] + Using managed keyed hash algorithm 'System.Security.Cryptography.HMACSHA256'. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingProvider[2] + Using key {c8147b66-2deb-407c-9421-1553f0e16d67} as the default key. +dbug: Microsoft.AspNetCore.DataProtection.Internal.DataProtectionStartupFilter[0] + Key ring with default key {c8147b66-2deb-407c-9421-1553f0e16d67} was loaded during application startup. +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[], CommandType='Text', CommandTimeout='30'] + + SELECT CASE WHEN COUNT(*) = 0 THEN FALSE ELSE TRUE END + FROM information_schema.tables + WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema') +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + + SELECT CASE WHEN COUNT(*) = 0 THEN FALSE ELSE TRUE END + FROM information_schema.tables + WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema') +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[3] + Hosting starting +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[4] + Hosting started +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[0] + Loaded hosting startup assembly JsonApiDotNetCoreExample +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 DELETE http://localhost/nohttppatch +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 DELETE http://localhost/nohttppatch +dbug: Microsoft.AspNetCore.Routing.Tree.TreeRouter[1] + Request successfully matched the route with name '(null)' and template 'NoHttpPatch'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.Restricted.NoHttpPatchController.Get (JsonApiDotNetCoreExample)' with id '0a47ec59-9bd6-4f86-8ae7-784146f24d25' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.Restricted.NoHttpPatchController.Post (JsonApiDotNetCoreExample)' with id 'c40826a8-bb78-495b-a580-8a34f21f90e1' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.Restricted.NoHttpPatchController.Patch (JsonApiDotNetCoreExample)' with id '65968202-d190-4c70-9ac5-855e064ec85c' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action JsonApiDotNetCoreExample.Controllers.Restricted.NoHttpPatchController.Delete (JsonApiDotNetCoreExample) +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.Restricted.NoHttpPatchController.Delete (JsonApiDotNetCoreExample) with arguments ((null)) - ModelState is Valid +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.Restricted.NoHttpPatchController.Delete (JsonApiDotNetCoreExample) with arguments ((null)) - ModelState is Valid +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action method JsonApiDotNetCoreExample.Controllers.Restricted.NoHttpPatchController.Delete (JsonApiDotNetCoreExample), returned result Microsoft.AspNetCore.Mvc.OkResult. +info: Microsoft.AspNetCore.Mvc.StatusCodeResult[1] + Executing HttpStatusCodeResult, setting HTTP status code 200 +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.Restricted.NoHttpPatchController.Delete (JsonApiDotNetCoreExample) in 0.544ms +info: Microsoft.AspNetCore.Mvc.StatusCodeResult[1] + Executing HttpStatusCodeResult, setting HTTP status code 200 +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 16.402ms 200 +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.Restricted.NoHttpPatchController.Delete (JsonApiDotNetCoreExample) in 0.544ms +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 16.402ms 200 +dbug: Microsoft.EntityFrameworkCore.Infrastructure[10401] + An 'IServiceProvider' was created for internal use by Entity Framework. +: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[0] + User profile is available. Using '/Users/jarednance/.aspnet/DataProtection-Keys' as key repository; keys will not be encrypted at rest. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-b040dd03-33c5-451e-8f42-3c9dd4e0dfec.xml'. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-c8147b66-2deb-407c-9421-1553f0e16d67.xml'. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-f7fa4a09-6d65-426e-a653-cbd2969e5073.xml'. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {b040dd03-33c5-451e-8f42-3c9dd4e0dfec}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {c8147b66-2deb-407c-9421-1553f0e16d67}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {f7fa4a09-6d65-426e-a653-cbd2969e5073}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.DefaultKeyResolver[13] + Considering key {c8147b66-2deb-407c-9421-1553f0e16d67} with expiration date 2018-03-03 16:22:35Z as default key. +dbug: Microsoft.AspNetCore.DataProtection.TypeForwardingActivator[0] + Forwarded activator type request from Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Version=1.1.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60 to Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Culture=neutral, PublicKeyToken=adb9793829ddae60 +dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptorFactory[11] + Using managed symmetric algorithm 'System.Security.Cryptography.Aes'. +dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptorFactory[10] + Using managed keyed hash algorithm 'System.Security.Cryptography.HMACSHA256'. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingProvider[2] + Using key {c8147b66-2deb-407c-9421-1553f0e16d67} as the default key. +dbug: Microsoft.AspNetCore.DataProtection.Internal.DataProtectionStartupFilter[0] + Key ring with default key {c8147b66-2deb-407c-9421-1553f0e16d67} was loaded during application startup. +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[], CommandType='Text', CommandTimeout='30'] + + SELECT CASE WHEN COUNT(*) = 0 THEN FALSE ELSE TRUE END + FROM information_schema.tables + WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema') +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + + SELECT CASE WHEN COUNT(*) = 0 THEN FALSE ELSE TRUE END + FROM information_schema.tables + WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema') +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[3] + Hosting starting +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[4] + Hosting started +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[0] + Loaded hosting startup assembly JsonApiDotNetCoreExample +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 PATCH http://localhost/nohttppatch +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 PATCH http://localhost/nohttppatch +dbug: Microsoft.AspNetCore.Routing.Tree.TreeRouter[1] + Request successfully matched the route with name '(null)' and template 'NoHttpPatch'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.Restricted.NoHttpPatchController.Get (JsonApiDotNetCoreExample)' with id '9b16d4b3-796c-4630-b944-4a0c28230844' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.Restricted.NoHttpPatchController.Post (JsonApiDotNetCoreExample)' with id '867fa153-19b0-422e-aa0a-30a3f58f84e0' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.Restricted.NoHttpPatchController.Delete (JsonApiDotNetCoreExample)' with id '82d36401-dc08-4ff0-b285-dd2f8d333f59' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action JsonApiDotNetCoreExample.Controllers.Restricted.NoHttpPatchController.Patch (JsonApiDotNetCoreExample) +fail: JsonApiDotNetCore.Middleware.JsonApiExceptionFilter[0] + An unhandled exception occurred during the request +JsonApiDotNetCore.Internal.JsonApiException: This resource does not support PATCH requests. + at JsonApiDotNetCore.Controllers.HttpRestrictAttribute.d__2.MoveNext() in /Users/jarednance/dev/json-api-dotnet-core/src/JsonApiDotNetCore/Controllers/HttpMethodRestrictionFilter.cs:line 21 +--- End of stack trace from previous location where exception was thrown --- + at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) + at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.d__10.MoveNext() +--- End of stack trace from previous location where exception was thrown --- + at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Rethrow(ActionExecutedContext context) + at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) + at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.d__14.MoveNext() +--- End of stack trace from previous location where exception was thrown --- + at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) + at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.d__23.MoveNext() +fail: JsonApiDotNetCore.Middleware.JsonApiExceptionFilter[0] + An unhandled exception occurred during the request +JsonApiDotNetCore.Internal.JsonApiException: This resource does not support PATCH requests. + at JsonApiDotNetCore.Controllers.HttpRestrictAttribute.d__2.MoveNext() in /Users/jarednance/dev/json-api-dotnet-core/src/JsonApiDotNetCore/Controllers/HttpMethodRestrictionFilter.cs:line 21 +--- End of stack trace from previous location where exception was thrown --- + at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) + at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.d__10.MoveNext() +--- End of stack trace from previous location where exception was thrown --- + at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Rethrow(ActionExecutedContext context) + at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) + at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.d__14.MoveNext() +--- End of stack trace from previous location where exception was thrown --- + at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) + at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.d__23.MoveNext() +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[4] + No information found on request to perform content negotiation. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[2] + Selected output formatter 'JsonApiDotNetCore.Formatters.JsonApiOutputFormatter' and content type '' to write the response. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: JsonApiDotNetCore.Formatters.JsonApiWriter[0] + Formatting response as JSONAPI +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.Restricted.NoHttpPatchController.Patch (JsonApiDotNetCoreExample) in 7.468ms +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.Restricted.NoHttpPatchController.Patch (JsonApiDotNetCoreExample) in 7.468ms +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 19.429ms 405 application/vnd.api+json +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 19.429ms 405 application/vnd.api+json +dbug: Microsoft.EntityFrameworkCore.Infrastructure[10401] + An 'IServiceProvider' was created for internal use by Entity Framework. +info: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[0] + User profile is available. Using '/Users/jarednance/.aspnet/DataProtection-Keys' as key repository; keys will not be encrypted at rest. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-b040dd03-33c5-451e-8f42-3c9dd4e0dfec.xml'. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-c8147b66-2deb-407c-9421-1553f0e16d67.xml'. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-f7fa4a09-6d65-426e-a653-cbd2969e5073.xml'. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {b040dd03-33c5-451e-8f42-3c9dd4e0dfec}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {c8147b66-2deb-407c-9421-1553f0e16d67}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {f7fa4a09-6d65-426e-a653-cbd2969e5073}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.DefaultKeyResolver[13] + Considering key {c8147b66-2deb-407c-9421-1553f0e16d67} with expiration date 2018-03-03 16:22:35Z as default key. +dbug: Microsoft.AspNetCore.DataProtection.TypeForwardingActivator[0] + Forwarded activator type request from Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Version=1.1.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60 to Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Culture=neutral, PublicKeyToken=adb9793829ddae60 +dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptorFactory[11] + Using managed symmetric algorithm 'System.Security.Cryptography.Aes'. +dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptorFactory[10] + Using managed keyed hash algorithm 'System.Security.Cryptography.HMACSHA256'. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingProvider[2] + Using key {c8147b66-2deb-407c-9421-1553f0e16d67} as the default key. +dbug: Microsoft.AspNetCore.DataProtection.Internal.DataProtectionStartupFilter[0] + Key ring with default key {c8147b66-2deb-407c-9421-1553f0e16d67} was loaded during application startup. +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[], CommandType='Text', CommandTimeout='30'] + + SELECT CASE WHEN COUNT(*) = 0 THEN FALSE ELSE TRUE END + FROM information_schema.tables + WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema') +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + + SELECT CASE WHEN COUNT(*) = 0 THEN FALSE ELSE TRUE END + FROM information_schema.tables + WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema') +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[3] + Hosting starting +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[4] + Hosting started +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[0] + Loaded hosting startup assembly JsonApiDotNetCoreExample +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 GET http://localhost/nohttppatch +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 GET http://localhost/nohttppatch +dbug: Microsoft.AspNetCore.Routing.Tree.TreeRouter[1] + Request successfully matched the route with name '(null)' and template 'NoHttpPatch'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.Restricted.NoHttpPatchController.Post (JsonApiDotNetCoreExample)' with id '957f4e51-8d40-4405-a523-0f3096cf96c1' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.Restricted.NoHttpPatchController.Patch (JsonApiDotNetCoreExample)' with id 'a69c8f75-6924-4fcf-b2b3-c5d0277d4340' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.Restricted.NoHttpPatchController.Delete (JsonApiDotNetCoreExample)' with id '74dbbd63-6ca3-4fbd-8077-3b4f30a6f6e0' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action JsonApiDotNetCoreExample.Controllers.Restricted.NoHttpPatchController.Get (JsonApiDotNetCoreExample) +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.Restricted.NoHttpPatchController.Get (JsonApiDotNetCoreExample) with arguments ((null)) - ModelState is Valid +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.Restricted.NoHttpPatchController.Get (JsonApiDotNetCoreExample) with arguments ((null)) - ModelState is Valid +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action method JsonApiDotNetCoreExample.Controllers.Restricted.NoHttpPatchController.Get (JsonApiDotNetCoreExample), returned result Microsoft.AspNetCore.Mvc.OkResult. +info: Microsoft.AspNetCore.Mvc.StatusCodeResult[1] + Executing HttpStatusCodeResult, setting HTTP status code 200 +info: Microsoft.AspNetCore.Mvc.StatusCodeResult[1] + Executing HttpStatusCodeResult, setting HTTP status code 200 +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.Restricted.NoHttpPatchController.Get (JsonApiDotNetCoreExample) in 0.608ms +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.Restricted.NoHttpPatchController.Get (JsonApiDotNetCoreExample) in 0.608ms +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 20.436ms 200 +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 20.436ms 200 +dbug: Microsoft.EntityFrameworkCore.Infrastructure[10401] + An 'IServiceProvider' was created for internal use by Entity Framework. +info: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[0] + User profile is available. Using '/Users/jarednance/.aspnet/DataProtection-Keys' as key repository; keys will not be encrypted at rest. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-b040dd03-33c5-451e-8f42-3c9dd4e0dfec.xml'. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-c8147b66-2deb-407c-9421-1553f0e16d67.xml'. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-f7fa4a09-6d65-426e-a653-cbd2969e5073.xml'. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {b040dd03-33c5-451e-8f42-3c9dd4e0dfec}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {c8147b66-2deb-407c-9421-1553f0e16d67}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {f7fa4a09-6d65-426e-a653-cbd2969e5073}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.DefaultKeyResolver[13] + Considering key {c8147b66-2deb-407c-9421-1553f0e16d67} with expiration date 2018-03-03 16:22:35Z as default key. +dbug: Microsoft.AspNetCore.DataProtection.TypeForwardingActivator[0] + Forwarded activator type request from Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Version=1.1.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60 to Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Culture=neutral, PublicKeyToken=adb9793829ddae60 +dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptorFactory[11] + Using managed symmetric algorithm 'System.Security.Cryptography.Aes'. +dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptorFactory[10] + Using managed keyed hash algorithm 'System.Security.Cryptography.HMACSHA256'. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingProvider[2] + Using key {c8147b66-2deb-407c-9421-1553f0e16d67} as the default key. +dbug: Microsoft.AspNetCore.DataProtection.Internal.DataProtectionStartupFilter[0] + Key ring with default key {c8147b66-2deb-407c-9421-1553f0e16d67} was loaded during application startup. +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[], CommandType='Text', CommandTimeout='30'] + + SELECT CASE WHEN COUNT(*) = 0 THEN FALSE ELSE TRUE END + FROM information_schema.tables + WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema') +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (4ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + + SELECT CASE WHEN COUNT(*) = 0 THEN FALSE ELSE TRUE END + FROM information_schema.tables + WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema') +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[3] + Hosting starting +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[4] + Hosting started +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[0] + Loaded hosting startup assembly JsonApiDotNetCoreExample +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 POST http://localhost/nohttppatch +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 POST http://localhost/nohttppatch +dbug: Microsoft.AspNetCore.Routing.Tree.TreeRouter[1] + Request successfully matched the route with name '(null)' and template 'NoHttpPatch'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.Restricted.NoHttpPatchController.Get (JsonApiDotNetCoreExample)' with id 'e9ebb853-6169-4cc6-ba17-54a9ed00e805' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.Restricted.NoHttpPatchController.Patch (JsonApiDotNetCoreExample)' with id 'dab9b84a-0944-4807-bcbc-6dc1e7964c47' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.Restricted.NoHttpPatchController.Delete (JsonApiDotNetCoreExample)' with id '7e09310e-ec5e-4829-be57-632f6f7d1c89' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action JsonApiDotNetCoreExample.Controllers.Restricted.NoHttpPatchController.Post (JsonApiDotNetCoreExample) +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.Restricted.NoHttpPatchController.Post (JsonApiDotNetCoreExample) with arguments ((null)) - ModelState is Valid +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.Restricted.NoHttpPatchController.Post (JsonApiDotNetCoreExample) with arguments ((null)) - ModelState is Valid +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action method JsonApiDotNetCoreExample.Controllers.Restricted.NoHttpPatchController.Post (JsonApiDotNetCoreExample), returned result Microsoft.AspNetCore.Mvc.OkResult. +info: Microsoft.AspNetCore.Mvc.StatusCodeResult[1] + Executing HttpStatusCodeResult, setting HTTP status code 200 +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.Restricted.NoHttpPatchController.Post (JsonApiDotNetCoreExample) in 0.452ms +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 14.392ms 200 +info: Microsoft.AspNetCore.Mvc.StatusCodeResult[1] + Executing HttpStatusCodeResult, setting HTTP status code 200 +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.Restricted.NoHttpPatchController.Post (JsonApiDotNetCoreExample) in 0.452ms +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 14.392ms 200 +dbug: Microsoft.EntityFrameworkCore.Infrastructure[10401] + An 'IServiceProvider' was created for internal use by Entity Framework. +info: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[0] + User profile is available. Using '/Users/jarednance/.aspnet/DataProtection-Keys' as key repository; keys will not be encrypted at rest. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-b040dd03-33c5-451e-8f42-3c9dd4e0dfec.xml'. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-c8147b66-2deb-407c-9421-1553f0e16d67.xml'. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-f7fa4a09-6d65-426e-a653-cbd2969e5073.xml'. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {b040dd03-33c5-451e-8f42-3c9dd4e0dfec}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {c8147b66-2deb-407c-9421-1553f0e16d67}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {f7fa4a09-6d65-426e-a653-cbd2969e5073}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.DefaultKeyResolver[13] + Considering key {c8147b66-2deb-407c-9421-1553f0e16d67} with expiration date 2018-03-03 16:22:35Z as default key. +dbug: Microsoft.AspNetCore.DataProtection.TypeForwardingActivator[0] + Forwarded activator type request from Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Version=1.1.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60 to Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Culture=neutral, PublicKeyToken=adb9793829ddae60 +dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptorFactory[11] + Using managed symmetric algorithm 'System.Security.Cryptography.Aes'. +dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptorFactory[10] + Using managed keyed hash algorithm 'System.Security.Cryptography.HMACSHA256'. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingProvider[2] + Using key {c8147b66-2deb-407c-9421-1553f0e16d67} as the default key. +dbug: Microsoft.AspNetCore.DataProtection.Internal.DataProtectionStartupFilter[0] + Key ring with default key {c8147b66-2deb-407c-9421-1553f0e16d67} was loaded during application startup. +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[], CommandType='Text', CommandTimeout='30'] + + SELECT CASE WHEN COUNT(*) = 0 THEN FALSE ELSE TRUE END + FROM information_schema.tables + WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema') +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (3ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + + SELECT CASE WHEN COUNT(*) = 0 THEN FALSE ELSE TRUE END + FROM information_schema.tables + WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema') +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[3] + Hosting starting +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[4] + Hosting started +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[0] + Loaded hosting startup assembly JsonApiDotNetCoreExample +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 PATCH http://localhost/nohttppost +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 PATCH http://localhost/nohttppost +dbug: Microsoft.AspNetCore.Routing.Tree.TreeRouter[1] + Request successfully matched the route with name '(null)' and template 'NoHttpPost'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.Restricted.NoHttpPostController.Get (JsonApiDotNetCoreExample)' with id '2c61d7ce-c38b-43b3-b51b-702e595f6b37' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.Restricted.NoHttpPostController.Post (JsonApiDotNetCoreExample)' with id 'fded13c7-20e9-402b-9cd0-66aee2c5fee4' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.Restricted.NoHttpPostController.Delete (JsonApiDotNetCoreExample)' with id '28252322-bbf4-46b2-8941-284cc1b1df1a' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action JsonApiDotNetCoreExample.Controllers.Restricted.NoHttpPostController.Patch (JsonApiDotNetCoreExample) +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.Restricted.NoHttpPostController.Patch (JsonApiDotNetCoreExample) with arguments ((null)) - ModelState is Valid +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.Restricted.NoHttpPostController.Patch (JsonApiDotNetCoreExample) with arguments ((null)) - ModelState is Valid +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action method JsonApiDotNetCoreExample.Controllers.Restricted.NoHttpPostController.Patch (JsonApiDotNetCoreExample), returned result Microsoft.AspNetCore.Mvc.OkResult. +info: Microsoft.AspNetCore.Mvc.StatusCodeResult[1] + Executing HttpStatusCodeResult, setting HTTP status code 200 +info: Microsoft.AspNetCore.Mvc.StatusCodeResult[1] + Executing HttpStatusCodeResult, setting HTTP status code 200 +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.Restricted.NoHttpPostController.Patch (JsonApiDotNetCoreExample) in 0.934ms +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.Restricted.NoHttpPostController.Patch (JsonApiDotNetCoreExample) in 0.934ms +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 16.025ms 200 +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 16.025ms 200 +dbug: Microsoft.EntityFrameworkCore.Infrastructure[10401] + An 'IServiceProvider' was created for internal use by Entity Framework. +info: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[0] + User profile is available. Using '/Users/jarednance/.aspnet/DataProtection-Keys' as key repository; keys will not be encrypted at rest. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-b040dd03-33c5-451e-8f42-3c9dd4e0dfec.xml'. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-c8147b66-2deb-407c-9421-1553f0e16d67.xml'. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-f7fa4a09-6d65-426e-a653-cbd2969e5073.xml'. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {b040dd03-33c5-451e-8f42-3c9dd4e0dfec}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {c8147b66-2deb-407c-9421-1553f0e16d67}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {f7fa4a09-6d65-426e-a653-cbd2969e5073}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.DefaultKeyResolver[13] + Considering key {c8147b66-2deb-407c-9421-1553f0e16d67} with expiration date 2018-03-03 16:22:35Z as default key. +dbug: Microsoft.AspNetCore.DataProtection.TypeForwardingActivator[0] + Forwarded activator type request from Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Version=1.1.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60 to Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Culture=neutral, PublicKeyToken=adb9793829ddae60 +dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptorFactory[11] + Using managed symmetric algorithm 'System.Security.Cryptography.Aes'. +dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptorFactory[10] + Using managed keyed hash algorithm 'System.Security.Cryptography.HMACSHA256'. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingProvider[2] + Using key {c8147b66-2deb-407c-9421-1553f0e16d67} as the default key. +dbug: Microsoft.AspNetCore.DataProtection.Internal.DataProtectionStartupFilter[0] + Key ring with default key {c8147b66-2deb-407c-9421-1553f0e16d67} was loaded during application startup. +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[], CommandType='Text', CommandTimeout='30'] + + SELECT CASE WHEN COUNT(*) = 0 THEN FALSE ELSE TRUE END + FROM information_schema.tables + WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema') +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + + SELECT CASE WHEN COUNT(*) = 0 THEN FALSE ELSE TRUE END + FROM information_schema.tables + WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema') +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[3] + Hosting starting +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[4] + Hosting started +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[0] + Loaded hosting startup assembly JsonApiDotNetCoreExample +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 GET http://localhost/nohttppost +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 GET http://localhost/nohttppost +dbug: Microsoft.AspNetCore.Routing.Tree.TreeRouter[1] + Request successfully matched the route with name '(null)' and template 'NoHttpPost'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.Restricted.NoHttpPostController.Post (JsonApiDotNetCoreExample)' with id 'eab96b94-f493-457f-97de-9b2995d5557a' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.Restricted.NoHttpPostController.Patch (JsonApiDotNetCoreExample)' with id '38baef8d-7d72-46dd-9f2a-bd1de31f9e15' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.Restricted.NoHttpPostController.Delete (JsonApiDotNetCoreExample)' with id '5e424bdc-48fd-4059-b3df-2f40347c6fac' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action JsonApiDotNetCoreExample.Controllers.Restricted.NoHttpPostController.Get (JsonApiDotNetCoreExample) +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.Restricted.NoHttpPostController.Get (JsonApiDotNetCoreExample) with arguments ((null)) - ModelState is Valid +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.Restricted.NoHttpPostController.Get (JsonApiDotNetCoreExample) with arguments ((null)) - ModelState is Valid +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action method JsonApiDotNetCoreExample.Controllers.Restricted.NoHttpPostController.Get (JsonApiDotNetCoreExample), returned result Microsoft.AspNetCore.Mvc.OkResult. +info: Microsoft.AspNetCore.Mvc.StatusCodeResult[1] + Executing HttpStatusCodeResult, setting HTTP status code 200 +info: Microsoft.AspNetCore.Mvc.StatusCodeResult[1] + Executing HttpStatusCodeResult, setting HTTP status code 200 +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.Restricted.NoHttpPostController.Get (JsonApiDotNetCoreExample) in 0.346ms +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 16.34ms 200 +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.Restricted.NoHttpPostController.Get (JsonApiDotNetCoreExample) in 0.346ms +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 16.34ms 200 +dbug: Microsoft.EntityFrameworkCore.Infrastructure[10401] + An 'IServiceProvider' was created for internal use by Entity Framework. +info: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[0] + User profile is available. Using '/Users/jarednance/.aspnet/DataProtection-Keys' as key repository; keys will not be encrypted at rest. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-b040dd03-33c5-451e-8f42-3c9dd4e0dfec.xml'. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-c8147b66-2deb-407c-9421-1553f0e16d67.xml'. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-f7fa4a09-6d65-426e-a653-cbd2969e5073.xml'. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {b040dd03-33c5-451e-8f42-3c9dd4e0dfec}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {c8147b66-2deb-407c-9421-1553f0e16d67}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {f7fa4a09-6d65-426e-a653-cbd2969e5073}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.DefaultKeyResolver[13] + Considering key {c8147b66-2deb-407c-9421-1553f0e16d67} with expiration date 2018-03-03 16:22:35Z as default key. +dbug: Microsoft.AspNetCore.DataProtection.TypeForwardingActivator[0] + Forwarded activator type request from Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Version=1.1.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60 to Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Culture=neutral, PublicKeyToken=adb9793829ddae60 +dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptorFactory[11] + Using managed symmetric algorithm 'System.Security.Cryptography.Aes'. +dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptorFactory[10] + Using managed keyed hash algorithm 'System.Security.Cryptography.HMACSHA256'. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingProvider[2] + Using key {c8147b66-2deb-407c-9421-1553f0e16d67} as the default key. +dbug: Microsoft.AspNetCore.DataProtection.Internal.DataProtectionStartupFilter[0] + Key ring with default key {c8147b66-2deb-407c-9421-1553f0e16d67} was loaded during application startup. +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[], CommandType='Text', CommandTimeout='30'] + + SELECT CASE WHEN COUNT(*) = 0 THEN FALSE ELSE TRUE END + FROM information_schema.tables + WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema') +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (3ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + + SELECT CASE WHEN COUNT(*) = 0 THEN FALSE ELSE TRUE END + FROM information_schema.tables + WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema') +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[3] + Hosting starting +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[4] + Hosting started +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[0] + Loaded hosting startup assembly JsonApiDotNetCoreExample +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 POST http://localhost/nohttppost +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 POST http://localhost/nohttppost +dbug: Microsoft.AspNetCore.Routing.Tree.TreeRouter[1] + Request successfully matched the route with name '(null)' and template 'NoHttpPost'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.Restricted.NoHttpPostController.Get (JsonApiDotNetCoreExample)' with id 'aa8ab36f-b617-4d80-8754-7342c289a15b' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.Restricted.NoHttpPostController.Patch (JsonApiDotNetCoreExample)' with id '71ab4fa0-892e-4cfa-bec8-6d1fa27fdc09' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.Restricted.NoHttpPostController.Delete (JsonApiDotNetCoreExample)' with id '2a0fc13f-0311-4ed2-a6fe-33f0355d1962' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action JsonApiDotNetCoreExample.Controllers.Restricted.NoHttpPostController.Post (JsonApiDotNetCoreExample) +fail: JsonApiDotNetCore.Middleware.JsonApiExceptionFilter[0] + An unhandled exception occurred during the request +JsonApiDotNetCore.Internal.JsonApiException: This resource does not support POST requests. + at JsonApiDotNetCore.Controllers.HttpRestrictAttribute.d__2.MoveNext() in /Users/jarednance/dev/json-api-dotnet-core/src/JsonApiDotNetCore/Controllers/HttpMethodRestrictionFilter.cs:line 21 +--- End of stack trace from previous location where exception was thrown --- + at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) + at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.d__10.MoveNext() +--- End of stack trace from previous location where exception was thrown --- + at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Rethrow(ActionExecutedContext context) + at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) + at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.d__14.MoveNext() +--- End of stack trace from previous location where exception was thrown --- + at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) + at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.d__23.MoveNext() +fail: JsonApiDotNetCore.Middleware.JsonApiExceptionFilter[0] + An unhandled exception occurred during the request +JsonApiDotNetCore.Internal.JsonApiException: This resource does not support POST requests. + at JsonApiDotNetCore.Controllers.HttpRestrictAttribute.d__2.MoveNext() in /Users/jarednance/dev/json-api-dotnet-core/src/JsonApiDotNetCore/Controllers/HttpMethodRestrictionFilter.cs:line 21 +--- End of stack trace from previous location where exception was thrown --- + at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) + at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.d__10.MoveNext() +--- End of stack trace from previous location where exception was thrown --- + at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Rethrow(ActionExecutedContext context) + at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) + at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.d__14.MoveNext() +--- End of stack trace from previous location where exception was thrown --- + at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) + at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.d__23.MoveNext() +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[4] + No information found on request to perform content negotiation. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[2] + Selected output formatter 'JsonApiDotNetCore.Formatters.JsonApiOutputFormatter' and content type '' to write the response. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: JsonApiDotNetCore.Formatters.JsonApiWriter[0] + Formatting response as JSONAPI +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.Restricted.NoHttpPostController.Post (JsonApiDotNetCoreExample) in 3.885ms +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.Restricted.NoHttpPostController.Post (JsonApiDotNetCoreExample) in 3.885ms +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 19.512ms 405 application/vnd.api+json +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 19.512ms 405 application/vnd.api+json +dbug: Microsoft.EntityFrameworkCore.Infrastructure[10401] + An 'IServiceProvider' was created for internal use by Entity Framework. +warn: Microsoft.EntityFrameworkCore.Infrastructure[10402] + More than twenty 'IServiceProvider' instances have been created for internal use by Entity Framework. Consider reviewing calls on 'DbContextOptionsBuilder' that may require new service providers to be built. +info: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[0] + User profile is available. Using '/Users/jarednance/.aspnet/DataProtection-Keys' as key repository; keys will not be encrypted at rest. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-b040dd03-33c5-451e-8f42-3c9dd4e0dfec.xml'. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-c8147b66-2deb-407c-9421-1553f0e16d67.xml'. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-f7fa4a09-6d65-426e-a653-cbd2969e5073.xml'. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {b040dd03-33c5-451e-8f42-3c9dd4e0dfec}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {c8147b66-2deb-407c-9421-1553f0e16d67}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {f7fa4a09-6d65-426e-a653-cbd2969e5073}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.DefaultKeyResolver[13] + Considering key {c8147b66-2deb-407c-9421-1553f0e16d67} with expiration date 2018-03-03 16:22:35Z as default key. +dbug: Microsoft.AspNetCore.DataProtection.TypeForwardingActivator[0] + Forwarded activator type request from Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Version=1.1.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60 to Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Culture=neutral, PublicKeyToken=adb9793829ddae60 +dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptorFactory[11] + Using managed symmetric algorithm 'System.Security.Cryptography.Aes'. +dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptorFactory[10] + Using managed keyed hash algorithm 'System.Security.Cryptography.HMACSHA256'. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingProvider[2] + Using key {c8147b66-2deb-407c-9421-1553f0e16d67} as the default key. +dbug: Microsoft.AspNetCore.DataProtection.Internal.DataProtectionStartupFilter[0] + Key ring with default key {c8147b66-2deb-407c-9421-1553f0e16d67} was loaded during application startup. +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[], CommandType='Text', CommandTimeout='30'] + + SELECT CASE WHEN COUNT(*) = 0 THEN FALSE ELSE TRUE END + FROM information_schema.tables + WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema') +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + + SELECT CASE WHEN COUNT(*) = 0 THEN FALSE ELSE TRUE END + FROM information_schema.tables + WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema') +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[3] + Hosting starting +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[4] + Hosting started +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[0] + Loaded hosting startup assembly JsonApiDotNetCoreExample +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 DELETE http://localhost/nohttppost +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 DELETE http://localhost/nohttppost +dbug: Microsoft.AspNetCore.Routing.Tree.TreeRouter[1] + Request successfully matched the route with name '(null)' and template 'NoHttpPost'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.Restricted.NoHttpPostController.Get (JsonApiDotNetCoreExample)' with id 'e8d78aa6-b1bc-490e-b743-11e7d5769b09' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.Restricted.NoHttpPostController.Post (JsonApiDotNetCoreExample)' with id '2d2b399d-9677-4946-bf9a-f0c8c4e644c3' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.Restricted.NoHttpPostController.Patch (JsonApiDotNetCoreExample)' with id '9d2d6081-3838-4c95-9310-84cfce59572d' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action JsonApiDotNetCoreExample.Controllers.Restricted.NoHttpPostController.Delete (JsonApiDotNetCoreExample) +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.Restricted.NoHttpPostController.Delete (JsonApiDotNetCoreExample) with arguments ((null)) - ModelState is Valid +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.Restricted.NoHttpPostController.Delete (JsonApiDotNetCoreExample) with arguments ((null)) - ModelState is Valid +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action method JsonApiDotNetCoreExample.Controllers.Restricted.NoHttpPostController.Delete (JsonApiDotNetCoreExample), returned result Microsoft.AspNetCore.Mvc.OkResult. +info: Microsoft.AspNetCore.Mvc.StatusCodeResult[1] + Executing HttpStatusCodeResult, setting HTTP status code 200 +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.Restricted.NoHttpPostController.Delete (JsonApiDotNetCoreExample) in 0.446ms +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 18.61ms 200 +info: Microsoft.AspNetCore.Mvc.StatusCodeResult[1] + Executing HttpStatusCodeResult, setting HTTP status code 200 +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.Restricted.NoHttpPostController.Delete (JsonApiDotNetCoreExample) in 0.446ms +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 18.61ms 200 +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Query[10101] + Compiling query model: + 'from TodoItem _0 in DbSet + select [_0]' +dbug: Microsoft.EntityFrameworkCore.Query[10104] + Optimized query model: + 'from TodoItem _0 in DbSet + select [_0]' +dbug: Microsoft.EntityFrameworkCore.Query[10107] + (QueryContext queryContext) => IEnumerable _InterceptExceptions( + source: IEnumerable _TrackEntities( + results: IEnumerable _ShapedQuery( + queryContext: queryContext, + shaperCommandContext: SelectExpression: + SELECT "t"."Id", "t"."AchievedDate", "t"."AssigneeId", "t"."CollectionId", "t"."CreatedDate", "t"."Description", "t"."GuidProperty", "t"."Ordinal", "t"."OwnerId" + FROM "TodoItems" AS "t", + shaper: UnbufferedEntityShaper), + queryContext: queryContext, + entityTrackingInfos: { itemType: TodoItem }, + entityAccessors: List> + { + Func, + } + ), + contextType: JsonApiDotNetCoreExample.Data.AppDbContext, + logger: DiagnosticsLogger, + queryContext: queryContext) +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[], CommandType='Text', CommandTimeout='30'] + SELECT "t"."Id", "t"."AchievedDate", "t"."AssigneeId", "t"."CollectionId", "t"."CreatedDate", "t"."Description", "t"."GuidProperty", "t"."Ordinal", "t"."OwnerId" + FROM "TodoItems" AS "t" +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (2ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + SELECT "t"."Id", "t"."AchievedDate", "t"."AssigneeId", "t"."CollectionId", "t"."CreatedDate", "t"."Description", "t"."GuidProperty", "t"."Ordinal", "t"."OwnerId" + FROM "TodoItems" AS "t" +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (2ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + SELECT "t"."Id", "t"."AchievedDate", "t"."AssigneeId", "t"."CollectionId", "t"."CreatedDate", "t"."Description", "t"."GuidProperty", "t"."Ordinal", "t"."OwnerId" + FROM "TodoItems" AS "t" +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20200] + Beginning transaction with isolation level 'ReadCommitted'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?', @p8='?', @p9='?', @p10='?', @p11='?', @p12='?', @p13='?', @p14='?', @p15='?', @p16='?', @p17='?', @p18='?', @p19='?', @p20='?', @p21='?', @p22='?', @p23='?', @p24='?', @p25='?', @p26='?', @p27='?', @p28='?', @p29='?', @p30='?', @p31='?', @p32='?', @p33='?', @p34='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "People" ("FirstName", "LastName") + VALUES (@p0, @p1) + RETURNING "Id"; + DELETE FROM "TodoItems" + WHERE "Id" = @p2; + DELETE FROM "TodoItems" + WHERE "Id" = @p3; + DELETE FROM "TodoItems" + WHERE "Id" = @p4; + DELETE FROM "TodoItems" + WHERE "Id" = @p5; + DELETE FROM "TodoItems" + WHERE "Id" = @p6; + DELETE FROM "TodoItems" + WHERE "Id" = @p7; + DELETE FROM "TodoItems" + WHERE "Id" = @p8; + DELETE FROM "TodoItems" + WHERE "Id" = @p9; + DELETE FROM "TodoItems" + WHERE "Id" = @p10; + DELETE FROM "TodoItems" + WHERE "Id" = @p11; + DELETE FROM "TodoItems" + WHERE "Id" = @p12; + DELETE FROM "TodoItems" + WHERE "Id" = @p13; + DELETE FROM "TodoItems" + WHERE "Id" = @p14; + DELETE FROM "TodoItems" + WHERE "Id" = @p15; + DELETE FROM "TodoItems" + WHERE "Id" = @p16; + DELETE FROM "TodoItems" + WHERE "Id" = @p17; + DELETE FROM "TodoItems" + WHERE "Id" = @p18; + DELETE FROM "TodoItems" + WHERE "Id" = @p19; + DELETE FROM "TodoItems" + WHERE "Id" = @p20; + DELETE FROM "TodoItems" + WHERE "Id" = @p21; + DELETE FROM "TodoItems" + WHERE "Id" = @p22; + DELETE FROM "TodoItems" + WHERE "Id" = @p23; + DELETE FROM "TodoItems" + WHERE "Id" = @p24; + DELETE FROM "TodoItems" + WHERE "Id" = @p25; + DELETE FROM "TodoItems" + WHERE "Id" = @p26; + DELETE FROM "TodoItems" + WHERE "Id" = @p27; + DELETE FROM "TodoItems" + WHERE "Id" = @p28; + DELETE FROM "TodoItems" + WHERE "Id" = @p29; + DELETE FROM "TodoItems" + WHERE "Id" = @p30; + DELETE FROM "TodoItems" + WHERE "Id" = @p31; + DELETE FROM "TodoItems" + WHERE "Id" = @p32; + DELETE FROM "TodoItems" + WHERE "Id" = @p33; + DELETE FROM "TodoItems" + WHERE "Id" = @p34; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (5ms) [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?', @p8='?', @p9='?', @p10='?', @p11='?', @p12='?', @p13='?', @p14='?', @p15='?', @p16='?', @p17='?', @p18='?', @p19='?', @p20='?', @p21='?', @p22='?', @p23='?', @p24='?', @p25='?', @p26='?', @p27='?', @p28='?', @p29='?', @p30='?', @p31='?', @p32='?', @p33='?', @p34='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "People" ("FirstName", "LastName") + VALUES (@p0, @p1) + RETURNING "Id"; + DELETE FROM "TodoItems" + WHERE "Id" = @p2; + DELETE FROM "TodoItems" + WHERE "Id" = @p3; + DELETE FROM "TodoItems" + WHERE "Id" = @p4; + DELETE FROM "TodoItems" + WHERE "Id" = @p5; + DELETE FROM "TodoItems" + WHERE "Id" = @p6; + DELETE FROM "TodoItems" + WHERE "Id" = @p7; + DELETE FROM "TodoItems" + WHERE "Id" = @p8; + DELETE FROM "TodoItems" + WHERE "Id" = @p9; + DELETE FROM "TodoItems" + WHERE "Id" = @p10; + DELETE FROM "TodoItems" + WHERE "Id" = @p11; + DELETE FROM "TodoItems" + WHERE "Id" = @p12; + DELETE FROM "TodoItems" + WHERE "Id" = @p13; + DELETE FROM "TodoItems" + WHERE "Id" = @p14; + DELETE FROM "TodoItems" + WHERE "Id" = @p15; + DELETE FROM "TodoItems" + WHERE "Id" = @p16; + DELETE FROM "TodoItems" + WHERE "Id" = @p17; + DELETE FROM "TodoItems" + WHERE "Id" = @p18; + DELETE FROM "TodoItems" + WHERE "Id" = @p19; + DELETE FROM "TodoItems" + WHERE "Id" = @p20; + DELETE FROM "TodoItems" + WHERE "Id" = @p21; + DELETE FROM "TodoItems" + WHERE "Id" = @p22; + DELETE FROM "TodoItems" + WHERE "Id" = @p23; + DELETE FROM "TodoItems" + WHERE "Id" = @p24; + DELETE FROM "TodoItems" + WHERE "Id" = @p25; + DELETE FROM "TodoItems" + WHERE "Id" = @p26; + DELETE FROM "TodoItems" + WHERE "Id" = @p27; + DELETE FROM "TodoItems" + WHERE "Id" = @p28; + DELETE FROM "TodoItems" + WHERE "Id" = @p29; + DELETE FROM "TodoItems" + WHERE "Id" = @p30; + DELETE FROM "TodoItems" + WHERE "Id" = @p31; + DELETE FROM "TodoItems" + WHERE "Id" = @p32; + DELETE FROM "TodoItems" + WHERE "Id" = @p33; + DELETE FROM "TodoItems" + WHERE "Id" = @p34; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (5ms) [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?', @p8='?', @p9='?', @p10='?', @p11='?', @p12='?', @p13='?', @p14='?', @p15='?', @p16='?', @p17='?', @p18='?', @p19='?', @p20='?', @p21='?', @p22='?', @p23='?', @p24='?', @p25='?', @p26='?', @p27='?', @p28='?', @p29='?', @p30='?', @p31='?', @p32='?', @p33='?', @p34='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "People" ("FirstName", "LastName") + VALUES (@p0, @p1) + RETURNING "Id"; + DELETE FROM "TodoItems" + WHERE "Id" = @p2; + DELETE FROM "TodoItems" + WHERE "Id" = @p3; + DELETE FROM "TodoItems" + WHERE "Id" = @p4; + DELETE FROM "TodoItems" + WHERE "Id" = @p5; + DELETE FROM "TodoItems" + WHERE "Id" = @p6; + DELETE FROM "TodoItems" + WHERE "Id" = @p7; + DELETE FROM "TodoItems" + WHERE "Id" = @p8; + DELETE FROM "TodoItems" + WHERE "Id" = @p9; + DELETE FROM "TodoItems" + WHERE "Id" = @p10; + DELETE FROM "TodoItems" + WHERE "Id" = @p11; + DELETE FROM "TodoItems" + WHERE "Id" = @p12; + DELETE FROM "TodoItems" + WHERE "Id" = @p13; + DELETE FROM "TodoItems" + WHERE "Id" = @p14; + DELETE FROM "TodoItems" + WHERE "Id" = @p15; + DELETE FROM "TodoItems" + WHERE "Id" = @p16; + DELETE FROM "TodoItems" + WHERE "Id" = @p17; + DELETE FROM "TodoItems" + WHERE "Id" = @p18; + DELETE FROM "TodoItems" + WHERE "Id" = @p19; + DELETE FROM "TodoItems" + WHERE "Id" = @p20; + DELETE FROM "TodoItems" + WHERE "Id" = @p21; + DELETE FROM "TodoItems" + WHERE "Id" = @p22; + DELETE FROM "TodoItems" + WHERE "Id" = @p23; + DELETE FROM "TodoItems" + WHERE "Id" = @p24; + DELETE FROM "TodoItems" + WHERE "Id" = @p25; + DELETE FROM "TodoItems" + WHERE "Id" = @p26; + DELETE FROM "TodoItems" + WHERE "Id" = @p27; + DELETE FROM "TodoItems" + WHERE "Id" = @p28; + DELETE FROM "TodoItems" + WHERE "Id" = @p29; + DELETE FROM "TodoItems" + WHERE "Id" = @p30; + DELETE FROM "TodoItems" + WHERE "Id" = @p31; + DELETE FROM "TodoItems" + WHERE "Id" = @p32; + DELETE FROM "TodoItems" + WHERE "Id" = @p33; + DELETE FROM "TodoItems" + WHERE "Id" = @p34; +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@p35='?', @p36='?', @p37='?', @p38='?', @p39='?', @p40='?', @p41='?', @p42='?', @p43='?', @p44='?', @p45='?', @p46='?', @p47='?', @p48='?', @p49='?', @p50='?', @p51='?', @p52='?', @p53='?', @p54='?', @p55='?', @p56='?', @p57='?', @p58='?', @p59='?', @p60='?', @p61='?', @p62='?', @p63='?', @p64='?', @p65='?', @p66='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p35, @p36, @p37, @p38, @p39, @p40, @p41, @p42) + RETURNING "Id"; + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p43, @p44, @p45, @p46, @p47, @p48, @p49, @p50) + RETURNING "Id"; + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p51, @p52, @p53, @p54, @p55, @p56, @p57, @p58) + RETURNING "Id"; + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p59, @p60, @p61, @p62, @p63, @p64, @p65, @p66) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (18ms) [Parameters=[@p35='?', @p36='?', @p37='?', @p38='?', @p39='?', @p40='?', @p41='?', @p42='?', @p43='?', @p44='?', @p45='?', @p46='?', @p47='?', @p48='?', @p49='?', @p50='?', @p51='?', @p52='?', @p53='?', @p54='?', @p55='?', @p56='?', @p57='?', @p58='?', @p59='?', @p60='?', @p61='?', @p62='?', @p63='?', @p64='?', @p65='?', @p66='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p35, @p36, @p37, @p38, @p39, @p40, @p41, @p42) + RETURNING "Id"; + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p43, @p44, @p45, @p46, @p47, @p48, @p49, @p50) + RETURNING "Id"; + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p51, @p52, @p53, @p54, @p55, @p56, @p57, @p58) + RETURNING "Id"; + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p59, @p60, @p61, @p62, @p63, @p64, @p65, @p66) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (18ms) [Parameters=[@p35='?', @p36='?', @p37='?', @p38='?', @p39='?', @p40='?', @p41='?', @p42='?', @p43='?', @p44='?', @p45='?', @p46='?', @p47='?', @p48='?', @p49='?', @p50='?', @p51='?', @p52='?', @p53='?', @p54='?', @p55='?', @p56='?', @p57='?', @p58='?', @p59='?', @p60='?', @p61='?', @p62='?', @p63='?', @p64='?', @p65='?', @p66='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p35, @p36, @p37, @p38, @p39, @p40, @p41, @p42) + RETURNING "Id"; + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p43, @p44, @p45, @p46, @p47, @p48, @p49, @p50) + RETURNING "Id"; + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p51, @p52, @p53, @p54, @p55, @p56, @p57, @p58) + RETURNING "Id"; + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p59, @p60, @p61, @p62, @p63, @p64, @p65, @p66) + RETURNING "Id"; +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20202] + Committing transaction. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20204] + Disposing transaction. +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 GET http://localhost/api/v1/todo-items?sort=-ordinal +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 GET http://localhost/api/v1/todo-items?sort=-ordinal +dbug: Microsoft.AspNetCore.Routing.Tree.TreeRouter[1] + Request successfully matched the route with name '(null)' and template 'api/v1/todo-items'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.TodoItemsController.PostAsync (JsonApiDotNetCoreExample)' with id '2fce3eb8-46a5-44ed-9a98-55e95b5c8e2f' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) with arguments ((null)) - ModelState is Valid +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) with arguments ((null)) - ModelState is Valid +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Query[10101] + Compiling query model: + '(from TodoItem x in DbSet + order by [x].Ordinal desc + select [x]).Count()' +dbug: Microsoft.EntityFrameworkCore.Query[10104] + Optimized query model: + '(from TodoItem x in DbSet + select [x]).Count()' +dbug: Microsoft.EntityFrameworkCore.Query[10107] + (QueryContext queryContext) => IAsyncEnumerable _InterceptExceptions( + source: IAsyncEnumerable _ToSequence(Task GetResult( + valueBuffers: IAsyncEnumerable _Query( + queryContext: queryContext, + shaperCommandContext: SelectExpression: + SELECT COUNT(*)::INT4 + FROM "TodoItems" AS "x"), + throwOnNullResult: False, + cancellationToken: queryContext.CancellationToken)), + contextType: JsonApiDotNetCoreExample.Data.AppDbContext, + logger: DiagnosticsLogger, + queryContext: queryContext) +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[], CommandType='Text', CommandTimeout='30'] + SELECT COUNT(*)::INT4 + FROM "TodoItems" AS "x" +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + SELECT COUNT(*)::INT4 + FROM "TodoItems" AS "x" +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + SELECT COUNT(*)::INT4 + FROM "TodoItems" AS "x" +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +info: JsonApiDotNetCore.Services.EntityResourceService[0] + Applying paging query. Fetching page 0 with 5 entities +dbug: Microsoft.EntityFrameworkCore.Query[10101] + Compiling query model: + '(from TodoItem x in DbSet + order by [x].Ordinal desc + select [x]) + .Skip(__p_0) + .Take(__p_1)' +dbug: Microsoft.EntityFrameworkCore.Query[10104] + Optimized query model: + '(from TodoItem x in DbSet + order by [x].Ordinal desc + select [x]) + .Skip(__p_0) + .Take(__p_1)' +dbug: Microsoft.EntityFrameworkCore.Query[10107] + (QueryContext queryContext) => IAsyncEnumerable _InterceptExceptions( + source: IAsyncEnumerable _TrackEntities( + results: IAsyncEnumerable _ShapedQuery( + queryContext: queryContext, + shaperCommandContext: SelectExpression: + SELECT "x"."Id", "x"."AchievedDate", "x"."AssigneeId", "x"."CollectionId", "x"."CreatedDate", "x"."Description", "x"."GuidProperty", "x"."Ordinal", "x"."OwnerId" + FROM "TodoItems" AS "x" + ORDER BY "x"."Ordinal" DESC + LIMIT @__p_1 OFFSET @__p_0, + shaper: UnbufferedEntityShaper), + queryContext: queryContext, + entityTrackingInfos: { itemType: TodoItem }, + entityAccessors: List> + { + Func, + } + ), + contextType: JsonApiDotNetCoreExample.Data.AppDbContext, + logger: DiagnosticsLogger, + queryContext: queryContext) +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@__p_1='?', @__p_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "x"."Id", "x"."AchievedDate", "x"."AssigneeId", "x"."CollectionId", "x"."CreatedDate", "x"."Description", "x"."GuidProperty", "x"."Ordinal", "x"."OwnerId" + FROM "TodoItems" AS "x" + ORDER BY "x"."Ordinal" DESC + LIMIT @__p_1 OFFSET @__p_0 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@__p_1='?', @__p_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "x"."Id", "x"."AchievedDate", "x"."AssigneeId", "x"."CollectionId", "x"."CreatedDate", "x"."Description", "x"."GuidProperty", "x"."Ordinal", "x"."OwnerId" + FROM "TodoItems" AS "x" + ORDER BY "x"."Ordinal" DESC + LIMIT @__p_1 OFFSET @__p_0 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@__p_1='?', @__p_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "x"."Id", "x"."AchievedDate", "x"."AssigneeId", "x"."CollectionId", "x"."CreatedDate", "x"."Description", "x"."GuidProperty", "x"."Ordinal", "x"."OwnerId" + FROM "TodoItems" AS "x" + ORDER BY "x"."Ordinal" DESC + LIMIT @__p_1 OFFSET @__p_0 +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample), returned result Microsoft.AspNetCore.Mvc.OkObjectResult. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[4] + No information found on request to perform content negotiation. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[2] + Selected output formatter 'JsonApiDotNetCore.Formatters.JsonApiOutputFormatter' and content type '' to write the response. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: JsonApiDotNetCore.Formatters.JsonApiWriter[0] + Formatting response as JSONAPI +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) in 73.508ms +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) in 73.508ms +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 90.09ms 200 application/vnd.api+json +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 90.09ms 200 application/vnd.api+json +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20200] + Beginning transaction with isolation level 'ReadCommitted'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@p0='?', @p1='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "People" ("FirstName", "LastName") + VALUES (@p0, @p1) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p0='?', @p1='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "People" ("FirstName", "LastName") + VALUES (@p0, @p1) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p0='?', @p1='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "People" ("FirstName", "LastName") + VALUES (@p0, @p1) + RETURNING "Id"; +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?', @p8='?', @p9='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p2, @p3, @p4, @p5, @p6, @p7, @p8, @p9) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?', @p8='?', @p9='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p2, @p3, @p4, @p5, @p6, @p7, @p8, @p9) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?', @p8='?', @p9='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p2, @p3, @p4, @p5, @p6, @p7, @p8, @p9) + RETURNING "Id"; +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20202] + Committing transaction. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20204] + Disposing transaction. +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 GET http://localhost/api/v1/todo-items?filter[ordinal]=999999 +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 GET http://localhost/api/v1/todo-items?filter[ordinal]=999999 +dbug: Microsoft.AspNetCore.Routing.Tree.TreeRouter[1] + Request successfully matched the route with name '(null)' and template 'api/v1/todo-items'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.TodoItemsController.PostAsync (JsonApiDotNetCoreExample)' with id '2fce3eb8-46a5-44ed-9a98-55e95b5c8e2f' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) with arguments ((null)) - ModelState is Valid +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) with arguments ((null)) - ModelState is Valid +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Query[10101] + Compiling query model: + '(from TodoItem model in DbSet + where [model].Ordinal == 999999 + select [model]).Count()' +dbug: Microsoft.EntityFrameworkCore.Query[10104] + Optimized query model: + '(from TodoItem model in DbSet + where [model].Ordinal == 999999 + select [model]).Count()' +dbug: Microsoft.EntityFrameworkCore.Query[10107] + (QueryContext queryContext) => IAsyncEnumerable _InterceptExceptions( + source: IAsyncEnumerable _ToSequence(Task GetResult( + valueBuffers: IAsyncEnumerable _Query( + queryContext: queryContext, + shaperCommandContext: SelectExpression: + SELECT COUNT(*)::INT4 + FROM "TodoItems" AS "model" + WHERE "model"."Ordinal" = 999999), + throwOnNullResult: False, + cancellationToken: queryContext.CancellationToken)), + contextType: JsonApiDotNetCoreExample.Data.AppDbContext, + logger: DiagnosticsLogger, + queryContext: queryContext) +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[], CommandType='Text', CommandTimeout='30'] + SELECT COUNT(*)::INT4 + FROM "TodoItems" AS "model" + WHERE "model"."Ordinal" = 999999 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + SELECT COUNT(*)::INT4 + FROM "TodoItems" AS "model" + WHERE "model"."Ordinal" = 999999 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + SELECT COUNT(*)::INT4 + FROM "TodoItems" AS "model" + WHERE "model"."Ordinal" = 999999 +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +info: JsonApiDotNetCore.Services.EntityResourceService[0] + Applying paging query. Fetching page 0 with 5 entities +dbug: Microsoft.EntityFrameworkCore.Query[10101] + Compiling query model: + '(from TodoItem model in DbSet + where [model].Ordinal == 999999 + select [model]) + .Skip(__p_0) + .Take(__p_1)' +warn: Microsoft.EntityFrameworkCore.Query[10102] + Query: '(from TodoItem model in DbSet where [model].Ordinal == 999999 select [model]).Skip(__p_0)....' uses a row limiting operation (Skip/Take) without OrderBy which may lead to unpredictable results. +warn: Microsoft.EntityFrameworkCore.Query[10102] + Query: '(from TodoItem model in DbSet where [model].Ordinal == 999999 select [model]).Skip(__p_0)....' uses a row limiting operation (Skip/Take) without OrderBy which may lead to unpredictable results. +dbug: Microsoft.EntityFrameworkCore.Query[10104] + Optimized query model: + '(from TodoItem model in DbSet + where [model].Ordinal == 999999 + select [model]) + .Skip(__p_0) + .Take(__p_1)' +dbug: Microsoft.EntityFrameworkCore.Query[10107] + (QueryContext queryContext) => IAsyncEnumerable _InterceptExceptions( + source: IAsyncEnumerable _TrackEntities( + results: IAsyncEnumerable _ShapedQuery( + queryContext: queryContext, + shaperCommandContext: SelectExpression: + SELECT "model"."Id", "model"."AchievedDate", "model"."AssigneeId", "model"."CollectionId", "model"."CreatedDate", "model"."Description", "model"."GuidProperty", "model"."Ordinal", "model"."OwnerId" + FROM "TodoItems" AS "model" + WHERE "model"."Ordinal" = 999999 + LIMIT @__p_1 OFFSET @__p_0, + shaper: UnbufferedEntityShaper), + queryContext: queryContext, + entityTrackingInfos: { itemType: TodoItem }, + entityAccessors: List> + { + Func, + } + ), + contextType: JsonApiDotNetCoreExample.Data.AppDbContext, + logger: DiagnosticsLogger, + queryContext: queryContext) +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@__p_1='?', @__p_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "model"."Id", "model"."AchievedDate", "model"."AssigneeId", "model"."CollectionId", "model"."CreatedDate", "model"."Description", "model"."GuidProperty", "model"."Ordinal", "model"."OwnerId" + FROM "TodoItems" AS "model" + WHERE "model"."Ordinal" = 999999 + LIMIT @__p_1 OFFSET @__p_0 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (2ms) [Parameters=[@__p_1='?', @__p_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "model"."Id", "model"."AchievedDate", "model"."AssigneeId", "model"."CollectionId", "model"."CreatedDate", "model"."Description", "model"."GuidProperty", "model"."Ordinal", "model"."OwnerId" + FROM "TodoItems" AS "model" + WHERE "model"."Ordinal" = 999999 + LIMIT @__p_1 OFFSET @__p_0 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (2ms) [Parameters=[@__p_1='?', @__p_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "model"."Id", "model"."AchievedDate", "model"."AssigneeId", "model"."CollectionId", "model"."CreatedDate", "model"."Description", "model"."GuidProperty", "model"."Ordinal", "model"."OwnerId" + FROM "TodoItems" AS "model" + WHERE "model"."Ordinal" = 999999 + LIMIT @__p_1 OFFSET @__p_0 +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample), returned result Microsoft.AspNetCore.Mvc.OkObjectResult. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[4] + No information found on request to perform content negotiation. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[2] + Selected output formatter 'JsonApiDotNetCore.Formatters.JsonApiOutputFormatter' and content type '' to write the response. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: JsonApiDotNetCore.Formatters.JsonApiWriter[0] + Formatting response as JSONAPI +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) in 48.005ms +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 50.255ms 200 application/vnd.api+json +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) in 48.005ms +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 50.255ms 200 application/vnd.api+json +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20200] + Beginning transaction with isolation level 'ReadCommitted'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@p0='?', @p1='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "People" ("FirstName", "LastName") + VALUES (@p0, @p1) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p0='?', @p1='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "People" ("FirstName", "LastName") + VALUES (@p0, @p1) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p0='?', @p1='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "People" ("FirstName", "LastName") + VALUES (@p0, @p1) + RETURNING "Id"; +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?', @p8='?', @p9='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p2, @p3, @p4, @p5, @p6, @p7, @p8, @p9) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?', @p8='?', @p9='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p2, @p3, @p4, @p5, @p6, @p7, @p8, @p9) + RETURNING "Id"; +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?', @p8='?', @p9='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p2, @p3, @p4, @p5, @p6, @p7, @p8, @p9) + RETURNING "Id"; +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20202] + Committing transaction. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20204] + Disposing transaction. +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 GET http://localhost/api/v1/todo-items/2594 +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 GET http://localhost/api/v1/todo-items/2594 +dbug: Microsoft.AspNetCore.Routing.Tree.TreeRouter[1] + Request successfully matched the route with name '(null)' and template 'api/v1/todo-items/{id}'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.TodoItemsController.PatchAsync (JsonApiDotNetCoreExample)' with id '1ee61db8-daf4-41f3-90d2-1cf3db87d448' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.TodoItemsController.DeleteAsync (JsonApiDotNetCoreExample)' with id '75ab2821-99d0-4a3f-9dbb-3747ee7b296e' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) with arguments (2594) - ModelState is Valid +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) with arguments (2594) - ModelState is Valid +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Query[10101] + Compiling query model: + '(from TodoItem e in DbSet + where bool [e].Id.Equals((object)__id_0) + select [e]).SingleOrDefault()' +dbug: Microsoft.EntityFrameworkCore.Query[10104] + Optimized query model: + '(from TodoItem e in DbSet + where bool [e].Id.Equals((object)__id_0) + select [e]).SingleOrDefault()' +dbug: Microsoft.EntityFrameworkCore.Query[10107] + (QueryContext queryContext) => IAsyncEnumerable _InterceptExceptions( + source: IAsyncEnumerable _TrackEntities( + results: IAsyncEnumerable _ToSequence(Task SingleOrDefault( + source: IAsyncEnumerable _ShapedQuery( + queryContext: queryContext, + shaperCommandContext: SelectExpression: + SELECT "e"."Id", "e"."AchievedDate", "e"."AssigneeId", "e"."CollectionId", "e"."CreatedDate", "e"."Description", "e"."GuidProperty", "e"."Ordinal", "e"."OwnerId" + FROM "TodoItems" AS "e" + WHERE "e"."Id" = @__id_0 + LIMIT 2, + shaper: UnbufferedEntityShaper), + cancellationToken: queryContext.CancellationToken)), + queryContext: queryContext, + entityTrackingInfos: { itemType: TodoItem }, + entityAccessors: List> + { + Func, + } + ), + contextType: JsonApiDotNetCoreExample.Data.AppDbContext, + logger: DiagnosticsLogger, + queryContext: queryContext) +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "e"."Id", "e"."AchievedDate", "e"."AssigneeId", "e"."CollectionId", "e"."CreatedDate", "e"."Description", "e"."GuidProperty", "e"."Ordinal", "e"."OwnerId" + FROM "TodoItems" AS "e" + WHERE "e"."Id" = @__id_0 + LIMIT 2 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "e"."Id", "e"."AchievedDate", "e"."AssigneeId", "e"."CollectionId", "e"."CreatedDate", "e"."Description", "e"."GuidProperty", "e"."Ordinal", "e"."OwnerId" + FROM "TodoItems" AS "e" + WHERE "e"."Id" = @__id_0 + LIMIT 2 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "e"."Id", "e"."AchievedDate", "e"."AssigneeId", "e"."CollectionId", "e"."CreatedDate", "e"."Description", "e"."GuidProperty", "e"."Ordinal", "e"."OwnerId" + FROM "TodoItems" AS "e" + WHERE "e"."Id" = @__id_0 + LIMIT 2 +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample), returned result Microsoft.AspNetCore.Mvc.OkObjectResult. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[4] + No information found on request to perform content negotiation. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[2] + Selected output formatter 'JsonApiDotNetCore.Formatters.JsonApiOutputFormatter' and content type '' to write the response. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: JsonApiDotNetCore.Formatters.JsonApiWriter[0] + Formatting response as JSONAPI +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) in 17.158ms +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) in 17.158ms +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 21.735ms 200 application/vnd.api+json +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 21.735ms 200 application/vnd.api+json +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20200] + Beginning transaction with isolation level 'ReadCommitted'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@p0='?', @p1='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "People" ("FirstName", "LastName") + VALUES (@p0, @p1) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p0='?', @p1='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "People" ("FirstName", "LastName") + VALUES (@p0, @p1) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p0='?', @p1='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "People" ("FirstName", "LastName") + VALUES (@p0, @p1) + RETURNING "Id"; +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20202] + Committing transaction. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20204] + Disposing transaction. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20200] + Beginning transaction with isolation level 'ReadCommitted'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6, @p7) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6, @p7) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6, @p7) + RETURNING "Id"; +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20202] + Committing transaction. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20204] + Disposing transaction. +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 PATCH http://localhost/api/v1/todo-items/2595 application/vnd.api+json +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 PATCH http://localhost/api/v1/todo-items/2595 application/vnd.api+json +dbug: Microsoft.AspNetCore.Routing.Tree.TreeRouter[1] + Request successfully matched the route with name '(null)' and template 'api/v1/todo-items/{id}'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample)' with id '432a039f-d92f-4b06-93f6-76d9e6be26be' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.TodoItemsController.DeleteAsync (JsonApiDotNetCoreExample)' with id '75ab2821-99d0-4a3f-9dbb-3747ee7b296e' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action JsonApiDotNetCoreExample.Controllers.TodoItemsController.PatchAsync (JsonApiDotNetCoreExample) +dbug: Microsoft.AspNetCore.Mvc.ModelBinding.Binders.BodyModelBinder[1] + Selected input formatter 'JsonApiDotNetCore.Formatters.JsonApiInputFormatter' for content type 'application/vnd.api+json'. +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.PatchAsync (JsonApiDotNetCoreExample) with arguments (2595, JsonApiDotNetCoreExample.Models.TodoItem) - ModelState is Valid +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.PatchAsync (JsonApiDotNetCoreExample) with arguments (2595, JsonApiDotNetCoreExample.Models.TodoItem) - ModelState is Valid +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "e"."Id", "e"."AchievedDate", "e"."AssigneeId", "e"."CollectionId", "e"."CreatedDate", "e"."Description", "e"."GuidProperty", "e"."Ordinal", "e"."OwnerId" + FROM "TodoItems" AS "e" + WHERE "e"."Id" = @__id_0 + LIMIT 2 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "e"."Id", "e"."AchievedDate", "e"."AssigneeId", "e"."CollectionId", "e"."CreatedDate", "e"."Description", "e"."GuidProperty", "e"."Ordinal", "e"."OwnerId" + FROM "TodoItems" AS "e" + WHERE "e"."Id" = @__id_0 + LIMIT 2 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "e"."Id", "e"."AchievedDate", "e"."AssigneeId", "e"."CollectionId", "e"."CreatedDate", "e"."Description", "e"."GuidProperty", "e"."Ordinal", "e"."OwnerId" + FROM "TodoItems" AS "e" + WHERE "e"."Id" = @__id_0 + LIMIT 2 +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20200] + Beginning transaction with isolation level 'ReadCommitted'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@p3='?', @p0='?', @p1='?', @p2='?'], CommandType='Text', CommandTimeout='30'] + UPDATE "TodoItems" SET "AchievedDate" = @p0, "CreatedDate" = @p1, "Description" = @p2 + WHERE "Id" = @p3; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p3='?', @p0='?', @p1='?', @p2='?'], CommandType='Text', CommandTimeout='30'] + UPDATE "TodoItems" SET "AchievedDate" = @p0, "CreatedDate" = @p1, "Description" = @p2 + WHERE "Id" = @p3; +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p3='?', @p0='?', @p1='?', @p2='?'], CommandType='Text', CommandTimeout='30'] + UPDATE "TodoItems" SET "AchievedDate" = @p0, "CreatedDate" = @p1, "Description" = @p2 + WHERE "Id" = @p3; +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20202] + Committing transaction. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20204] + Disposing transaction. +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.PatchAsync (JsonApiDotNetCoreExample), returned result Microsoft.AspNetCore.Mvc.OkObjectResult. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[4] + No information found on request to perform content negotiation. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[2] + Selected output formatter 'JsonApiDotNetCore.Formatters.JsonApiOutputFormatter' and content type '' to write the response. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: JsonApiDotNetCore.Formatters.JsonApiWriter[0] + Formatting response as JSONAPI +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.TodoItemsController.PatchAsync (JsonApiDotNetCoreExample) in 22.314ms +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 27.243ms 200 application/vnd.api+json +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.TodoItemsController.PatchAsync (JsonApiDotNetCoreExample) in 22.314ms +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 27.243ms 200 application/vnd.api+json +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20200] + Beginning transaction with isolation level 'ReadCommitted'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@p0='?', @p1='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "People" ("FirstName", "LastName") + VALUES (@p0, @p1) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p0='?', @p1='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "People" ("FirstName", "LastName") + VALUES (@p0, @p1) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p0='?', @p1='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "People" ("FirstName", "LastName") + VALUES (@p0, @p1) + RETURNING "Id"; +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?', @p8='?', @p9='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p2, @p3, @p4, @p5, @p6, @p7, @p8, @p9) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?', @p8='?', @p9='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p2, @p3, @p4, @p5, @p6, @p7, @p8, @p9) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?', @p8='?', @p9='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p2, @p3, @p4, @p5, @p6, @p7, @p8, @p9) + RETURNING "Id"; +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20202] + Committing transaction. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20204] + Disposing transaction. +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 GET http://localhost/api/v1/todo-items +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 GET http://localhost/api/v1/todo-items +dbug: Microsoft.AspNetCore.Routing.Tree.TreeRouter[1] + Request successfully matched the route with name '(null)' and template 'api/v1/todo-items'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.TodoItemsController.PostAsync (JsonApiDotNetCoreExample)' with id '2fce3eb8-46a5-44ed-9a98-55e95b5c8e2f' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) with arguments ((null)) - ModelState is Valid +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) with arguments ((null)) - ModelState is Valid +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Query[10101] + Compiling query model: + '(from TodoItem _1 in DbSet + select [_1]).Count()' +dbug: Microsoft.EntityFrameworkCore.Query[10104] + Optimized query model: + '(from TodoItem _1 in DbSet + select [_1]).Count()' +dbug: Microsoft.EntityFrameworkCore.Query[10107] + (QueryContext queryContext) => IAsyncEnumerable _InterceptExceptions( + source: IAsyncEnumerable _ToSequence(Task GetResult( + valueBuffers: IAsyncEnumerable _Query( + queryContext: queryContext, + shaperCommandContext: SelectExpression: + SELECT COUNT(*)::INT4 + FROM "TodoItems" AS "t"), + throwOnNullResult: False, + cancellationToken: queryContext.CancellationToken)), + contextType: JsonApiDotNetCoreExample.Data.AppDbContext, + logger: DiagnosticsLogger, + queryContext: queryContext) +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[], CommandType='Text', CommandTimeout='30'] + SELECT COUNT(*)::INT4 + FROM "TodoItems" AS "t" +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + SELECT COUNT(*)::INT4 + FROM "TodoItems" AS "t" +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + SELECT COUNT(*)::INT4 + FROM "TodoItems" AS "t" +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +info: JsonApiDotNetCore.Services.EntityResourceService[0] + Applying paging query. Fetching page 0 with 5 entities +dbug: Microsoft.EntityFrameworkCore.Query[10101] + Compiling query model: + '(from TodoItem _2 in DbSet + select [_2]) + .Skip(__p_0) + .Take(__p_1)' +warn: Microsoft.EntityFrameworkCore.Query[10102] + Query: '(from TodoItem _2 in DbSet select [_2]).Skip(__p_0).Take(__p_1)' uses a row limiting operation (Skip/Take) without OrderBy which may lead to unpredictable results. +warn: Microsoft.EntityFrameworkCore.Query[10102] + Query: '(from TodoItem _2 in DbSet select [_2]).Skip(__p_0).Take(__p_1)' uses a row limiting operation (Skip/Take) without OrderBy which may lead to unpredictable results. +dbug: Microsoft.EntityFrameworkCore.Query[10104] + Optimized query model: + '(from TodoItem _2 in DbSet + select [_2]) + .Skip(__p_0) + .Take(__p_1)' +dbug: Microsoft.EntityFrameworkCore.Query[10107] + (QueryContext queryContext) => IAsyncEnumerable _InterceptExceptions( + source: IAsyncEnumerable _TrackEntities( + results: IAsyncEnumerable _ShapedQuery( + queryContext: queryContext, + shaperCommandContext: SelectExpression: + SELECT "t"."Id", "t"."AchievedDate", "t"."AssigneeId", "t"."CollectionId", "t"."CreatedDate", "t"."Description", "t"."GuidProperty", "t"."Ordinal", "t"."OwnerId" + FROM "TodoItems" AS "t" + LIMIT @__p_1 OFFSET @__p_0, + shaper: UnbufferedEntityShaper), + queryContext: queryContext, + entityTrackingInfos: { itemType: TodoItem }, + entityAccessors: List> + { + Func, + } + ), + contextType: JsonApiDotNetCoreExample.Data.AppDbContext, + logger: DiagnosticsLogger, + queryContext: queryContext) +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@__p_1='?', @__p_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "t"."Id", "t"."AchievedDate", "t"."AssigneeId", "t"."CollectionId", "t"."CreatedDate", "t"."Description", "t"."GuidProperty", "t"."Ordinal", "t"."OwnerId" + FROM "TodoItems" AS "t" + LIMIT @__p_1 OFFSET @__p_0 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@__p_1='?', @__p_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "t"."Id", "t"."AchievedDate", "t"."AssigneeId", "t"."CollectionId", "t"."CreatedDate", "t"."Description", "t"."GuidProperty", "t"."Ordinal", "t"."OwnerId" + FROM "TodoItems" AS "t" + LIMIT @__p_1 OFFSET @__p_0 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@__p_1='?', @__p_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "t"."Id", "t"."AchievedDate", "t"."AssigneeId", "t"."CollectionId", "t"."CreatedDate", "t"."Description", "t"."GuidProperty", "t"."Ordinal", "t"."OwnerId" + FROM "TodoItems" AS "t" + LIMIT @__p_1 OFFSET @__p_0 +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample), returned result Microsoft.AspNetCore.Mvc.OkObjectResult. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[4] + No information found on request to perform content negotiation. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[2] + Selected output formatter 'JsonApiDotNetCore.Formatters.JsonApiOutputFormatter' and content type '' to write the response. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: JsonApiDotNetCore.Formatters.JsonApiWriter[0] + Formatting response as JSONAPI +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) in 9.452ms +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) in 9.452ms +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 9.891ms 200 application/vnd.api+json +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 9.891ms 200 application/vnd.api+json +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20200] + Beginning transaction with isolation level 'ReadCommitted'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@p0='?', @p1='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "People" ("FirstName", "LastName") + VALUES (@p0, @p1) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p0='?', @p1='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "People" ("FirstName", "LastName") + VALUES (@p0, @p1) + RETURNING "Id"; +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p0='?', @p1='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "People" ("FirstName", "LastName") + VALUES (@p0, @p1) + RETURNING "Id"; +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20202] + Committing transaction. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20204] + Disposing transaction. +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 POST http://localhost/api/v1/todo-items application/vnd.api+json +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 POST http://localhost/api/v1/todo-items application/vnd.api+json +dbug: Microsoft.AspNetCore.Routing.Tree.TreeRouter[1] + Request successfully matched the route with name '(null)' and template 'api/v1/todo-items'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample)' with id 'f11b0d8e-7eb6-44c7-b10f-29a156acd6ba' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action JsonApiDotNetCoreExample.Controllers.TodoItemsController.PostAsync (JsonApiDotNetCoreExample) +dbug: Microsoft.AspNetCore.Mvc.ModelBinding.Binders.BodyModelBinder[1] + Selected input formatter 'JsonApiDotNetCore.Formatters.JsonApiInputFormatter' for content type 'application/vnd.api+json'. +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.PostAsync (JsonApiDotNetCoreExample) with arguments (JsonApiDotNetCoreExample.Models.TodoItem) - ModelState is Valid +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.PostAsync (JsonApiDotNetCoreExample) with arguments (JsonApiDotNetCoreExample.Models.TodoItem) - ModelState is Valid +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20200] + Beginning transaction with isolation level 'ReadCommitted'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6, @p7) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6, @p7) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6, @p7) + RETURNING "Id"; +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20202] + Committing transaction. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20204] + Disposing transaction. +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.PostAsync (JsonApiDotNetCoreExample), returned result Microsoft.AspNetCore.Mvc.CreatedResult. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[4] + No information found on request to perform content negotiation. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[2] + Selected output formatter 'JsonApiDotNetCore.Formatters.JsonApiOutputFormatter' and content type '' to write the response. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: JsonApiDotNetCore.Formatters.JsonApiWriter[0] + Formatting response as JSONAPI +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.TodoItemsController.PostAsync (JsonApiDotNetCoreExample) in 11.535ms +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.TodoItemsController.PostAsync (JsonApiDotNetCoreExample) in 11.535ms +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 16.578ms 201 application/vnd.api+json +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 16.578ms 201 application/vnd.api+json +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20200] + Beginning transaction with isolation level 'ReadCommitted'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@p0='?', @p1='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "People" ("FirstName", "LastName") + VALUES (@p0, @p1) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p0='?', @p1='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "People" ("FirstName", "LastName") + VALUES (@p0, @p1) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p0='?', @p1='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "People" ("FirstName", "LastName") + VALUES (@p0, @p1) + RETURNING "Id"; +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20202] + Committing transaction. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20204] + Disposing transaction. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20200] + Beginning transaction with isolation level 'ReadCommitted'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6, @p7) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6, @p7) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6, @p7) + RETURNING "Id"; +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20202] + Committing transaction. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20204] + Disposing transaction. +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 PATCH http://localhost/api/v1/todo-items/2598 application/vnd.api+json +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 PATCH http://localhost/api/v1/todo-items/2598 application/vnd.api+json +dbug: Microsoft.AspNetCore.Routing.Tree.TreeRouter[1] + Request successfully matched the route with name '(null)' and template 'api/v1/todo-items/{id}'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample)' with id '432a039f-d92f-4b06-93f6-76d9e6be26be' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.TodoItemsController.DeleteAsync (JsonApiDotNetCoreExample)' with id '75ab2821-99d0-4a3f-9dbb-3747ee7b296e' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action JsonApiDotNetCoreExample.Controllers.TodoItemsController.PatchAsync (JsonApiDotNetCoreExample) +dbug: Microsoft.AspNetCore.Mvc.ModelBinding.Binders.BodyModelBinder[1] + Selected input formatter 'JsonApiDotNetCore.Formatters.JsonApiInputFormatter' for content type 'application/vnd.api+json'. +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.PatchAsync (JsonApiDotNetCoreExample) with arguments (2598, JsonApiDotNetCoreExample.Models.TodoItem) - ModelState is Valid +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.PatchAsync (JsonApiDotNetCoreExample) with arguments (2598, JsonApiDotNetCoreExample.Models.TodoItem) - ModelState is Valid +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "e"."Id", "e"."AchievedDate", "e"."AssigneeId", "e"."CollectionId", "e"."CreatedDate", "e"."Description", "e"."GuidProperty", "e"."Ordinal", "e"."OwnerId" + FROM "TodoItems" AS "e" + WHERE "e"."Id" = @__id_0 + LIMIT 2 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "e"."Id", "e"."AchievedDate", "e"."AssigneeId", "e"."CollectionId", "e"."CreatedDate", "e"."Description", "e"."GuidProperty", "e"."Ordinal", "e"."OwnerId" + FROM "TodoItems" AS "e" + WHERE "e"."Id" = @__id_0 + LIMIT 2 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "e"."Id", "e"."AchievedDate", "e"."AssigneeId", "e"."CollectionId", "e"."CreatedDate", "e"."Description", "e"."GuidProperty", "e"."Ordinal", "e"."OwnerId" + FROM "TodoItems" AS "e" + WHERE "e"."Id" = @__id_0 + LIMIT 2 +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20200] + Beginning transaction with isolation level 'ReadCommitted'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@p3='?', @p0='?', @p1='?', @p2='?'], CommandType='Text', CommandTimeout='30'] + UPDATE "TodoItems" SET "AchievedDate" = @p0, "CreatedDate" = @p1, "Description" = @p2 + WHERE "Id" = @p3; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (2ms) [Parameters=[@p3='?', @p0='?', @p1='?', @p2='?'], CommandType='Text', CommandTimeout='30'] + UPDATE "TodoItems" SET "AchievedDate" = @p0, "CreatedDate" = @p1, "Description" = @p2 + WHERE "Id" = @p3; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (2ms) [Parameters=[@p3='?', @p0='?', @p1='?', @p2='?'], CommandType='Text', CommandTimeout='30'] + UPDATE "TodoItems" SET "AchievedDate" = @p0, "CreatedDate" = @p1, "Description" = @p2 + WHERE "Id" = @p3; +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20202] + Committing transaction. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20204] + Disposing transaction. +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.PatchAsync (JsonApiDotNetCoreExample), returned result Microsoft.AspNetCore.Mvc.OkObjectResult. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[4] + No information found on request to perform content negotiation. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[2] + Selected output formatter 'JsonApiDotNetCore.Formatters.JsonApiOutputFormatter' and content type '' to write the response. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: JsonApiDotNetCore.Formatters.JsonApiWriter[0] + Formatting response as JSONAPI +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.TodoItemsController.PatchAsync (JsonApiDotNetCoreExample) in 8.845ms +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.TodoItemsController.PatchAsync (JsonApiDotNetCoreExample) in 8.845ms +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 9.112ms 200 application/vnd.api+json +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 9.112ms 200 application/vnd.api+json +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[], CommandType='Text', CommandTimeout='30'] + SELECT "t"."Id", "t"."AchievedDate", "t"."AssigneeId", "t"."CollectionId", "t"."CreatedDate", "t"."Description", "t"."GuidProperty", "t"."Ordinal", "t"."OwnerId" + FROM "TodoItems" AS "t" +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + SELECT "t"."Id", "t"."AchievedDate", "t"."AssigneeId", "t"."CollectionId", "t"."CreatedDate", "t"."Description", "t"."GuidProperty", "t"."Ordinal", "t"."OwnerId" + FROM "TodoItems" AS "t" +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + SELECT "t"."Id", "t"."AchievedDate", "t"."AssigneeId", "t"."CollectionId", "t"."CreatedDate", "t"."Description", "t"."GuidProperty", "t"."Ordinal", "t"."OwnerId" + FROM "TodoItems" AS "t" +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20200] + Beginning transaction with isolation level 'ReadCommitted'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?', @p8='?', @p9='?', @p10='?', @p11='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "People" ("FirstName", "LastName") + VALUES (@p0, @p1) + RETURNING "Id"; + DELETE FROM "TodoItems" + WHERE "Id" = @p2; + DELETE FROM "TodoItems" + WHERE "Id" = @p3; + DELETE FROM "TodoItems" + WHERE "Id" = @p4; + DELETE FROM "TodoItems" + WHERE "Id" = @p5; + DELETE FROM "TodoItems" + WHERE "Id" = @p6; + DELETE FROM "TodoItems" + WHERE "Id" = @p7; + DELETE FROM "TodoItems" + WHERE "Id" = @p8; + DELETE FROM "TodoItems" + WHERE "Id" = @p9; + DELETE FROM "TodoItems" + WHERE "Id" = @p10; + DELETE FROM "TodoItems" + WHERE "Id" = @p11; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?', @p8='?', @p9='?', @p10='?', @p11='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "People" ("FirstName", "LastName") + VALUES (@p0, @p1) + RETURNING "Id"; + DELETE FROM "TodoItems" + WHERE "Id" = @p2; + DELETE FROM "TodoItems" + WHERE "Id" = @p3; + DELETE FROM "TodoItems" + WHERE "Id" = @p4; + DELETE FROM "TodoItems" + WHERE "Id" = @p5; + DELETE FROM "TodoItems" + WHERE "Id" = @p6; + DELETE FROM "TodoItems" + WHERE "Id" = @p7; + DELETE FROM "TodoItems" + WHERE "Id" = @p8; + DELETE FROM "TodoItems" + WHERE "Id" = @p9; + DELETE FROM "TodoItems" + WHERE "Id" = @p10; + DELETE FROM "TodoItems" + WHERE "Id" = @p11; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?', @p8='?', @p9='?', @p10='?', @p11='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "People" ("FirstName", "LastName") + VALUES (@p0, @p1) + RETURNING "Id"; + DELETE FROM "TodoItems" + WHERE "Id" = @p2; + DELETE FROM "TodoItems" + WHERE "Id" = @p3; + DELETE FROM "TodoItems" + WHERE "Id" = @p4; + DELETE FROM "TodoItems" + WHERE "Id" = @p5; + DELETE FROM "TodoItems" + WHERE "Id" = @p6; + DELETE FROM "TodoItems" + WHERE "Id" = @p7; + DELETE FROM "TodoItems" + WHERE "Id" = @p8; + DELETE FROM "TodoItems" + WHERE "Id" = @p9; + DELETE FROM "TodoItems" + WHERE "Id" = @p10; + DELETE FROM "TodoItems" + WHERE "Id" = @p11; +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@p12='?', @p13='?', @p14='?', @p15='?', @p16='?', @p17='?', @p18='?', @p19='?', @p20='?', @p21='?', @p22='?', @p23='?', @p24='?', @p25='?', @p26='?', @p27='?', @p28='?', @p29='?', @p30='?', @p31='?', @p32='?', @p33='?', @p34='?', @p35='?', @p36='?', @p37='?', @p38='?', @p39='?', @p40='?', @p41='?', @p42='?', @p43='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p12, @p13, @p14, @p15, @p16, @p17, @p18, @p19) + RETURNING "Id"; + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p20, @p21, @p22, @p23, @p24, @p25, @p26, @p27) + RETURNING "Id"; + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p28, @p29, @p30, @p31, @p32, @p33, @p34, @p35) + RETURNING "Id"; + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p36, @p37, @p38, @p39, @p40, @p41, @p42, @p43) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p12='?', @p13='?', @p14='?', @p15='?', @p16='?', @p17='?', @p18='?', @p19='?', @p20='?', @p21='?', @p22='?', @p23='?', @p24='?', @p25='?', @p26='?', @p27='?', @p28='?', @p29='?', @p30='?', @p31='?', @p32='?', @p33='?', @p34='?', @p35='?', @p36='?', @p37='?', @p38='?', @p39='?', @p40='?', @p41='?', @p42='?', @p43='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p12, @p13, @p14, @p15, @p16, @p17, @p18, @p19) + RETURNING "Id"; + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p20, @p21, @p22, @p23, @p24, @p25, @p26, @p27) + RETURNING "Id"; + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p28, @p29, @p30, @p31, @p32, @p33, @p34, @p35) + RETURNING "Id"; + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p36, @p37, @p38, @p39, @p40, @p41, @p42, @p43) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p12='?', @p13='?', @p14='?', @p15='?', @p16='?', @p17='?', @p18='?', @p19='?', @p20='?', @p21='?', @p22='?', @p23='?', @p24='?', @p25='?', @p26='?', @p27='?', @p28='?', @p29='?', @p30='?', @p31='?', @p32='?', @p33='?', @p34='?', @p35='?', @p36='?', @p37='?', @p38='?', @p39='?', @p40='?', @p41='?', @p42='?', @p43='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p12, @p13, @p14, @p15, @p16, @p17, @p18, @p19) + RETURNING "Id"; + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p20, @p21, @p22, @p23, @p24, @p25, @p26, @p27) + RETURNING "Id"; + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p28, @p29, @p30, @p31, @p32, @p33, @p34, @p35) + RETURNING "Id"; + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p36, @p37, @p38, @p39, @p40, @p41, @p42, @p43) + RETURNING "Id"; +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20202] + Committing transaction. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20204] + Disposing transaction. +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 GET http://localhost/api/v1/todo-items?sort=ordinal +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 GET http://localhost/api/v1/todo-items?sort=ordinal +dbug: Microsoft.AspNetCore.Routing.Tree.TreeRouter[1] + Request successfully matched the route with name '(null)' and template 'api/v1/todo-items'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.TodoItemsController.PostAsync (JsonApiDotNetCoreExample)' with id '2fce3eb8-46a5-44ed-9a98-55e95b5c8e2f' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) with arguments ((null)) - ModelState is Valid +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) with arguments ((null)) - ModelState is Valid +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Query[10101] + Compiling query model: + '(from TodoItem x in DbSet + order by [x].Ordinal asc + select [x]).Count()' +dbug: Microsoft.EntityFrameworkCore.Query[10104] + Optimized query model: + '(from TodoItem x in DbSet + select [x]).Count()' +dbug: Microsoft.EntityFrameworkCore.Query[10107] + (QueryContext queryContext) => IAsyncEnumerable _InterceptExceptions( + source: IAsyncEnumerable _ToSequence(Task GetResult( + valueBuffers: IAsyncEnumerable _Query( + queryContext: queryContext, + shaperCommandContext: SelectExpression: + SELECT COUNT(*)::INT4 + FROM "TodoItems" AS "x"), + throwOnNullResult: False, + cancellationToken: queryContext.CancellationToken)), + contextType: JsonApiDotNetCoreExample.Data.AppDbContext, + logger: DiagnosticsLogger, + queryContext: queryContext) +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[], CommandType='Text', CommandTimeout='30'] + SELECT COUNT(*)::INT4 + FROM "TodoItems" AS "x" +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + SELECT COUNT(*)::INT4 + FROM "TodoItems" AS "x" +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + SELECT COUNT(*)::INT4 + FROM "TodoItems" AS "x" +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +info: JsonApiDotNetCore.Services.EntityResourceService[0] + Applying paging query. Fetching page 0 with 5 entities +dbug: Microsoft.EntityFrameworkCore.Query[10101] + Compiling query model: + '(from TodoItem x in DbSet + order by [x].Ordinal asc + select [x]) + .Skip(__p_0) + .Take(__p_1)' +dbug: Microsoft.EntityFrameworkCore.Query[10104] + Optimized query model: + '(from TodoItem x in DbSet + order by [x].Ordinal asc + select [x]) + .Skip(__p_0) + .Take(__p_1)' +dbug: Microsoft.EntityFrameworkCore.Query[10107] + (QueryContext queryContext) => IAsyncEnumerable _InterceptExceptions( + source: IAsyncEnumerable _TrackEntities( + results: IAsyncEnumerable _ShapedQuery( + queryContext: queryContext, + shaperCommandContext: SelectExpression: + SELECT "x"."Id", "x"."AchievedDate", "x"."AssigneeId", "x"."CollectionId", "x"."CreatedDate", "x"."Description", "x"."GuidProperty", "x"."Ordinal", "x"."OwnerId" + FROM "TodoItems" AS "x" + ORDER BY "x"."Ordinal" + LIMIT @__p_1 OFFSET @__p_0, + shaper: UnbufferedEntityShaper), + queryContext: queryContext, + entityTrackingInfos: { itemType: TodoItem }, + entityAccessors: List> + { + Func, + } + ), + contextType: JsonApiDotNetCoreExample.Data.AppDbContext, + logger: DiagnosticsLogger, + queryContext: queryContext) +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@__p_1='?', @__p_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "x"."Id", "x"."AchievedDate", "x"."AssigneeId", "x"."CollectionId", "x"."CreatedDate", "x"."Description", "x"."GuidProperty", "x"."Ordinal", "x"."OwnerId" + FROM "TodoItems" AS "x" + ORDER BY "x"."Ordinal" + LIMIT @__p_1 OFFSET @__p_0 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@__p_1='?', @__p_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "x"."Id", "x"."AchievedDate", "x"."AssigneeId", "x"."CollectionId", "x"."CreatedDate", "x"."Description", "x"."GuidProperty", "x"."Ordinal", "x"."OwnerId" + FROM "TodoItems" AS "x" + ORDER BY "x"."Ordinal" + LIMIT @__p_1 OFFSET @__p_0 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@__p_1='?', @__p_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "x"."Id", "x"."AchievedDate", "x"."AssigneeId", "x"."CollectionId", "x"."CreatedDate", "x"."Description", "x"."GuidProperty", "x"."Ordinal", "x"."OwnerId" + FROM "TodoItems" AS "x" + ORDER BY "x"."Ordinal" + LIMIT @__p_1 OFFSET @__p_0 +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample), returned result Microsoft.AspNetCore.Mvc.OkObjectResult. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[4] + No information found on request to perform content negotiation. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[2] + Selected output formatter 'JsonApiDotNetCore.Formatters.JsonApiOutputFormatter' and content type '' to write the response. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: JsonApiDotNetCore.Formatters.JsonApiWriter[0] + Formatting response as JSONAPI +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) in 14.927ms +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) in 14.927ms +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 15.301ms 200 application/vnd.api+json +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 15.301ms 200 application/vnd.api+json +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20200] + Beginning transaction with isolation level 'ReadCommitted'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@p0='?', @p1='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "People" ("FirstName", "LastName") + VALUES (@p0, @p1) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p0='?', @p1='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "People" ("FirstName", "LastName") + VALUES (@p0, @p1) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p0='?', @p1='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "People" ("FirstName", "LastName") + VALUES (@p0, @p1) + RETURNING "Id"; +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20202] + Committing transaction. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20204] + Disposing transaction. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20200] + Beginning transaction with isolation level 'ReadCommitted'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6, @p7) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6, @p7) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6, @p7) + RETURNING "Id"; +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20202] + Committing transaction. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20204] + Disposing transaction. +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 PATCH http://localhost/api/v1/todo-items/2603 application/vnd.api+json +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 PATCH http://localhost/api/v1/todo-items/2603 application/vnd.api+json +dbug: Microsoft.AspNetCore.Routing.Tree.TreeRouter[1] + Request successfully matched the route with name '(null)' and template 'api/v1/todo-items/{id}'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample)' with id '432a039f-d92f-4b06-93f6-76d9e6be26be' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.TodoItemsController.DeleteAsync (JsonApiDotNetCoreExample)' with id '75ab2821-99d0-4a3f-9dbb-3747ee7b296e' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action JsonApiDotNetCoreExample.Controllers.TodoItemsController.PatchAsync (JsonApiDotNetCoreExample) +dbug: Microsoft.AspNetCore.Mvc.ModelBinding.Binders.BodyModelBinder[1] + Selected input formatter 'JsonApiDotNetCore.Formatters.JsonApiInputFormatter' for content type 'application/vnd.api+json'. +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.PatchAsync (JsonApiDotNetCoreExample) with arguments (2603, JsonApiDotNetCoreExample.Models.TodoItem) - ModelState is Valid +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.PatchAsync (JsonApiDotNetCoreExample) with arguments (2603, JsonApiDotNetCoreExample.Models.TodoItem) - ModelState is Valid +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "e"."Id", "e"."AchievedDate", "e"."AssigneeId", "e"."CollectionId", "e"."CreatedDate", "e"."Description", "e"."GuidProperty", "e"."Ordinal", "e"."OwnerId" + FROM "TodoItems" AS "e" + WHERE "e"."Id" = @__id_0 + LIMIT 2 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "e"."Id", "e"."AchievedDate", "e"."AssigneeId", "e"."CollectionId", "e"."CreatedDate", "e"."Description", "e"."GuidProperty", "e"."Ordinal", "e"."OwnerId" + FROM "TodoItems" AS "e" + WHERE "e"."Id" = @__id_0 + LIMIT 2 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "e"."Id", "e"."AchievedDate", "e"."AssigneeId", "e"."CollectionId", "e"."CreatedDate", "e"."Description", "e"."GuidProperty", "e"."Ordinal", "e"."OwnerId" + FROM "TodoItems" AS "e" + WHERE "e"."Id" = @__id_0 + LIMIT 2 +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20200] + Beginning transaction with isolation level 'ReadCommitted'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@p3='?', @p0='?', @p1='?', @p2='?'], CommandType='Text', CommandTimeout='30'] + UPDATE "TodoItems" SET "CreatedDate" = @p0, "Description" = @p1, "Ordinal" = @p2 + WHERE "Id" = @p3; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p3='?', @p0='?', @p1='?', @p2='?'], CommandType='Text', CommandTimeout='30'] + UPDATE "TodoItems" SET "CreatedDate" = @p0, "Description" = @p1, "Ordinal" = @p2 + WHERE "Id" = @p3; +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p3='?', @p0='?', @p1='?', @p2='?'], CommandType='Text', CommandTimeout='30'] + UPDATE "TodoItems" SET "CreatedDate" = @p0, "Description" = @p1, "Ordinal" = @p2 + WHERE "Id" = @p3; +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20202] + Committing transaction. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20204] + Disposing transaction. +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.PatchAsync (JsonApiDotNetCoreExample), returned result Microsoft.AspNetCore.Mvc.OkObjectResult. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[4] + No information found on request to perform content negotiation. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[2] + Selected output formatter 'JsonApiDotNetCore.Formatters.JsonApiOutputFormatter' and content type '' to write the response. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: JsonApiDotNetCore.Formatters.JsonApiWriter[0] + Formatting response as JSONAPI +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.TodoItemsController.PatchAsync (JsonApiDotNetCoreExample) in 5.286ms +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.TodoItemsController.PatchAsync (JsonApiDotNetCoreExample) in 5.286ms +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 5.705ms 200 application/vnd.api+json +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 5.705ms 200 application/vnd.api+json +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20200] + Beginning transaction with isolation level 'ReadCommitted'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@p0='?', @p1='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "People" ("FirstName", "LastName") + VALUES (@p0, @p1) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p0='?', @p1='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "People" ("FirstName", "LastName") + VALUES (@p0, @p1) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p0='?', @p1='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "People" ("FirstName", "LastName") + VALUES (@p0, @p1) + RETURNING "Id"; +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20202] + Committing transaction. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20204] + Disposing transaction. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20200] + Beginning transaction with isolation level 'ReadCommitted'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6, @p7) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6, @p7) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6, @p7) + RETURNING "Id"; +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20202] + Committing transaction. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20204] + Disposing transaction. +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 DELETE http://localhost/api/v1/todo-items/2604 application/vnd.api+json +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 DELETE http://localhost/api/v1/todo-items/2604 application/vnd.api+json +dbug: Microsoft.AspNetCore.Routing.Tree.TreeRouter[1] + Request successfully matched the route with name '(null)' and template 'api/v1/todo-items/{id}'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample)' with id '432a039f-d92f-4b06-93f6-76d9e6be26be' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.TodoItemsController.PatchAsync (JsonApiDotNetCoreExample)' with id '1ee61db8-daf4-41f3-90d2-1cf3db87d448' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action JsonApiDotNetCoreExample.Controllers.TodoItemsController.DeleteAsync (JsonApiDotNetCoreExample) +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.DeleteAsync (JsonApiDotNetCoreExample) with arguments (2604) - ModelState is Valid +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.DeleteAsync (JsonApiDotNetCoreExample) with arguments (2604) - ModelState is Valid +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "e"."Id", "e"."AchievedDate", "e"."AssigneeId", "e"."CollectionId", "e"."CreatedDate", "e"."Description", "e"."GuidProperty", "e"."Ordinal", "e"."OwnerId" + FROM "TodoItems" AS "e" + WHERE "e"."Id" = @__id_0 + LIMIT 2 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "e"."Id", "e"."AchievedDate", "e"."AssigneeId", "e"."CollectionId", "e"."CreatedDate", "e"."Description", "e"."GuidProperty", "e"."Ordinal", "e"."OwnerId" + FROM "TodoItems" AS "e" + WHERE "e"."Id" = @__id_0 + LIMIT 2 +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "e"."Id", "e"."AchievedDate", "e"."AssigneeId", "e"."CollectionId", "e"."CreatedDate", "e"."Description", "e"."GuidProperty", "e"."Ordinal", "e"."OwnerId" + FROM "TodoItems" AS "e" + WHERE "e"."Id" = @__id_0 + LIMIT 2 +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20200] + Beginning transaction with isolation level 'ReadCommitted'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@p0='?'], CommandType='Text', CommandTimeout='30'] + DELETE FROM "TodoItems" + WHERE "Id" = @p0; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p0='?'], CommandType='Text', CommandTimeout='30'] + DELETE FROM "TodoItems" + WHERE "Id" = @p0; +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p0='?'], CommandType='Text', CommandTimeout='30'] + DELETE FROM "TodoItems" + WHERE "Id" = @p0; +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20202] + Committing transaction. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20204] + Disposing transaction. +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.DeleteAsync (JsonApiDotNetCoreExample), returned result Microsoft.AspNetCore.Mvc.NoContentResult. +info: Microsoft.AspNetCore.Mvc.StatusCodeResult[1] + Executing HttpStatusCodeResult, setting HTTP status code 204 +info: Microsoft.AspNetCore.Mvc.StatusCodeResult[1] + Executing HttpStatusCodeResult, setting HTTP status code 204 +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.TodoItemsController.DeleteAsync (JsonApiDotNetCoreExample) in 20.385ms +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.TodoItemsController.DeleteAsync (JsonApiDotNetCoreExample) in 20.385ms +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 24.713ms 204 +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 24.713ms 204 +dbug: Microsoft.EntityFrameworkCore.Query[10101] + Compiling query model: + '(from TodoItem t in DbSet + where [t].Id == __todoItem_Id_0 + select [t]).FirstOrDefault()' +dbug: Microsoft.EntityFrameworkCore.Query[10104] + Optimized query model: + '(from TodoItem t in DbSet + where [t].Id == __todoItem_Id_0 + select [t]).FirstOrDefault()' +dbug: Microsoft.EntityFrameworkCore.Query[10107] + (QueryContext queryContext) => IEnumerable _InterceptExceptions( + source: IEnumerable _TrackEntities( + results: IEnumerable _ToSequence(TodoItem FirstOrDefault(IEnumerable _ShapedQuery( + queryContext: queryContext, + shaperCommandContext: SelectExpression: + SELECT "t"."Id", "t"."AchievedDate", "t"."AssigneeId", "t"."CollectionId", "t"."CreatedDate", "t"."Description", "t"."GuidProperty", "t"."Ordinal", "t"."OwnerId" + FROM "TodoItems" AS "t" + WHERE "t"."Id" = @__todoItem_Id_0 + LIMIT 1, + shaper: UnbufferedEntityShaper))), + queryContext: queryContext, + entityTrackingInfos: { itemType: TodoItem }, + entityAccessors: List> + { + Func, + } + ), + contextType: JsonApiDotNetCoreExample.Data.AppDbContext, + logger: DiagnosticsLogger, + queryContext: queryContext) +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@__todoItem_Id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "t"."Id", "t"."AchievedDate", "t"."AssigneeId", "t"."CollectionId", "t"."CreatedDate", "t"."Description", "t"."GuidProperty", "t"."Ordinal", "t"."OwnerId" + FROM "TodoItems" AS "t" + WHERE "t"."Id" = @__todoItem_Id_0 + LIMIT 1 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@__todoItem_Id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "t"."Id", "t"."AchievedDate", "t"."AssigneeId", "t"."CollectionId", "t"."CreatedDate", "t"."Description", "t"."GuidProperty", "t"."Ordinal", "t"."OwnerId" + FROM "TodoItems" AS "t" + WHERE "t"."Id" = @__todoItem_Id_0 + LIMIT 1 +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@__todoItem_Id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "t"."Id", "t"."AchievedDate", "t"."AssigneeId", "t"."CollectionId", "t"."CreatedDate", "t"."Description", "t"."GuidProperty", "t"."Ordinal", "t"."OwnerId" + FROM "TodoItems" AS "t" + WHERE "t"."Id" = @__todoItem_Id_0 + LIMIT 1 +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20200] + Beginning transaction with isolation level 'ReadCommitted'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@p0='?', @p1='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "People" ("FirstName", "LastName") + VALUES (@p0, @p1) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p0='?', @p1='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "People" ("FirstName", "LastName") + VALUES (@p0, @p1) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p0='?', @p1='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "People" ("FirstName", "LastName") + VALUES (@p0, @p1) + RETURNING "Id"; +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?', @p8='?', @p9='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p2, @p3, @p4, @p5, @p6, @p7, @p8, @p9) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?', @p8='?', @p9='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p2, @p3, @p4, @p5, @p6, @p7, @p8, @p9) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?', @p8='?', @p9='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p2, @p3, @p4, @p5, @p6, @p7, @p8, @p9) + RETURNING "Id"; +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20202] + Committing transaction. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20204] + Disposing transaction. +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 GET http://localhost/api/v1/todo-items/2605?include=owner +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 GET http://localhost/api/v1/todo-items/2605?include=owner +dbug: Microsoft.AspNetCore.Routing.Tree.TreeRouter[1] + Request successfully matched the route with name '(null)' and template 'api/v1/todo-items/{id}'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.TodoItemsController.PatchAsync (JsonApiDotNetCoreExample)' with id '1ee61db8-daf4-41f3-90d2-1cf3db87d448' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.TodoItemsController.DeleteAsync (JsonApiDotNetCoreExample)' with id '75ab2821-99d0-4a3f-9dbb-3747ee7b296e' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) with arguments (2605) - ModelState is Valid +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) with arguments (2605) - ModelState is Valid +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Query[10101] + Compiling query model: + '(from TodoItem e in DbSet + where bool [e].Id.Equals((object)__id_0) + select [e]) + .Include("Owner") + .FirstOrDefault()' +dbug: Microsoft.EntityFrameworkCore.Query[10105] + Including navigation: '[e].Owner' +dbug: Microsoft.EntityFrameworkCore.Query[10104] + Optimized query model: + '(from TodoItem e in DbSet + join Person e.Owner in DbSet + on Property([e], "OwnerId") equals (Nullable)Property([e.Owner], "Id") into e.Owner_group + from Person e.Owner in + (from Person e.Owner_groupItem in [e.Owner_group] + select [e.Owner_groupItem]).DefaultIfEmpty() + where bool [e].Id.Equals((object)__id_0) + select TodoItem _Include( + queryContext: queryContext, + entity: [e], + included: new object[]{ [e.Owner] }, + fixup: (QueryContext queryContext | TodoItem entity | Object[] included) => + { + Void queryContext.QueryBuffer.StartTracking( + entity: entity, + entityType: EntityType: TodoItem) + return !(bool ReferenceEquals(included[0], null)) ? + { + Void queryContext.QueryBuffer.StartTracking( + entity: included[0], + entityType: EntityType: Person) + Void SetRelationshipSnapshotValue( + stateManager: queryContext.StateManager, + navigation: TodoItem.Owner, + entity: entity, + value: included[0]) + return Void AddToCollectionSnapshot( + stateManager: queryContext.StateManager, + navigation: Person.TodoItems, + entity: included[0], + value: entity) + } + : default(Void) + } + )).FirstOrDefault()' +dbug: Microsoft.EntityFrameworkCore.Query[10107] + (QueryContext queryContext) => IAsyncEnumerable _InterceptExceptions( + source: IAsyncEnumerable _TrackEntities( + results: IAsyncEnumerable _ToSequence(Task FirstOrDefault( + source: IAsyncEnumerable _Select( + source: IAsyncEnumerable> _ShapedQuery( + queryContext: queryContext, + shaperCommandContext: SelectExpression: + SELECT "e"."Id", "e"."AchievedDate", "e"."AssigneeId", "e"."CollectionId", "e"."CreatedDate", "e"."Description", "e"."GuidProperty", "e"."Ordinal", "e"."OwnerId", "e.Owner"."Id", "e.Owner"."FirstName", "e.Owner"."LastName" + FROM "TodoItems" AS "e" + LEFT JOIN "People" AS "e.Owner" ON "e"."OwnerId" = "e.Owner"."Id" + WHERE "e"."Id" = @__id_0 + LIMIT 1, + shaper: TypedCompositeShaper, TodoItem, BufferedOffsetEntityShaper, Person, TransparentIdentifier>), + selector: (TransparentIdentifier t1) => TodoItem _Include( + queryContext: queryContext, + entity: t1.Outer, + included: new object[]{ t1.Inner }, + fixup: (QueryContext queryContext | TodoItem entity | Object[] included) => + { + Void queryContext.QueryBuffer.StartTracking( + entity: entity, + entityType: EntityType: TodoItem) + return !(bool ReferenceEquals(included[0], null)) ? + { + Void queryContext.QueryBuffer.StartTracking( + entity: included[0], + entityType: EntityType: Person) + Void SetRelationshipSnapshotValue( + stateManager: queryContext.StateManager, + navigation: TodoItem.Owner, + entity: entity, + value: included[0]) + return Void AddToCollectionSnapshot( + stateManager: queryContext.StateManager, + navigation: Person.TodoItems, + entity: included[0], + value: entity) + } + : default(Void) + } + )), + cancellationToken: Unhandled parameter: queryContext.CancellationToken)), + queryContext: Unhandled parameter: queryContext, + entityTrackingInfos: { itemType: TodoItem }, + entityAccessors: List> + { + Func, + } + ), + contextType: JsonApiDotNetCoreExample.Data.AppDbContext, + logger: DiagnosticsLogger, + queryContext: Unhandled parameter: queryContext) +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "e"."Id", "e"."AchievedDate", "e"."AssigneeId", "e"."CollectionId", "e"."CreatedDate", "e"."Description", "e"."GuidProperty", "e"."Ordinal", "e"."OwnerId", "e.Owner"."Id", "e.Owner"."FirstName", "e.Owner"."LastName" + FROM "TodoItems" AS "e" + LEFT JOIN "People" AS "e.Owner" ON "e"."OwnerId" = "e.Owner"."Id" + WHERE "e"."Id" = @__id_0 + LIMIT 1 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (2ms) [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "e"."Id", "e"."AchievedDate", "e"."AssigneeId", "e"."CollectionId", "e"."CreatedDate", "e"."Description", "e"."GuidProperty", "e"."Ordinal", "e"."OwnerId", "e.Owner"."Id", "e.Owner"."FirstName", "e.Owner"."LastName" + FROM "TodoItems" AS "e" + LEFT JOIN "People" AS "e.Owner" ON "e"."OwnerId" = "e.Owner"."Id" + WHERE "e"."Id" = @__id_0 + LIMIT 1 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (2ms) [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "e"."Id", "e"."AchievedDate", "e"."AssigneeId", "e"."CollectionId", "e"."CreatedDate", "e"."Description", "e"."GuidProperty", "e"."Ordinal", "e"."OwnerId", "e.Owner"."Id", "e.Owner"."FirstName", "e.Owner"."LastName" + FROM "TodoItems" AS "e" + LEFT JOIN "People" AS "e.Owner" ON "e"."OwnerId" = "e.Owner"."Id" + WHERE "e"."Id" = @__id_0 + LIMIT 1 +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample), returned result Microsoft.AspNetCore.Mvc.OkObjectResult. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[4] + No information found on request to perform content negotiation. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[2] + Selected output formatter 'JsonApiDotNetCore.Formatters.JsonApiOutputFormatter' and content type '' to write the response. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: JsonApiDotNetCore.Formatters.JsonApiWriter[0] + Formatting response as JSONAPI +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) in 225.239ms +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 225.49ms 200 application/vnd.api+json +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) in 225.239ms +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 225.49ms 200 application/vnd.api+json +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20200] + Beginning transaction with isolation level 'ReadCommitted'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6, @p7) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6, @p7) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6, @p7) + RETURNING "Id"; +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20202] + Committing transaction. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20204] + Disposing transaction. +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 GET http://localhost/api/v1/todo-items?filter[description]=like:ui%20eum%20quo%20sit%20fugiat +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 GET http://localhost/api/v1/todo-items?filter[description]=like:ui%20eum%20quo%20sit%20fugiat +dbug: Microsoft.AspNetCore.Routing.Tree.TreeRouter[1] + Request successfully matched the route with name '(null)' and template 'api/v1/todo-items'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.TodoItemsController.PostAsync (JsonApiDotNetCoreExample)' with id '2fce3eb8-46a5-44ed-9a98-55e95b5c8e2f' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) with arguments ((null)) - ModelState is Valid +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) with arguments ((null)) - ModelState is Valid +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Query[10101] + Compiling query model: + '(from TodoItem model in DbSet + where bool [model].Description.Contains("ui eum quo sit fugiat") + select [model]).Count()' +dbug: Microsoft.EntityFrameworkCore.Query[10104] + Optimized query model: + '(from TodoItem model in DbSet + where bool [model].Description.Contains("ui eum quo sit fugiat") + select [model]).Count()' +dbug: Microsoft.EntityFrameworkCore.Query[10107] + (QueryContext queryContext) => IAsyncEnumerable _InterceptExceptions( + source: IAsyncEnumerable _ToSequence(Task GetResult( + valueBuffers: IAsyncEnumerable _Query( + queryContext: queryContext, + shaperCommandContext: SelectExpression: + SELECT COUNT(*)::INT4 + FROM "TodoItems" AS "model" + WHERE STRPOS("model"."Description", 'ui eum quo sit fugiat') > 0), + throwOnNullResult: False, + cancellationToken: queryContext.CancellationToken)), + contextType: JsonApiDotNetCoreExample.Data.AppDbContext, + logger: DiagnosticsLogger, + queryContext: queryContext) +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[], CommandType='Text', CommandTimeout='30'] + SELECT COUNT(*)::INT4 + FROM "TodoItems" AS "model" + WHERE STRPOS("model"."Description", 'ui eum quo sit fugiat') > 0 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + SELECT COUNT(*)::INT4 + FROM "TodoItems" AS "model" + WHERE STRPOS("model"."Description", 'ui eum quo sit fugiat') > 0 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + SELECT COUNT(*)::INT4 + FROM "TodoItems" AS "model" + WHERE STRPOS("model"."Description", 'ui eum quo sit fugiat') > 0 +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +info: JsonApiDotNetCore.Services.EntityResourceService[0] + Applying paging query. Fetching page 0 with 5 entities +dbug: Microsoft.EntityFrameworkCore.Query[10101] + Compiling query model: + '(from TodoItem model in DbSet + where bool [model].Description.Contains("ui eum quo sit fugiat") + select [model]) + .Skip(__p_0) + .Take(__p_1)' +warn: Microsoft.EntityFrameworkCore.Query[10102] + Query: '(from TodoItem model in DbSet where bool [model].Description.Contains("ui eum quo sit fugi...' uses a row limiting operation (Skip/Take) without OrderBy which may lead to unpredictable results. +warn: Microsoft.EntityFrameworkCore.Query[10102] + Query: '(from TodoItem model in DbSet where bool [model].Description.Contains("ui eum quo sit fugi...' uses a row limiting operation (Skip/Take) without OrderBy which may lead to unpredictable results. +dbug: Microsoft.EntityFrameworkCore.Query[10104] + Optimized query model: + '(from TodoItem model in DbSet + where bool [model].Description.Contains("ui eum quo sit fugiat") + select [model]) + .Skip(__p_0) + .Take(__p_1)' +dbug: Microsoft.EntityFrameworkCore.Query[10107] + (QueryContext queryContext) => IAsyncEnumerable _InterceptExceptions( + source: IAsyncEnumerable _TrackEntities( + results: IAsyncEnumerable _ShapedQuery( + queryContext: queryContext, + shaperCommandContext: SelectExpression: + SELECT "model"."Id", "model"."AchievedDate", "model"."AssigneeId", "model"."CollectionId", "model"."CreatedDate", "model"."Description", "model"."GuidProperty", "model"."Ordinal", "model"."OwnerId" + FROM "TodoItems" AS "model" + WHERE STRPOS("model"."Description", 'ui eum quo sit fugiat') > 0 + LIMIT @__p_1 OFFSET @__p_0, + shaper: UnbufferedEntityShaper), + queryContext: queryContext, + entityTrackingInfos: { itemType: TodoItem }, + entityAccessors: List> + { + Func, + } + ), + contextType: JsonApiDotNetCoreExample.Data.AppDbContext, + logger: DiagnosticsLogger, + queryContext: queryContext) +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@__p_1='?', @__p_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "model"."Id", "model"."AchievedDate", "model"."AssigneeId", "model"."CollectionId", "model"."CreatedDate", "model"."Description", "model"."GuidProperty", "model"."Ordinal", "model"."OwnerId" + FROM "TodoItems" AS "model" + WHERE STRPOS("model"."Description", 'ui eum quo sit fugiat') > 0 + LIMIT @__p_1 OFFSET @__p_0 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@__p_1='?', @__p_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "model"."Id", "model"."AchievedDate", "model"."AssigneeId", "model"."CollectionId", "model"."CreatedDate", "model"."Description", "model"."GuidProperty", "model"."Ordinal", "model"."OwnerId" + FROM "TodoItems" AS "model" + WHERE STRPOS("model"."Description", 'ui eum quo sit fugiat') > 0 + LIMIT @__p_1 OFFSET @__p_0 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@__p_1='?', @__p_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "model"."Id", "model"."AchievedDate", "model"."AssigneeId", "model"."CollectionId", "model"."CreatedDate", "model"."Description", "model"."GuidProperty", "model"."Ordinal", "model"."OwnerId" + FROM "TodoItems" AS "model" + WHERE STRPOS("model"."Description", 'ui eum quo sit fugiat') > 0 + LIMIT @__p_1 OFFSET @__p_0 +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample), returned result Microsoft.AspNetCore.Mvc.OkObjectResult. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[4] + No information found on request to perform content negotiation. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[2] + Selected output formatter 'JsonApiDotNetCore.Formatters.JsonApiOutputFormatter' and content type '' to write the response. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: JsonApiDotNetCore.Formatters.JsonApiWriter[0] + Formatting response as JSONAPI +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) in 21.347ms +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) in 21.347ms +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 22.376ms 200 application/vnd.api+json +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 22.376ms 200 application/vnd.api+json +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20200] + Beginning transaction with isolation level 'ReadCommitted'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@p0='?', @p1='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "People" ("FirstName", "LastName") + VALUES (@p0, @p1) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p0='?', @p1='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "People" ("FirstName", "LastName") + VALUES (@p0, @p1) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p0='?', @p1='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "People" ("FirstName", "LastName") + VALUES (@p0, @p1) + RETURNING "Id"; +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?', @p8='?', @p9='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p2, @p3, @p4, @p5, @p6, @p7, @p8, @p9) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?', @p8='?', @p9='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p2, @p3, @p4, @p5, @p6, @p7, @p8, @p9) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?', @p8='?', @p9='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p2, @p3, @p4, @p5, @p6, @p7, @p8, @p9) + RETURNING "Id"; +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20202] + Committing transaction. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20204] + Disposing transaction. +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 GET http://localhost/api/v1/todo-items?include=owner&filter[owner.first-name]=Crawford +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 GET http://localhost/api/v1/todo-items?include=owner&filter[owner.first-name]=Crawford +dbug: Microsoft.AspNetCore.Routing.Tree.TreeRouter[1] + Request successfully matched the route with name '(null)' and template 'api/v1/todo-items'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.TodoItemsController.PostAsync (JsonApiDotNetCoreExample)' with id '2fce3eb8-46a5-44ed-9a98-55e95b5c8e2f' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) with arguments ((null)) - ModelState is Valid +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) with arguments ((null)) - ModelState is Valid +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Query[10101] + Compiling query model: + '(from TodoItem model in DbSet + where [model].Owner.FirstName == "Crawford" + select [model]) + .Include("Owner") + .Count()' +warn: Microsoft.EntityFrameworkCore.Query[10106] + The Include operation for navigation '[model].Owner' is unnecessary and was ignored because the navigation is not reachable in the final query results. See https://go.microsoft.com/fwlink/?linkid=850303 for more information. +warn: Microsoft.EntityFrameworkCore.Query[10106] + The Include operation for navigation '[model].Owner' is unnecessary and was ignored because the navigation is not reachable in the final query results. See https://go.microsoft.com/fwlink/?linkid=850303 for more information. +dbug: Microsoft.EntityFrameworkCore.Query[10104] + Optimized query model: + '(from TodoItem model in DbSet + join Person model.Owner in DbSet + on Property([model], "OwnerId") equals (Nullable)Property([model.Owner], "Id") into model.Owner_group + from Person model.Owner in + (from Person model.Owner_groupItem in [model.Owner_group] + select [model.Owner_groupItem]).DefaultIfEmpty() + where [model.Owner]?.FirstName == "Crawford" + select [model]).Count()' +dbug: Microsoft.EntityFrameworkCore.Query[10107] + (QueryContext queryContext) => IAsyncEnumerable _InterceptExceptions( + source: IAsyncEnumerable _ToSequence(Task GetResult( + valueBuffers: IAsyncEnumerable _Query( + queryContext: queryContext, + shaperCommandContext: SelectExpression: + SELECT COUNT(*)::INT4 + FROM "TodoItems" AS "model" + LEFT JOIN "People" AS "model.Owner" ON "model"."OwnerId" = "model.Owner"."Id" + WHERE "model.Owner"."FirstName" = 'Crawford'), + throwOnNullResult: False, + cancellationToken: queryContext.CancellationToken)), + contextType: JsonApiDotNetCoreExample.Data.AppDbContext, + logger: DiagnosticsLogger, + queryContext: queryContext) +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[], CommandType='Text', CommandTimeout='30'] + SELECT COUNT(*)::INT4 + FROM "TodoItems" AS "model" + LEFT JOIN "People" AS "model.Owner" ON "model"."OwnerId" = "model.Owner"."Id" + WHERE "model.Owner"."FirstName" = 'Crawford' +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + SELECT COUNT(*)::INT4 + FROM "TodoItems" AS "model" + LEFT JOIN "People" AS "model.Owner" ON "model"."OwnerId" = "model.Owner"."Id" + WHERE "model.Owner"."FirstName" = 'Crawford' +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +info: JsonApiDotNetCore.Services.EntityResourceService[0] + Applying paging query. Fetching page 0 with 5 entities +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + SELECT COUNT(*)::INT4 + FROM "TodoItems" AS "model" + LEFT JOIN "People" AS "model.Owner" ON "model"."OwnerId" = "model.Owner"."Id" + WHERE "model.Owner"."FirstName" = 'Crawford' +dbug: Microsoft.EntityFrameworkCore.Query[10101] + Compiling query model: + '(from TodoItem model in DbSet + where [model].Owner.FirstName == "Crawford" + select [model]) + .Include("Owner") + .Skip(__p_0) + .Take(__p_1)' +warn: Microsoft.EntityFrameworkCore.Query[10102] + Query: '(from TodoItem model in DbSet where [model].Owner.FirstName == "Crawford" select [model])....' uses a row limiting operation (Skip/Take) without OrderBy which may lead to unpredictable results. +warn: Microsoft.EntityFrameworkCore.Query[10102] + Query: '(from TodoItem model in DbSet where [model].Owner.FirstName == "Crawford" select [model])....' uses a row limiting operation (Skip/Take) without OrderBy which may lead to unpredictable results. +dbug: Microsoft.EntityFrameworkCore.Query[10105] + Including navigation: '[model].Owner' +dbug: Microsoft.EntityFrameworkCore.Query[10104] + Optimized query model: + '(from TodoItem model in DbSet + join Person model.Owner in DbSet + on Property([model], "OwnerId") equals (Nullable)Property([model.Owner], "Id") into model.Owner_group + from Person model.Owner in + (from Person model.Owner_groupItem in [model.Owner_group] + select [model.Owner_groupItem]).DefaultIfEmpty() + where [model.Owner]?.FirstName == "Crawford" + select TodoItem _Include( + queryContext: queryContext, + entity: [model], + included: new object[]{ [model.Owner] }, + fixup: (QueryContext queryContext | TodoItem entity | Object[] included) => + { + Void queryContext.QueryBuffer.StartTracking( + entity: entity, + entityType: EntityType: TodoItem) + return !(bool ReferenceEquals(included[0], null)) ? + { + Void queryContext.QueryBuffer.StartTracking( + entity: included[0], + entityType: EntityType: Person) + Void SetRelationshipSnapshotValue( + stateManager: queryContext.StateManager, + navigation: TodoItem.Owner, + entity: entity, + value: included[0]) + return Void AddToCollectionSnapshot( + stateManager: queryContext.StateManager, + navigation: Person.TodoItems, + entity: included[0], + value: entity) + } + : default(Void) + } + )) + .Skip(__p_0) + .Take(__p_1)' +dbug: Microsoft.EntityFrameworkCore.Query[10107] + (QueryContext queryContext) => IAsyncEnumerable _InterceptExceptions( + source: IAsyncEnumerable _TrackEntities( + results: IAsyncEnumerable _Select( + source: IAsyncEnumerable> _ShapedQuery( + queryContext: queryContext, + shaperCommandContext: SelectExpression: + SELECT "model"."Id", "model"."AchievedDate", "model"."AssigneeId", "model"."CollectionId", "model"."CreatedDate", "model"."Description", "model"."GuidProperty", "model"."Ordinal", "model"."OwnerId", "model.Owner"."Id", "model.Owner"."FirstName", "model.Owner"."LastName" + FROM "TodoItems" AS "model" + LEFT JOIN "People" AS "model.Owner" ON "model"."OwnerId" = "model.Owner"."Id" + WHERE "model.Owner"."FirstName" = 'Crawford' + LIMIT @__p_1 OFFSET @__p_0, + shaper: TypedCompositeShaper, TodoItem, BufferedOffsetEntityShaper, Person, TransparentIdentifier>), + selector: (TransparentIdentifier t1) => TodoItem _Include( + queryContext: queryContext, + entity: t1.Outer, + included: new object[]{ t1.Inner }, + fixup: (QueryContext queryContext | TodoItem entity | Object[] included) => + { + Void queryContext.QueryBuffer.StartTracking( + entity: entity, + entityType: EntityType: TodoItem) + return !(bool ReferenceEquals(included[0], null)) ? + { + Void queryContext.QueryBuffer.StartTracking( + entity: included[0], + entityType: EntityType: Person) + Void SetRelationshipSnapshotValue( + stateManager: queryContext.StateManager, + navigation: TodoItem.Owner, + entity: entity, + value: included[0]) + return Void AddToCollectionSnapshot( + stateManager: queryContext.StateManager, + navigation: Person.TodoItems, + entity: included[0], + value: entity) + } + : default(Void) + } + )), + queryContext: Unhandled parameter: queryContext, + entityTrackingInfos: { itemType: TodoItem }, + entityAccessors: List> + { + Func, + } + ), + contextType: JsonApiDotNetCoreExample.Data.AppDbContext, + logger: DiagnosticsLogger, + queryContext: Unhandled parameter: queryContext) +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@__p_1='?', @__p_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "model"."Id", "model"."AchievedDate", "model"."AssigneeId", "model"."CollectionId", "model"."CreatedDate", "model"."Description", "model"."GuidProperty", "model"."Ordinal", "model"."OwnerId", "model.Owner"."Id", "model.Owner"."FirstName", "model.Owner"."LastName" + FROM "TodoItems" AS "model" + LEFT JOIN "People" AS "model.Owner" ON "model"."OwnerId" = "model.Owner"."Id" + WHERE "model.Owner"."FirstName" = 'Crawford' + LIMIT @__p_1 OFFSET @__p_0 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@__p_1='?', @__p_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "model"."Id", "model"."AchievedDate", "model"."AssigneeId", "model"."CollectionId", "model"."CreatedDate", "model"."Description", "model"."GuidProperty", "model"."Ordinal", "model"."OwnerId", "model.Owner"."Id", "model.Owner"."FirstName", "model.Owner"."LastName" + FROM "TodoItems" AS "model" + LEFT JOIN "People" AS "model.Owner" ON "model"."OwnerId" = "model.Owner"."Id" + WHERE "model.Owner"."FirstName" = 'Crawford' + LIMIT @__p_1 OFFSET @__p_0 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@__p_1='?', @__p_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "model"."Id", "model"."AchievedDate", "model"."AssigneeId", "model"."CollectionId", "model"."CreatedDate", "model"."Description", "model"."GuidProperty", "model"."Ordinal", "model"."OwnerId", "model.Owner"."Id", "model.Owner"."FirstName", "model.Owner"."LastName" + FROM "TodoItems" AS "model" + LEFT JOIN "People" AS "model.Owner" ON "model"."OwnerId" = "model.Owner"."Id" + WHERE "model.Owner"."FirstName" = 'Crawford' + LIMIT @__p_1 OFFSET @__p_0 +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample), returned result Microsoft.AspNetCore.Mvc.OkObjectResult. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[4] + No information found on request to perform content negotiation. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[2] + Selected output formatter 'JsonApiDotNetCore.Formatters.JsonApiOutputFormatter' and content type '' to write the response. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: JsonApiDotNetCore.Formatters.JsonApiWriter[0] + Formatting response as JSONAPI +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) in 48.283ms +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) in 48.283ms +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 53.232ms 200 application/vnd.api+json +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 53.232ms 200 application/vnd.api+json +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 GET http://localhost/api/v1/todo-items?include=owner&filter[achieved-date]=2/18/18%2012:00:00%20AM +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 GET http://localhost/api/v1/todo-items?include=owner&filter[achieved-date]=2/18/18%2012:00:00%20AM +dbug: Microsoft.AspNetCore.Routing.Tree.TreeRouter[1] + Request successfully matched the route with name '(null)' and template 'api/v1/todo-items'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.TodoItemsController.PostAsync (JsonApiDotNetCoreExample)' with id '2fce3eb8-46a5-44ed-9a98-55e95b5c8e2f' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) with arguments ((null)) - ModelState is Valid +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) with arguments ((null)) - ModelState is Valid +fail: JsonApiDotNetCore.Middleware.JsonApiExceptionFilter[0] + An unhandled exception occurred during the request +JsonApiDotNetCore.Internal.JsonApiException: Filter is not allowed for attribute 'achieved-date'. + at JsonApiDotNetCore.Internal.Query.AttrFilterQuery..ctor(IJsonApiContext jsonApiContext, FilterQuery filterQuery) in /Users/jarednance/dev/json-api-dotnet-core/src/JsonApiDotNetCore/Internal/Query/AttrFilterQuery.cs:line 26 + at JsonApiDotNetCore.Extensions.IQueryableExtensions.Filter[TSource](IQueryable`1 source, IJsonApiContext jsonApiContext, FilterQuery filterQuery) in /Users/jarednance/dev/json-api-dotnet-core/src/JsonApiDotNetCore/Extensions/IQueryableExtensions.cs:line 88 + at JsonApiDotNetCore.Data.DefaultEntityRepository`2.Filter(IQueryable`1 entities, FilterQuery filterQuery) in /Users/jarednance/dev/json-api-dotnet-core/src/JsonApiDotNetCore/Data/DefaultEntityRepository.cs:line 61 + at JsonApiDotNetCore.Services.EntityResourceService`2.ApplySortAndFilterQuery(IQueryable`1 entities) in /Users/jarednance/dev/json-api-dotnet-core/src/JsonApiDotNetCore/Services/EntityResourceService.cs:line 156 + at JsonApiDotNetCore.Services.EntityResourceService`2.d__4.MoveNext() in /Users/jarednance/dev/json-api-dotnet-core/src/JsonApiDotNetCore/Services/EntityResourceService.cs:line 46 +--- End of stack trace from previous location where exception was thrown --- + at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) + at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult() + at JsonApiDotNetCore.Controllers.BaseJsonApiController`2.d__12.MoveNext() in /Users/jarednance/dev/json-api-dotnet-core/src/JsonApiDotNetCore/Controllers/BaseJsonApiController.cs:line 109 +--- End of stack trace from previous location where exception was thrown --- + at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) + at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult() + at JsonApiDotNetCore.Controllers.JsonApiController`2.d__3.MoveNext() in /Users/jarednance/dev/json-api-dotnet-core/src/JsonApiDotNetCore/Controllers/JsonApiController.cs:line 62 +--- End of stack trace from previous location where exception was thrown --- + at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) + at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.d__12.MoveNext() +--- End of stack trace from previous location where exception was thrown --- + at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) + at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.d__10.MoveNext() +--- End of stack trace from previous location where exception was thrown --- + at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Rethrow(ActionExecutedContext context) + at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) + at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.d__14.MoveNext() +--- End of stack trace from previous location where exception was thrown --- + at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) + at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.d__23.MoveNext() +fail: JsonApiDotNetCore.Middleware.JsonApiExceptionFilter[0] + An unhandled exception occurred during the request +JsonApiDotNetCore.Internal.JsonApiException: Filter is not allowed for attribute 'achieved-date'. + at JsonApiDotNetCore.Internal.Query.AttrFilterQuery..ctor(IJsonApiContext jsonApiContext, FilterQuery filterQuery) in /Users/jarednance/dev/json-api-dotnet-core/src/JsonApiDotNetCore/Internal/Query/AttrFilterQuery.cs:line 26 + at JsonApiDotNetCore.Extensions.IQueryableExtensions.Filter[TSource](IQueryable`1 source, IJsonApiContext jsonApiContext, FilterQuery filterQuery) in /Users/jarednance/dev/json-api-dotnet-core/src/JsonApiDotNetCore/Extensions/IQueryableExtensions.cs:line 88 + at JsonApiDotNetCore.Data.DefaultEntityRepository`2.Filter(IQueryable`1 entities, FilterQuery filterQuery) in /Users/jarednance/dev/json-api-dotnet-core/src/JsonApiDotNetCore/Data/DefaultEntityRepository.cs:line 61 + at JsonApiDotNetCore.Services.EntityResourceService`2.ApplySortAndFilterQuery(IQueryable`1 entities) in /Users/jarednance/dev/json-api-dotnet-core/src/JsonApiDotNetCore/Services/EntityResourceService.cs:line 156 + at JsonApiDotNetCore.Services.EntityResourceService`2.d__4.MoveNext() in /Users/jarednance/dev/json-api-dotnet-core/src/JsonApiDotNetCore/Services/EntityResourceService.cs:line 46 +--- End of stack trace from previous location where exception was thrown --- + at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) + at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult() + at JsonApiDotNetCore.Controllers.BaseJsonApiController`2.d__12.MoveNext() in /Users/jarednance/dev/json-api-dotnet-core/src/JsonApiDotNetCore/Controllers/BaseJsonApiController.cs:line 109 +--- End of stack trace from previous location where exception was thrown --- + at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) + at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult() + at JsonApiDotNetCore.Controllers.JsonApiController`2.d__3.MoveNext() in /Users/jarednance/dev/json-api-dotnet-core/src/JsonApiDotNetCore/Controllers/JsonApiController.cs:line 62 +--- End of stack trace from previous location where exception was thrown --- + at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) + at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.d__12.MoveNext() +--- End of stack trace from previous location where exception was thrown --- + at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) + at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.d__10.MoveNext() +--- End of stack trace from previous location where exception was thrown --- + at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Rethrow(ActionExecutedContext context) + at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) + at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.d__14.MoveNext() +--- End of stack trace from previous location where exception was thrown --- + at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) + at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.d__23.MoveNext() +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[4] + No information found on request to perform content negotiation. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[2] + Selected output formatter 'JsonApiDotNetCore.Formatters.JsonApiOutputFormatter' and content type '' to write the response. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: JsonApiDotNetCore.Formatters.JsonApiWriter[0] + Formatting response as JSONAPI +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) in 7.111ms +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) in 7.111ms +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 7.516ms 400 application/vnd.api+json +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 7.516ms 400 application/vnd.api+json +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20200] + Beginning transaction with isolation level 'ReadCommitted'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6, @p7) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6, @p7) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6, @p7) + RETURNING "Id"; +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20202] + Committing transaction. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20204] + Disposing transaction. +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 GET http://localhost/api/v1/todo-items?filter[guid-property]=a23f1cb2-5445-4cad-bda5-629ecc2002e2 +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 GET http://localhost/api/v1/todo-items?filter[guid-property]=a23f1cb2-5445-4cad-bda5-629ecc2002e2 +dbug: Microsoft.AspNetCore.Routing.Tree.TreeRouter[1] + Request successfully matched the route with name '(null)' and template 'api/v1/todo-items'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.TodoItemsController.PostAsync (JsonApiDotNetCoreExample)' with id '2fce3eb8-46a5-44ed-9a98-55e95b5c8e2f' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) with arguments ((null)) - ModelState is Valid +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) with arguments ((null)) - ModelState is Valid +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Query[10101] + Compiling query model: + '(from TodoItem model in DbSet + where [model].GuidProperty == a23f1cb2-5445-4cad-bda5-629ecc2002e2 + select [model]).Count()' +dbug: Microsoft.EntityFrameworkCore.Query[10104] + Optimized query model: + '(from TodoItem model in DbSet + where [model].GuidProperty == a23f1cb2-5445-4cad-bda5-629ecc2002e2 + select [model]).Count()' +dbug: Microsoft.EntityFrameworkCore.Query[10107] + (QueryContext queryContext) => IAsyncEnumerable _InterceptExceptions( + source: IAsyncEnumerable _ToSequence(Task GetResult( + valueBuffers: IAsyncEnumerable _Query( + queryContext: queryContext, + shaperCommandContext: SelectExpression: + SELECT COUNT(*)::INT4 + FROM "TodoItems" AS "model" + WHERE "model"."GuidProperty" = 'a23f1cb2-5445-4cad-bda5-629ecc2002e2'), + throwOnNullResult: False, + cancellationToken: queryContext.CancellationToken)), + contextType: JsonApiDotNetCoreExample.Data.AppDbContext, + logger: DiagnosticsLogger, + queryContext: queryContext) +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[], CommandType='Text', CommandTimeout='30'] + SELECT COUNT(*)::INT4 + FROM "TodoItems" AS "model" + WHERE "model"."GuidProperty" = 'a23f1cb2-5445-4cad-bda5-629ecc2002e2' +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + SELECT COUNT(*)::INT4 + FROM "TodoItems" AS "model" + WHERE "model"."GuidProperty" = 'a23f1cb2-5445-4cad-bda5-629ecc2002e2' +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + SELECT COUNT(*)::INT4 + FROM "TodoItems" AS "model" + WHERE "model"."GuidProperty" = 'a23f1cb2-5445-4cad-bda5-629ecc2002e2' +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +info: JsonApiDotNetCore.Services.EntityResourceService[0] + Applying paging query. Fetching page 0 with 5 entities +dbug: Microsoft.EntityFrameworkCore.Query[10101] + Compiling query model: + '(from TodoItem model in DbSet + where [model].GuidProperty == a23f1cb2-5445-4cad-bda5-629ecc2002e2 + select [model]) + .Skip(__p_0) + .Take(__p_1)' +warn: Microsoft.EntityFrameworkCore.Query[10102] + Query: '(from TodoItem model in DbSet where [model].GuidProperty == a23f1cb2-5445-4cad-bda5-629ecc...' uses a row limiting operation (Skip/Take) without OrderBy which may lead to unpredictable results. +warn: Microsoft.EntityFrameworkCore.Query[10102] + Query: '(from TodoItem model in DbSet where [model].GuidProperty == a23f1cb2-5445-4cad-bda5-629ecc...' uses a row limiting operation (Skip/Take) without OrderBy which may lead to unpredictable results. +dbug: Microsoft.EntityFrameworkCore.Query[10104] + Optimized query model: + '(from TodoItem model in DbSet + where [model].GuidProperty == a23f1cb2-5445-4cad-bda5-629ecc2002e2 + select [model]) + .Skip(__p_0) + .Take(__p_1)' +dbug: Microsoft.EntityFrameworkCore.Query[10107] + (QueryContext queryContext) => IAsyncEnumerable _InterceptExceptions( + source: IAsyncEnumerable _TrackEntities( + results: IAsyncEnumerable _ShapedQuery( + queryContext: queryContext, + shaperCommandContext: SelectExpression: + SELECT "model"."Id", "model"."AchievedDate", "model"."AssigneeId", "model"."CollectionId", "model"."CreatedDate", "model"."Description", "model"."GuidProperty", "model"."Ordinal", "model"."OwnerId" + FROM "TodoItems" AS "model" + WHERE "model"."GuidProperty" = 'a23f1cb2-5445-4cad-bda5-629ecc2002e2' + LIMIT @__p_1 OFFSET @__p_0, + shaper: UnbufferedEntityShaper), + queryContext: queryContext, + entityTrackingInfos: { itemType: TodoItem }, + entityAccessors: List> + { + Func, + } + ), + contextType: JsonApiDotNetCoreExample.Data.AppDbContext, + logger: DiagnosticsLogger, + queryContext: queryContext) +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@__p_1='?', @__p_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "model"."Id", "model"."AchievedDate", "model"."AssigneeId", "model"."CollectionId", "model"."CreatedDate", "model"."Description", "model"."GuidProperty", "model"."Ordinal", "model"."OwnerId" + FROM "TodoItems" AS "model" + WHERE "model"."GuidProperty" = 'a23f1cb2-5445-4cad-bda5-629ecc2002e2' + LIMIT @__p_1 OFFSET @__p_0 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@__p_1='?', @__p_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "model"."Id", "model"."AchievedDate", "model"."AssigneeId", "model"."CollectionId", "model"."CreatedDate", "model"."Description", "model"."GuidProperty", "model"."Ordinal", "model"."OwnerId" + FROM "TodoItems" AS "model" + WHERE "model"."GuidProperty" = 'a23f1cb2-5445-4cad-bda5-629ecc2002e2' + LIMIT @__p_1 OFFSET @__p_0 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@__p_1='?', @__p_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "model"."Id", "model"."AchievedDate", "model"."AssigneeId", "model"."CollectionId", "model"."CreatedDate", "model"."Description", "model"."GuidProperty", "model"."Ordinal", "model"."OwnerId" + FROM "TodoItems" AS "model" + WHERE "model"."GuidProperty" = 'a23f1cb2-5445-4cad-bda5-629ecc2002e2' + LIMIT @__p_1 OFFSET @__p_0 +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample), returned result Microsoft.AspNetCore.Mvc.OkObjectResult. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[4] + No information found on request to perform content negotiation. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[2] + Selected output formatter 'JsonApiDotNetCore.Formatters.JsonApiOutputFormatter' and content type '' to write the response. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: JsonApiDotNetCore.Formatters.JsonApiWriter[0] + Formatting response as JSONAPI +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) in 11.26ms +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) in 11.26ms +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 17.365ms 200 application/vnd.api+json +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 17.365ms 200 application/vnd.api+json +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 GET http://localhost/api/v1/todo-items?include=owner&sort=achieved-date +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 GET http://localhost/api/v1/todo-items?include=owner&sort=achieved-date +dbug: Microsoft.AspNetCore.Routing.Tree.TreeRouter[1] + Request successfully matched the route with name '(null)' and template 'api/v1/todo-items'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.TodoItemsController.PostAsync (JsonApiDotNetCoreExample)' with id '2fce3eb8-46a5-44ed-9a98-55e95b5c8e2f' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) +fail: JsonApiDotNetCore.Middleware.JsonApiExceptionFilter[0] + An unhandled exception occurred during the request +JsonApiDotNetCore.Internal.JsonApiException: Sort is not allowed for attribute 'achieved-date'. + at JsonApiDotNetCore.Services.QueryParser.ParseSortParameters(String value) in /Users/jarednance/dev/json-api-dotnet-core/src/JsonApiDotNetCore/Services/QueryParser.cs:line 165 + at JsonApiDotNetCore.Services.QueryParser.Parse(IQueryCollection query) in /Users/jarednance/dev/json-api-dotnet-core/src/JsonApiDotNetCore/Services/QueryParser.cs:line 51 + at JsonApiDotNetCore.Services.JsonApiContext.ApplyContext[T](Object controller) in /Users/jarednance/dev/json-api-dotnet-core/src/JsonApiDotNetCore/Services/JsonApiContext.cs:line 70 + at JsonApiDotNetCore.Controllers.BaseJsonApiController`2..ctor(IJsonApiContext jsonApiContext, IResourceService`2 resourceService) in /Users/jarednance/dev/json-api-dotnet-core/src/JsonApiDotNetCore/Controllers/BaseJsonApiController.cs:line 56 + at JsonApiDotNetCore.Controllers.JsonApiController`2..ctor(IJsonApiContext jsonApiContext, IResourceService`2 resourceService, ILoggerFactory loggerFactory) in /Users/jarednance/dev/json-api-dotnet-core/src/JsonApiDotNetCore/Controllers/JsonApiController.cs:line 40 + at JsonApiDotNetCore.Controllers.JsonApiController`1..ctor(IJsonApiContext jsonApiContext, IResourceService`2 resourceService, ILoggerFactory loggerFactory) in /Users/jarednance/dev/json-api-dotnet-core/src/JsonApiDotNetCore/Controllers/JsonApiController.cs:line 17 + at JsonApiDotNetCoreExample.Controllers.TodoItemsController..ctor(IJsonApiContext jsonApiContext, IResourceService`1 resourceService, ILoggerFactory loggerFactory) in /Users/jarednance/dev/json-api-dotnet-core/src/Examples/JsonApiDotNetCoreExample/Controllers/TodoItemsController.cs:line 14 + at lambda_method(Closure , IServiceProvider , Object[] ) + at Microsoft.AspNetCore.Mvc.Controllers.ControllerFactoryProvider.<>c__DisplayClass5_0.g__CreateController|0(ControllerContext controllerContext) + at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) + at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.d__14.MoveNext() +--- End of stack trace from previous location where exception was thrown --- + at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) + at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.d__23.MoveNext() +fail: JsonApiDotNetCore.Middleware.JsonApiExceptionFilter[0] + An unhandled exception occurred during the request +JsonApiDotNetCore.Internal.JsonApiException: Sort is not allowed for attribute 'achieved-date'. + at JsonApiDotNetCore.Services.QueryParser.ParseSortParameters(String value) in /Users/jarednance/dev/json-api-dotnet-core/src/JsonApiDotNetCore/Services/QueryParser.cs:line 165 + at JsonApiDotNetCore.Services.QueryParser.Parse(IQueryCollection query) in /Users/jarednance/dev/json-api-dotnet-core/src/JsonApiDotNetCore/Services/QueryParser.cs:line 51 + at JsonApiDotNetCore.Services.JsonApiContext.ApplyContext[T](Object controller) in /Users/jarednance/dev/json-api-dotnet-core/src/JsonApiDotNetCore/Services/JsonApiContext.cs:line 70 + at JsonApiDotNetCore.Controllers.BaseJsonApiController`2..ctor(IJsonApiContext jsonApiContext, IResourceService`2 resourceService) in /Users/jarednance/dev/json-api-dotnet-core/src/JsonApiDotNetCore/Controllers/BaseJsonApiController.cs:line 56 + at JsonApiDotNetCore.Controllers.JsonApiController`2..ctor(IJsonApiContext jsonApiContext, IResourceService`2 resourceService, ILoggerFactory loggerFactory) in /Users/jarednance/dev/json-api-dotnet-core/src/JsonApiDotNetCore/Controllers/JsonApiController.cs:line 40 + at JsonApiDotNetCore.Controllers.JsonApiController`1..ctor(IJsonApiContext jsonApiContext, IResourceService`2 resourceService, ILoggerFactory loggerFactory) in /Users/jarednance/dev/json-api-dotnet-core/src/JsonApiDotNetCore/Controllers/JsonApiController.cs:line 17 + at JsonApiDotNetCoreExample.Controllers.TodoItemsController..ctor(IJsonApiContext jsonApiContext, IResourceService`1 resourceService, ILoggerFactory loggerFactory) in /Users/jarednance/dev/json-api-dotnet-core/src/Examples/JsonApiDotNetCoreExample/Controllers/TodoItemsController.cs:line 14 + at lambda_method(Closure , IServiceProvider , Object[] ) + at Microsoft.AspNetCore.Mvc.Controllers.ControllerFactoryProvider.<>c__DisplayClass5_0.g__CreateController|0(ControllerContext controllerContext) + at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) + at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.d__14.MoveNext() +--- End of stack trace from previous location where exception was thrown --- + at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) + at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.d__23.MoveNext() +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[4] + No information found on request to perform content negotiation. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[2] + Selected output formatter 'JsonApiDotNetCore.Formatters.JsonApiOutputFormatter' and content type '' to write the response. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: JsonApiDotNetCore.Formatters.JsonApiWriter[0] + Formatting response as JSONAPI +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) in 6ms +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) in 6ms +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 6.407ms 400 application/vnd.api+json +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 6.407ms 400 application/vnd.api+json +dbug: Microsoft.EntityFrameworkCore.Infrastructure[10401] + An 'IServiceProvider' was created for internal use by Entity Framework. +warn: Microsoft.EntityFrameworkCore.Infrastructure[10402] + More than twenty 'IServiceProvider' instances have been created for internal use by Entity Framework. Consider reviewing calls on 'DbContextOptionsBuilder' that may require new service providers to be built. +info: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[0] + User profile is available. Using '/Users/jarednance/.aspnet/DataProtection-Keys' as key repository; keys will not be encrypted at rest. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-b040dd03-33c5-451e-8f42-3c9dd4e0dfec.xml'. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-c8147b66-2deb-407c-9421-1553f0e16d67.xml'. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-f7fa4a09-6d65-426e-a653-cbd2969e5073.xml'. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {b040dd03-33c5-451e-8f42-3c9dd4e0dfec}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {c8147b66-2deb-407c-9421-1553f0e16d67}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {f7fa4a09-6d65-426e-a653-cbd2969e5073}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.DefaultKeyResolver[13] + Considering key {c8147b66-2deb-407c-9421-1553f0e16d67} with expiration date 2018-03-03 16:22:35Z as default key. +dbug: Microsoft.AspNetCore.DataProtection.TypeForwardingActivator[0] + Forwarded activator type request from Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Version=1.1.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60 to Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Culture=neutral, PublicKeyToken=adb9793829ddae60 +dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptorFactory[11] + Using managed symmetric algorithm 'System.Security.Cryptography.Aes'. +dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptorFactory[10] + Using managed keyed hash algorithm 'System.Security.Cryptography.HMACSHA256'. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingProvider[2] + Using key {c8147b66-2deb-407c-9421-1553f0e16d67} as the default key. +dbug: Microsoft.AspNetCore.DataProtection.Internal.DataProtectionStartupFilter[0] + Key ring with default key {c8147b66-2deb-407c-9421-1553f0e16d67} was loaded during application startup. +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[], CommandType='Text', CommandTimeout='30'] + + SELECT CASE WHEN COUNT(*) = 0 THEN FALSE ELSE TRUE END + FROM information_schema.tables + WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema') +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (3ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + + SELECT CASE WHEN COUNT(*) = 0 THEN FALSE ELSE TRUE END + FROM information_schema.tables + WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema') +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[3] + Hosting starting +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[4] + Hosting started +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[0] + Loaded hosting startup assembly JsonApiDotNetCoreExample +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 GET http://localhost/api/v1/todo-items application/vnd.api+json; charset=ISO-8859-4 +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 GET http://localhost/api/v1/todo-items application/vnd.api+json; charset=ISO-8859-4 +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 0.891ms 415 +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 0.891ms 415 +dbug: Microsoft.EntityFrameworkCore.Infrastructure[10401] + An 'IServiceProvider' was created for internal use by Entity Framework. +warn: Microsoft.EntityFrameworkCore.Infrastructure[10402] + More than twenty 'IServiceProvider' instances have been created for internal use by Entity Framework. Consider reviewing calls on 'DbContextOptionsBuilder' that may require new service providers to be built. +info: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[0] + User profile is available. Using '/Users/jarednance/.aspnet/DataProtection-Keys' as key repository; keys will not be encrypted at rest. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-b040dd03-33c5-451e-8f42-3c9dd4e0dfec.xml'. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-c8147b66-2deb-407c-9421-1553f0e16d67.xml'. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-f7fa4a09-6d65-426e-a653-cbd2969e5073.xml'. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {b040dd03-33c5-451e-8f42-3c9dd4e0dfec}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {c8147b66-2deb-407c-9421-1553f0e16d67}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {f7fa4a09-6d65-426e-a653-cbd2969e5073}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.DefaultKeyResolver[13] + Considering key {c8147b66-2deb-407c-9421-1553f0e16d67} with expiration date 2018-03-03 16:22:35Z as default key. +dbug: Microsoft.AspNetCore.DataProtection.TypeForwardingActivator[0] + Forwarded activator type request from Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Version=1.1.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60 to Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Culture=neutral, PublicKeyToken=adb9793829ddae60 +dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptorFactory[11] + Using managed symmetric algorithm 'System.Security.Cryptography.Aes'. +dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptorFactory[10] + Using managed keyed hash algorithm 'System.Security.Cryptography.HMACSHA256'. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingProvider[2] + Using key {c8147b66-2deb-407c-9421-1553f0e16d67} as the default key. +dbug: Microsoft.AspNetCore.DataProtection.Internal.DataProtectionStartupFilter[0] + Key ring with default key {c8147b66-2deb-407c-9421-1553f0e16d67} was loaded during application startup. +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[], CommandType='Text', CommandTimeout='30'] + + SELECT CASE WHEN COUNT(*) = 0 THEN FALSE ELSE TRUE END + FROM information_schema.tables + WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema') +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (4ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + + SELECT CASE WHEN COUNT(*) = 0 THEN FALSE ELSE TRUE END + FROM information_schema.tables + WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema') +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[3] + Hosting starting +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[4] + Hosting started +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[0] + Loaded hosting startup assembly JsonApiDotNetCoreExample +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 GET http://localhost/api/v1/todo-items +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 GET http://localhost/api/v1/todo-items +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 0.468ms 406 +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 0.468ms 406 +dbug: Microsoft.EntityFrameworkCore.Infrastructure[10401] + An 'IServiceProvider' was created for internal use by Entity Framework. +warn: Microsoft.EntityFrameworkCore.Infrastructure[10402] + More than twenty 'IServiceProvider' instances have been created for internal use by Entity Framework. Consider reviewing calls on 'DbContextOptionsBuilder' that may require new service providers to be built. +info: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[0] + User profile is available. Using '/Users/jarednance/.aspnet/DataProtection-Keys' as key repository; keys will not be encrypted at rest. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-b040dd03-33c5-451e-8f42-3c9dd4e0dfec.xml'. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-c8147b66-2deb-407c-9421-1553f0e16d67.xml'. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-f7fa4a09-6d65-426e-a653-cbd2969e5073.xml'. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {b040dd03-33c5-451e-8f42-3c9dd4e0dfec}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {c8147b66-2deb-407c-9421-1553f0e16d67}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {f7fa4a09-6d65-426e-a653-cbd2969e5073}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.DefaultKeyResolver[13] + Considering key {c8147b66-2deb-407c-9421-1553f0e16d67} with expiration date 2018-03-03 16:22:35Z as default key. +dbug: Microsoft.AspNetCore.DataProtection.TypeForwardingActivator[0] + Forwarded activator type request from Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Version=1.1.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60 to Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Culture=neutral, PublicKeyToken=adb9793829ddae60 +dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptorFactory[11] + Using managed symmetric algorithm 'System.Security.Cryptography.Aes'. +dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptorFactory[10] + Using managed keyed hash algorithm 'System.Security.Cryptography.HMACSHA256'. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingProvider[2] + Using key {c8147b66-2deb-407c-9421-1553f0e16d67} as the default key. +dbug: Microsoft.AspNetCore.DataProtection.Internal.DataProtectionStartupFilter[0] + Key ring with default key {c8147b66-2deb-407c-9421-1553f0e16d67} was loaded during application startup. +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[], CommandType='Text', CommandTimeout='30'] + + SELECT CASE WHEN COUNT(*) = 0 THEN FALSE ELSE TRUE END + FROM information_schema.tables + WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema') +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + + SELECT CASE WHEN COUNT(*) = 0 THEN FALSE ELSE TRUE END + FROM information_schema.tables + WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema') +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[3] + Hosting starting +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[4] + Hosting started +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[0] + Loaded hosting startup assembly JsonApiDotNetCoreExample +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 GET http://localhost/api/v1/todo-items +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 GET http://localhost/api/v1/todo-items +dbug: Microsoft.AspNetCore.Routing.Tree.TreeRouter[1] + Request successfully matched the route with name '(null)' and template 'api/v1/todo-items'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.TodoItemsController.PostAsync (JsonApiDotNetCoreExample)' with id '05049b95-e09d-45ad-ad89-bee6f6e0f23b' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) with arguments ((null)) - ModelState is Valid +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) with arguments ((null)) - ModelState is Valid +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Query[10101] + Compiling query model: + '(from TodoItem _1 in DbSet + select [_1]).Count()' +dbug: Microsoft.EntityFrameworkCore.Query[10104] + Optimized query model: + '(from TodoItem _1 in DbSet + select [_1]).Count()' +dbug: Microsoft.EntityFrameworkCore.Query[10107] + (QueryContext queryContext) => IAsyncEnumerable _InterceptExceptions( + source: IAsyncEnumerable _ToSequence(Task GetResult( + valueBuffers: IAsyncEnumerable _Query( + queryContext: queryContext, + shaperCommandContext: SelectExpression: + SELECT COUNT(*)::INT4 + FROM "TodoItems" AS "t"), + throwOnNullResult: False, + cancellationToken: queryContext.CancellationToken)), + contextType: JsonApiDotNetCoreExample.Data.AppDbContext, + logger: DiagnosticsLogger, + queryContext: queryContext) +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[], CommandType='Text', CommandTimeout='30'] + SELECT COUNT(*)::INT4 + FROM "TodoItems" AS "t" +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (4ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + SELECT COUNT(*)::INT4 + FROM "TodoItems" AS "t" +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (4ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + SELECT COUNT(*)::INT4 + FROM "TodoItems" AS "t" +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +info: JsonApiDotNetCore.Services.EntityResourceService[0] + Applying paging query. Fetching page 0 with 5 entities +dbug: Microsoft.EntityFrameworkCore.Query[10101] + Compiling query model: + '(from TodoItem _2 in DbSet + select [_2]) + .Skip(__p_0) + .Take(__p_1)' +warn: Microsoft.EntityFrameworkCore.Query[10102] + Query: '(from TodoItem _2 in DbSet select [_2]).Skip(__p_0).Take(__p_1)' uses a row limiting operation (Skip/Take) without OrderBy which may lead to unpredictable results. +warn: Microsoft.EntityFrameworkCore.Query[10102] + Query: '(from TodoItem _2 in DbSet select [_2]).Skip(__p_0).Take(__p_1)' uses a row limiting operation (Skip/Take) without OrderBy which may lead to unpredictable results. +dbug: Microsoft.EntityFrameworkCore.Query[10104] + Optimized query model: + '(from TodoItem _2 in DbSet + select [_2]) + .Skip(__p_0) + .Take(__p_1)' +dbug: Microsoft.EntityFrameworkCore.Query[10107] + (QueryContext queryContext) => IAsyncEnumerable _InterceptExceptions( + source: IAsyncEnumerable _TrackEntities( + results: IAsyncEnumerable _ShapedQuery( + queryContext: queryContext, + shaperCommandContext: SelectExpression: + SELECT "t"."Id", "t"."AchievedDate", "t"."AssigneeId", "t"."CollectionId", "t"."CreatedDate", "t"."Description", "t"."GuidProperty", "t"."Ordinal", "t"."OwnerId" + FROM "TodoItems" AS "t" + LIMIT @__p_1 OFFSET @__p_0, + shaper: UnbufferedEntityShaper), + queryContext: queryContext, + entityTrackingInfos: { itemType: TodoItem }, + entityAccessors: List> + { + Func, + } + ), + contextType: JsonApiDotNetCoreExample.Data.AppDbContext, + logger: DiagnosticsLogger, + queryContext: queryContext) +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@__p_1='?', @__p_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "t"."Id", "t"."AchievedDate", "t"."AssigneeId", "t"."CollectionId", "t"."CreatedDate", "t"."Description", "t"."GuidProperty", "t"."Ordinal", "t"."OwnerId" + FROM "TodoItems" AS "t" + LIMIT @__p_1 OFFSET @__p_0 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@__p_1='?', @__p_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "t"."Id", "t"."AchievedDate", "t"."AssigneeId", "t"."CollectionId", "t"."CreatedDate", "t"."Description", "t"."GuidProperty", "t"."Ordinal", "t"."OwnerId" + FROM "TodoItems" AS "t" + LIMIT @__p_1 OFFSET @__p_0 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@__p_1='?', @__p_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "t"."Id", "t"."AchievedDate", "t"."AssigneeId", "t"."CollectionId", "t"."CreatedDate", "t"."Description", "t"."GuidProperty", "t"."Ordinal", "t"."OwnerId" + FROM "TodoItems" AS "t" + LIMIT @__p_1 OFFSET @__p_0 +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample), returned result Microsoft.AspNetCore.Mvc.OkObjectResult. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[4] + No information found on request to perform content negotiation. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[2] + Selected output formatter 'JsonApiDotNetCore.Formatters.JsonApiOutputFormatter' and content type '' to write the response. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: JsonApiDotNetCore.Formatters.JsonApiWriter[0] + Formatting response as JSONAPI +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) in 58.963ms +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) in 58.963ms +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 78.167ms 200 application/vnd.api+json +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 78.167ms 200 application/vnd.api+json +dbug: Microsoft.EntityFrameworkCore.Infrastructure[10401] + An 'IServiceProvider' was created for internal use by Entity Framework. +warn: Microsoft.EntityFrameworkCore.Infrastructure[10402] + More than twenty 'IServiceProvider' instances have been created for internal use by Entity Framework. Consider reviewing calls on 'DbContextOptionsBuilder' that may require new service providers to be built. +info: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[0] + User profile is available. Using '/Users/jarednance/.aspnet/DataProtection-Keys' as key repository; keys will not be encrypted at rest. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-b040dd03-33c5-451e-8f42-3c9dd4e0dfec.xml'. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-c8147b66-2deb-407c-9421-1553f0e16d67.xml'. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-f7fa4a09-6d65-426e-a653-cbd2969e5073.xml'. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {b040dd03-33c5-451e-8f42-3c9dd4e0dfec}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {c8147b66-2deb-407c-9421-1553f0e16d67}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {f7fa4a09-6d65-426e-a653-cbd2969e5073}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.DefaultKeyResolver[13] + Considering key {c8147b66-2deb-407c-9421-1553f0e16d67} with expiration date 2018-03-03 16:22:35Z as default key. +dbug: Microsoft.AspNetCore.DataProtection.TypeForwardingActivator[0] + Forwarded activator type request from Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Version=1.1.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60 to Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Culture=neutral, PublicKeyToken=adb9793829ddae60 +dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptorFactory[11] + Using managed symmetric algorithm 'System.Security.Cryptography.Aes'. +dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptorFactory[10] + Using managed keyed hash algorithm 'System.Security.Cryptography.HMACSHA256'. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingProvider[2] + Using key {c8147b66-2deb-407c-9421-1553f0e16d67} as the default key. +dbug: Microsoft.AspNetCore.DataProtection.Internal.DataProtectionStartupFilter[0] + Key ring with default key {c8147b66-2deb-407c-9421-1553f0e16d67} was loaded during application startup. +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[], CommandType='Text', CommandTimeout='30'] + + SELECT CASE WHEN COUNT(*) = 0 THEN FALSE ELSE TRUE END + FROM information_schema.tables + WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema') +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (3ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + + SELECT CASE WHEN COUNT(*) = 0 THEN FALSE ELSE TRUE END + FROM information_schema.tables + WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema') +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[3] + Hosting starting +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[4] + Hosting started +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[0] + Loaded hosting startup assembly JsonApiDotNetCoreExample +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 POST http://localhost/api/v1/todo-items application/vnd.api+json +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 POST http://localhost/api/v1/todo-items application/vnd.api+json +dbug: Microsoft.AspNetCore.Routing.Tree.TreeRouter[1] + Request successfully matched the route with name '(null)' and template 'api/v1/todo-items'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample)' with id 'd54e2950-a2b5-4f65-98a5-dd097888aa4b' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action JsonApiDotNetCoreExample.Controllers.TodoItemsController.PostAsync (JsonApiDotNetCoreExample) +dbug: Microsoft.AspNetCore.Mvc.ModelBinding.Binders.BodyModelBinder[1] + Selected input formatter 'JsonApiDotNetCore.Formatters.JsonApiInputFormatter' for content type 'application/vnd.api+json'. +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.PostAsync (JsonApiDotNetCoreExample) with arguments (JsonApiDotNetCoreExample.Models.Person) - ModelState is Valid +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.PostAsync (JsonApiDotNetCoreExample) with arguments (JsonApiDotNetCoreExample.Models.Person) - ModelState is Valid +fail: JsonApiDotNetCore.Middleware.JsonApiExceptionFilter[0] + An unhandled exception occurred during the request +System.InvalidCastException: Unable to cast object of type 'JsonApiDotNetCoreExample.Models.Person' to type 'JsonApiDotNetCoreExample.Models.TodoItem'. + at lambda_method(Closure , Object , Object[] ) + at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.d__12.MoveNext() +--- End of stack trace from previous location where exception was thrown --- + at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) + at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.d__10.MoveNext() +--- End of stack trace from previous location where exception was thrown --- + at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Rethrow(ActionExecutedContext context) + at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) + at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.d__14.MoveNext() +--- End of stack trace from previous location where exception was thrown --- + at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) + at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.d__23.MoveNext() +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[4] + No information found on request to perform content negotiation. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[2] + Selected output formatter 'JsonApiDotNetCore.Formatters.JsonApiOutputFormatter' and content type '' to write the response. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: JsonApiDotNetCore.Formatters.JsonApiWriter[0] + Formatting response as JSONAPI +fail: JsonApiDotNetCore.Middleware.JsonApiExceptionFilter[0] + An unhandled exception occurred during the request +System.InvalidCastException: Unable to cast object of type 'JsonApiDotNetCoreExample.Models.Person' to type 'JsonApiDotNetCoreExample.Models.TodoItem'. + at lambda_method(Closure , Object , Object[] ) + at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.d__12.MoveNext() +--- End of stack trace from previous location where exception was thrown --- + at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) + at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.d__10.MoveNext() +--- End of stack trace from previous location where exception was thrown --- + at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Rethrow(ActionExecutedContext context) + at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) + at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.d__14.MoveNext() +--- End of stack trace from previous location where exception was thrown --- + at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) + at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.d__23.MoveNext() +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.TodoItemsController.PostAsync (JsonApiDotNetCoreExample) in 11.067ms +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.TodoItemsController.PostAsync (JsonApiDotNetCoreExample) in 11.067ms +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 26.767ms 409 application/vnd.api+json +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 26.767ms 409 application/vnd.api+json +info: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[0] + User profile is available. Using '/Users/jarednance/.aspnet/DataProtection-Keys' as key repository; keys will not be encrypted at rest. +warn: Microsoft.EntityFrameworkCore.Infrastructure[10402] + More than twenty 'IServiceProvider' instances have been created for internal use by Entity Framework. Consider reviewing calls on 'DbContextOptionsBuilder' that may require new service providers to be built. +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (2ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + + SELECT CASE WHEN COUNT(*) = 0 THEN FALSE ELSE TRUE END + FROM information_schema.tables + WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema') +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20200] + Beginning transaction with isolation level 'ReadCommitted'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@p0='?', @p1='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "People" ("FirstName", "LastName") + VALUES (@p0, @p1) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p0='?', @p1='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "People" ("FirstName", "LastName") + VALUES (@p0, @p1) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p0='?', @p1='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "People" ("FirstName", "LastName") + VALUES (@p0, @p1) + RETURNING "Id"; +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20202] + Committing transaction. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20204] + Disposing transaction. +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 POST http://localhost/api/v1/todo-collections application/vnd.api+json +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 POST http://localhost/api/v1/todo-collections application/vnd.api+json +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.TodoCollectionsController.PostAsync (JsonApiDotNetCoreExample) with arguments (JsonApiDotNetCoreExample.Models.TodoItemCollection) - ModelState is Valid +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.TodoCollectionsController.PostAsync (JsonApiDotNetCoreExample) with arguments (JsonApiDotNetCoreExample.Models.TodoItemCollection) - ModelState is Valid +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (2ms) [Parameters=[@p0='?', @p1='?', @p2='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItemCollections" ("Id", "Name", "OwnerId") + VALUES (@p0, @p1, @p2); +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (2ms) [Parameters=[@p0='?', @p1='?', @p2='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItemCollections" ("Id", "Name", "OwnerId") + VALUES (@p0, @p1, @p2); +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: JsonApiDotNetCore.Formatters.JsonApiWriter[0] + Formatting response as JSONAPI +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.TodoCollectionsController.PostAsync (JsonApiDotNetCoreExample) in 93.607ms +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 119.596ms 201 application/vnd.api+json +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.TodoCollectionsController.PostAsync (JsonApiDotNetCoreExample) in 93.607ms +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 119.596ms 201 application/vnd.api+json +dbug: Microsoft.EntityFrameworkCore.Infrastructure[10401] + An 'IServiceProvider' was created for internal use by Entity Framework. +warn: Microsoft.EntityFrameworkCore.Infrastructure[10402] + More than twenty 'IServiceProvider' instances have been created for internal use by Entity Framework. Consider reviewing calls on 'DbContextOptionsBuilder' that may require new service providers to be built. +info: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[0] + User profile is available. Using '/Users/jarednance/.aspnet/DataProtection-Keys' as key repository; keys will not be encrypted at rest. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-b040dd03-33c5-451e-8f42-3c9dd4e0dfec.xml'. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-c8147b66-2deb-407c-9421-1553f0e16d67.xml'. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-f7fa4a09-6d65-426e-a653-cbd2969e5073.xml'. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {b040dd03-33c5-451e-8f42-3c9dd4e0dfec}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {c8147b66-2deb-407c-9421-1553f0e16d67}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {f7fa4a09-6d65-426e-a653-cbd2969e5073}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.DefaultKeyResolver[13] + Considering key {c8147b66-2deb-407c-9421-1553f0e16d67} with expiration date 2018-03-03 16:22:35Z as default key. +dbug: Microsoft.AspNetCore.DataProtection.TypeForwardingActivator[0] + Forwarded activator type request from Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Version=1.1.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60 to Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Culture=neutral, PublicKeyToken=adb9793829ddae60 +dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptorFactory[11] + Using managed symmetric algorithm 'System.Security.Cryptography.Aes'. +dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptorFactory[10] + Using managed keyed hash algorithm 'System.Security.Cryptography.HMACSHA256'. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingProvider[2] + Using key {c8147b66-2deb-407c-9421-1553f0e16d67} as the default key. +dbug: Microsoft.AspNetCore.DataProtection.Internal.DataProtectionStartupFilter[0] + Key ring with default key {c8147b66-2deb-407c-9421-1553f0e16d67} was loaded during application startup. +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[], CommandType='Text', CommandTimeout='30'] + + SELECT CASE WHEN COUNT(*) = 0 THEN FALSE ELSE TRUE END + FROM information_schema.tables + WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema') +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + + SELECT CASE WHEN COUNT(*) = 0 THEN FALSE ELSE TRUE END + FROM information_schema.tables + WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema') +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[3] + Hosting starting +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[4] + Hosting started +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[0] + Loaded hosting startup assembly JsonApiDotNetCoreExample +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 POST http://localhost/api/v1/todo-items application/vnd.api+json +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 POST http://localhost/api/v1/todo-items application/vnd.api+json +dbug: Microsoft.AspNetCore.Routing.Tree.TreeRouter[1] + Request successfully matched the route with name '(null)' and template 'api/v1/todo-items'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample)' with id 'e4bc225e-4ba0-4fca-a686-db10af6c6128' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action JsonApiDotNetCoreExample.Controllers.TodoItemsController.PostAsync (JsonApiDotNetCoreExample) +dbug: Microsoft.AspNetCore.Mvc.ModelBinding.Binders.BodyModelBinder[1] + Selected input formatter 'JsonApiDotNetCore.Formatters.JsonApiInputFormatter' for content type 'application/vnd.api+json'. +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.PostAsync (JsonApiDotNetCoreExample) with arguments (JsonApiDotNetCoreExample.Models.TodoItem) - ModelState is Valid +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.PostAsync (JsonApiDotNetCoreExample) with arguments (JsonApiDotNetCoreExample.Models.TodoItem) - ModelState is Valid +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.PostAsync (JsonApiDotNetCoreExample), returned result Microsoft.AspNetCore.Mvc.StatusCodeResult. +info: Microsoft.AspNetCore.Mvc.StatusCodeResult[1] + Executing HttpStatusCodeResult, setting HTTP status code 403 +info: Microsoft.AspNetCore.Mvc.StatusCodeResult[1] + Executing HttpStatusCodeResult, setting HTTP status code 403 +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.TodoItemsController.PostAsync (JsonApiDotNetCoreExample) in 5.173ms +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.TodoItemsController.PostAsync (JsonApiDotNetCoreExample) in 5.173ms +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 20.262ms 403 +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 20.262ms 403 +dbug: Microsoft.EntityFrameworkCore.Infrastructure[10401] + An 'IServiceProvider' was created for internal use by Entity Framework. +warn: Microsoft.EntityFrameworkCore.Infrastructure[10402] + More than twenty 'IServiceProvider' instances have been created for internal use by Entity Framework. Consider reviewing calls on 'DbContextOptionsBuilder' that may require new service providers to be built. +info: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[0] + User profile is available. Using '/Users/jarednance/.aspnet/DataProtection-Keys' as key repository; keys will not be encrypted at rest. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-b040dd03-33c5-451e-8f42-3c9dd4e0dfec.xml'. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-c8147b66-2deb-407c-9421-1553f0e16d67.xml'. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-f7fa4a09-6d65-426e-a653-cbd2969e5073.xml'. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {b040dd03-33c5-451e-8f42-3c9dd4e0dfec}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {c8147b66-2deb-407c-9421-1553f0e16d67}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {f7fa4a09-6d65-426e-a653-cbd2969e5073}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.DefaultKeyResolver[13] + Considering key {c8147b66-2deb-407c-9421-1553f0e16d67} with expiration date 2018-03-03 16:22:35Z as default key. +dbug: Microsoft.AspNetCore.DataProtection.TypeForwardingActivator[0] + Forwarded activator type request from Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Version=1.1.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60 to Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Culture=neutral, PublicKeyToken=adb9793829ddae60 +dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptorFactory[11] + Using managed symmetric algorithm 'System.Security.Cryptography.Aes'. +dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptorFactory[10] + Using managed keyed hash algorithm 'System.Security.Cryptography.HMACSHA256'. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingProvider[2] + Using key {c8147b66-2deb-407c-9421-1553f0e16d67} as the default key. +dbug: Microsoft.AspNetCore.DataProtection.Internal.DataProtectionStartupFilter[0] + Key ring with default key {c8147b66-2deb-407c-9421-1553f0e16d67} was loaded during application startup. +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[], CommandType='Text', CommandTimeout='30'] + + SELECT CASE WHEN COUNT(*) = 0 THEN FALSE ELSE TRUE END + FROM information_schema.tables + WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema') +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + + SELECT CASE WHEN COUNT(*) = 0 THEN FALSE ELSE TRUE END + FROM information_schema.tables + WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema') +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[3] + Hosting starting +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[4] + Hosting started +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[0] + Loaded hosting startup assembly JsonApiDotNetCoreExample +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20200] + Beginning transaction with isolation level 'ReadCommitted'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@p0='?', @p1='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "People" ("FirstName", "LastName") + VALUES (@p0, @p1) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (2ms) [Parameters=[@p0='?', @p1='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "People" ("FirstName", "LastName") + VALUES (@p0, @p1) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (2ms) [Parameters=[@p0='?', @p1='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "People" ("FirstName", "LastName") + VALUES (@p0, @p1) + RETURNING "Id"; +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20202] + Committing transaction. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20204] + Disposing transaction. +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 POST http://localhost/api/v1/todo-collections application/vnd.api+json +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 POST http://localhost/api/v1/todo-collections application/vnd.api+json +dbug: Microsoft.AspNetCore.Routing.Tree.TreeRouter[1] + Request successfully matched the route with name '(null)' and template 'api/v1/todo-collections'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.TodoCollectionsController.GetAsync (JsonApiDotNetCoreExample)' with id '21ae0180-661e-43c0-aaba-a63666b354fa' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action JsonApiDotNetCoreExample.Controllers.TodoCollectionsController.PostAsync (JsonApiDotNetCoreExample) +dbug: Microsoft.AspNetCore.Mvc.ModelBinding.Binders.BodyModelBinder[1] + Selected input formatter 'JsonApiDotNetCore.Formatters.JsonApiInputFormatter' for content type 'application/vnd.api+json'. +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.TodoCollectionsController.PostAsync (JsonApiDotNetCoreExample) with arguments (JsonApiDotNetCoreExample.Models.TodoItemCollection) - ModelState is Valid +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.TodoCollectionsController.PostAsync (JsonApiDotNetCoreExample) with arguments (JsonApiDotNetCoreExample.Models.TodoItemCollection) - ModelState is Valid +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20200] + Beginning transaction with isolation level 'ReadCommitted'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@p0='?', @p1='?', @p2='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItemCollections" ("Id", "Name", "OwnerId") + VALUES (@p0, @p1, @p2); +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p0='?', @p1='?', @p2='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItemCollections" ("Id", "Name", "OwnerId") + VALUES (@p0, @p1, @p2); +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p0='?', @p1='?', @p2='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItemCollections" ("Id", "Name", "OwnerId") + VALUES (@p0, @p1, @p2); +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20202] + Committing transaction. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20204] + Disposing transaction. +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action method JsonApiDotNetCoreExample.Controllers.TodoCollectionsController.PostAsync (JsonApiDotNetCoreExample), returned result Microsoft.AspNetCore.Mvc.CreatedResult. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[4] + No information found on request to perform content negotiation. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[2] + Selected output formatter 'JsonApiDotNetCore.Formatters.JsonApiOutputFormatter' and content type '' to write the response. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: JsonApiDotNetCore.Formatters.JsonApiWriter[0] + Formatting response as JSONAPI +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.TodoCollectionsController.PostAsync (JsonApiDotNetCoreExample) in 58.596ms +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.TodoCollectionsController.PostAsync (JsonApiDotNetCoreExample) in 58.596ms +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 77.468ms 201 application/vnd.api+json +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 77.468ms 201 application/vnd.api+json +dbug: Microsoft.EntityFrameworkCore.Infrastructure[10401] + An 'IServiceProvider' was created for internal use by Entity Framework. +warn: Microsoft.EntityFrameworkCore.Infrastructure[10402] + More than twenty 'IServiceProvider' instances have been created for internal use by Entity Framework. Consider reviewing calls on 'DbContextOptionsBuilder' that may require new service providers to be built. +: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[0] + User profile is available. Using '/Users/jarednance/.aspnet/DataProtection-Keys' as key repository; keys will not be encrypted at rest. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-b040dd03-33c5-451e-8f42-3c9dd4e0dfec.xml'. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-c8147b66-2deb-407c-9421-1553f0e16d67.xml'. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-f7fa4a09-6d65-426e-a653-cbd2969e5073.xml'. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {b040dd03-33c5-451e-8f42-3c9dd4e0dfec}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {c8147b66-2deb-407c-9421-1553f0e16d67}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {f7fa4a09-6d65-426e-a653-cbd2969e5073}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.DefaultKeyResolver[13] + Considering key {c8147b66-2deb-407c-9421-1553f0e16d67} with expiration date 2018-03-03 16:22:35Z as default key. +dbug: Microsoft.AspNetCore.DataProtection.TypeForwardingActivator[0] + Forwarded activator type request from Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Version=1.1.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60 to Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Culture=neutral, PublicKeyToken=adb9793829ddae60 +dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptorFactory[11] + Using managed symmetric algorithm 'System.Security.Cryptography.Aes'. +dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptorFactory[10] + Using managed keyed hash algorithm 'System.Security.Cryptography.HMACSHA256'. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingProvider[2] + Using key {c8147b66-2deb-407c-9421-1553f0e16d67} as the default key. +dbug: Microsoft.AspNetCore.DataProtection.Internal.DataProtectionStartupFilter[0] + Key ring with default key {c8147b66-2deb-407c-9421-1553f0e16d67} was loaded during application startup. +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[], CommandType='Text', CommandTimeout='30'] + + SELECT CASE WHEN COUNT(*) = 0 THEN FALSE ELSE TRUE END + FROM information_schema.tables + WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema') +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + + SELECT CASE WHEN COUNT(*) = 0 THEN FALSE ELSE TRUE END + FROM information_schema.tables + WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema') +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[3] + Hosting starting +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[4] + Hosting started +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[0] + Loaded hosting startup assembly JsonApiDotNetCoreExample +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20200] + Beginning transaction with isolation level 'ReadCommitted'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@p0='?', @p1='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "People" ("FirstName", "LastName") + VALUES (@p0, @p1) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (4ms) [Parameters=[@p0='?', @p1='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "People" ("FirstName", "LastName") + VALUES (@p0, @p1) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (4ms) [Parameters=[@p0='?', @p1='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "People" ("FirstName", "LastName") + VALUES (@p0, @p1) + RETURNING "Id"; +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?', @p8='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p2, @p3, @p4, @p5, @p6, @p7, @p8) + RETURNING "Id", "CreatedDate"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?', @p8='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p2, @p3, @p4, @p5, @p6, @p7, @p8) + RETURNING "Id", "CreatedDate"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?', @p8='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p2, @p3, @p4, @p5, @p6, @p7, @p8) + RETURNING "Id", "CreatedDate"; +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20202] + Committing transaction. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20204] + Disposing transaction. +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 POST http://localhost/api/v1/todo-collections application/vnd.api+json +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 POST http://localhost/api/v1/todo-collections application/vnd.api+json +dbug: Microsoft.AspNetCore.Routing.Tree.TreeRouter[1] + Request successfully matched the route with name '(null)' and template 'api/v1/todo-collections'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.TodoCollectionsController.GetAsync (JsonApiDotNetCoreExample)' with id '3a8d48b8-e58c-4ef6-b4b3-166fd71553bc' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action JsonApiDotNetCoreExample.Controllers.TodoCollectionsController.PostAsync (JsonApiDotNetCoreExample) +dbug: Microsoft.AspNetCore.Mvc.ModelBinding.Binders.BodyModelBinder[1] + Selected input formatter 'JsonApiDotNetCore.Formatters.JsonApiInputFormatter' for content type 'application/vnd.api+json'. +fail: JsonApiDotNetCore.Formatters.JsonApiReader[0] + An error occurred while de-serializing the payload +JsonApiDotNetCore.Internal.JsonApiException: Failed to deserialize request body ---> System.InvalidCastException: Unable to cast object of type 'System.Collections.Generic.List`1[JsonApiDotNetCore.Models.ResourceIdentifierObject]' to type 'System.Collections.Generic.List`1[System.Collections.Generic.Dictionary`2[System.String,System.Object]]'. + at JsonApiDotNetCore.Serialization.JsonApiDeSerializer.SetHasManyRelationship(Object entity, PropertyInfo[] entityProperties, RelationshipAttribute attr, ContextEntity contextEntity, Dictionary`2 relationships) in /Users/jarednance/dev/json-api-dotnet-core/src/JsonApiDotNetCore/Serialization/JsonApiDeSerializer.cs:line 216 + at JsonApiDotNetCore.Serialization.JsonApiDeSerializer.SetRelationships(Object entity, ContextEntity contextEntity, Dictionary`2 relationships) in /Users/jarednance/dev/json-api-dotnet-core/src/JsonApiDotNetCore/Serialization/JsonApiDeSerializer.cs:line 156 + at JsonApiDotNetCore.Serialization.JsonApiDeSerializer.DocumentToObject(DocumentData data) in /Users/jarednance/dev/json-api-dotnet-core/src/JsonApiDotNetCore/Serialization/JsonApiDeSerializer.cs:line 92 + at JsonApiDotNetCore.Serialization.JsonApiDeSerializer.Deserialize(String requestBody) in /Users/jarednance/dev/json-api-dotnet-core/src/JsonApiDotNetCore/Serialization/JsonApiDeSerializer.cs:line 33 + --- End of inner exception stack trace --- + at JsonApiDotNetCore.Serialization.JsonApiDeSerializer.Deserialize(String requestBody) in /Users/jarednance/dev/json-api-dotnet-core/src/JsonApiDotNetCore/Serialization/JsonApiDeSerializer.cs:line 38 + at JsonApiDotNetCore.Formatters.JsonApiReader.ReadAsync(InputFormatterContext context) in /Users/jarednance/dev/json-api-dotnet-core/src/JsonApiDotNetCore/Formatters/JsonApiReader.cs:line 39 +fail: JsonApiDotNetCore.Formatters.JsonApiReader[0] + An error occurred while de-serializing the payload +JsonApiDotNetCore.Internal.JsonApiException: Failed to deserialize request body ---> System.InvalidCastException: Unable to cast object of type 'System.Collections.Generic.List`1[JsonApiDotNetCore.Models.ResourceIdentifierObject]' to type 'System.Collections.Generic.List`1[System.Collections.Generic.Dictionary`2[System.String,System.Object]]'. + at JsonApiDotNetCore.Serialization.JsonApiDeSerializer.SetHasManyRelationship(Object entity, PropertyInfo[] entityProperties, RelationshipAttribute attr, ContextEntity contextEntity, Dictionary`2 relationships) in /Users/jarednance/dev/json-api-dotnet-core/src/JsonApiDotNetCore/Serialization/JsonApiDeSerializer.cs:line 216 + at JsonApiDotNetCore.Serialization.JsonApiDeSerializer.SetRelationships(Object entity, ContextEntity contextEntity, Dictionary`2 relationships) in /Users/jarednance/dev/json-api-dotnet-core/src/JsonApiDotNetCore/Serialization/JsonApiDeSerializer.cs:line 156 + at JsonApiDotNetCore.Serialization.JsonApiDeSerializer.DocumentToObject(DocumentData data) in /Users/jarednance/dev/json-api-dotnet-core/src/JsonApiDotNetCore/Serialization/JsonApiDeSerializer.cs:line 92 + at JsonApiDotNetCore.Serialization.JsonApiDeSerializer.Deserialize(String requestBody) in /Users/jarednance/dev/json-api-dotnet-core/src/JsonApiDotNetCore/Serialization/JsonApiDeSerializer.cs:line 33 + --- End of inner exception stack trace --- + at JsonApiDotNetCore.Serialization.JsonApiDeSerializer.Deserialize(String requestBody) in /Users/jarednance/dev/json-api-dotnet-core/src/JsonApiDotNetCore/Serialization/JsonApiDeSerializer.cs:line 38 + at JsonApiDotNetCore.Formatters.JsonApiReader.ReadAsync(InputFormatterContext context) in /Users/jarednance/dev/json-api-dotnet-core/src/JsonApiDotNetCore/Formatters/JsonApiReader.cs:line 39 +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.TodoCollectionsController.PostAsync (JsonApiDotNetCoreExample) with arguments () - ModelState is Invalid +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.TodoCollectionsController.PostAsync (JsonApiDotNetCoreExample) with arguments () - ModelState is Invalid +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action method JsonApiDotNetCoreExample.Controllers.TodoCollectionsController.PostAsync (JsonApiDotNetCoreExample), returned result Microsoft.AspNetCore.Mvc.StatusCodeResult. +info: Microsoft.AspNetCore.Mvc.StatusCodeResult[1] + Executing HttpStatusCodeResult, setting HTTP status code 422 +info: Microsoft.AspNetCore.Mvc.StatusCodeResult[1] + Executing HttpStatusCodeResult, setting HTTP status code 422 +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.TodoCollectionsController.PostAsync (JsonApiDotNetCoreExample) in 22.188ms +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.TodoCollectionsController.PostAsync (JsonApiDotNetCoreExample) in 22.188ms +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 42.033ms 422 +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 42.033ms 422 +dbug: Microsoft.EntityFrameworkCore.Infrastructure[10401] + An 'IServiceProvider' was created for internal use by Entity Framework. +warn: Microsoft.EntityFrameworkCore.Infrastructure[10402] + More than twenty 'IServiceProvider' instances have been created for internal use by Entity Framework. Consider reviewing calls on 'DbContextOptionsBuilder' that may require new service providers to be built. +[xUnit.net 00:00:12.5112580] JsonApiDotNetCore.Internal.JsonApiException : Failed to deserialize request body +[xUnit.net 00:00:12.5115070] ---- System.NullReferenceException : Object reference not set to an instance of an object. +info: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[0] + User profile is available. Using '/Users/jarednance/.aspnet/DataProtection-Keys' as key repository; keys will not be encrypted at rest. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-b040dd03-33c5-451e-8f42-3c9dd4e0dfec.xml'. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-c8147b66-2deb-407c-9421-1553f0e16d67.xml'. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-f7fa4a09-6d65-426e-a653-cbd2969e5073.xml'. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {b040dd03-33c5-451e-8f42-3c9dd4e0dfec}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {c8147b66-2deb-407c-9421-1553f0e16d67}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {f7fa4a09-6d65-426e-a653-cbd2969e5073}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.DefaultKeyResolver[13] + Considering key {c8147b66-2deb-407c-9421-1553f0e16d67} with expiration date 2018-03-03 16:22:35Z as default key. +dbug: Microsoft.AspNetCore.DataProtection.TypeForwardingActivator[0] + Forwarded activator type request from Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Version=1.1.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60 to Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Culture=neutral, PublicKeyToken=adb9793829ddae60 +[xUnit.net 00:00:12.5136610] Stack Trace: +dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptorFactory[11] + Using managed symmetric algorithm 'System.Security.Cryptography.Aes'. +dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptorFactory[10] + Using managed keyed hash algorithm 'System.Security.Cryptography.HMACSHA256'. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingProvider[2] + Using key {c8147b66-2deb-407c-9421-1553f0e16d67} as the default key. +dbug: Microsoft.AspNetCore.DataProtection.Internal.DataProtectionStartupFilter[0] + Key ring with default key {c8147b66-2deb-407c-9421-1553f0e16d67} was loaded during application startup. +[xUnit.net 00:00:12.5158820] /Users/jarednance/dev/json-api-dotnet-core/src/JsonApiDotNetCore/Serialization/JsonApiDeSerializer.cs(38,0): at JsonApiDotNetCore.Serialization.JsonApiDeSerializer.Deserialize(String requestBody) +[xUnit.net 00:00:12.5161330] /Users/jarednance/dev/json-api-dotnet-core/test/JsonApiDotNetCoreExampleTests/Acceptance/Spec/CreatingDataTests.cs(273,0): at JsonApiDotNetCoreExampleTests.Acceptance.Spec.CreatingDataTests.d__8.MoveNext() +[xUnit.net 00:00:12.5165710] --- End of stack trace from previous location where exception was thrown --- +[xUnit.net 00:00:12.5167200] at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() +[xUnit.net 00:00:12.5168760] at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +[xUnit.net 00:00:12.5170850] --- End of stack trace from previous location where exception was thrown --- +[xUnit.net 00:00:12.5171820] at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() +[xUnit.net 00:00:12.5172640] at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +[xUnit.net 00:00:12.5174340] --- End of stack trace from previous location where exception was thrown --- +[xUnit.net 00:00:12.5175190] at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() +[xUnit.net 00:00:12.5175960] at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +[xUnit.net 00:00:12.5180580] ----- Inner Stack Trace ----- +[xUnit.net 00:00:12.5182020] /Users/jarednance/dev/json-api-dotnet-core/src/JsonApiDotNetCore/Serialization/JsonApiDeSerializer.cs(32,0): at JsonApiDotNetCore.Serialization.JsonApiDeSerializer.Deserialize(String requestBody) +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[], CommandType='Text', CommandTimeout='30'] + + SELECT CASE WHEN COUNT(*) = 0 THEN FALSE ELSE TRUE END + FROM information_schema.tables + WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema') +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (3ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + + SELECT CASE WHEN COUNT(*) = 0 THEN FALSE ELSE TRUE END + FROM information_schema.tables + WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema') +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[3] + Hosting starting +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[4] + Hosting started +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[0] + Loaded hosting startup assembly JsonApiDotNetCoreExample +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 POST http://localhost/api/v1/todo-items application/vnd.api+json +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 POST http://localhost/api/v1/todo-items application/vnd.api+json +dbug: Microsoft.AspNetCore.Routing.Tree.TreeRouter[1] + Request successfully matched the route with name '(null)' and template 'api/v1/todo-items'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample)' with id '72eb1fba-bd67-40f7-841e-5d45f4d87655' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action JsonApiDotNetCoreExample.Controllers.TodoItemsController.PostAsync (JsonApiDotNetCoreExample) +dbug: Microsoft.AspNetCore.Mvc.ModelBinding.Binders.BodyModelBinder[1] + Selected input formatter 'JsonApiDotNetCore.Formatters.JsonApiInputFormatter' for content type 'application/vnd.api+json'. +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.PostAsync (JsonApiDotNetCoreExample) with arguments (JsonApiDotNetCoreExample.Models.TodoItem) - ModelState is Valid +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.PostAsync (JsonApiDotNetCoreExample) with arguments (JsonApiDotNetCoreExample.Models.TodoItem) - ModelState is Valid +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20200] + Beginning transaction with isolation level 'ReadCommitted'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6) + RETURNING "Id", "CreatedDate"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (11ms) [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6) + RETURNING "Id", "CreatedDate"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (11ms) [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6) + RETURNING "Id", "CreatedDate"; +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20202] + Committing transaction. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20204] + Disposing transaction. +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.PostAsync (JsonApiDotNetCoreExample), returned result Microsoft.AspNetCore.Mvc.CreatedResult. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[4] + No information found on request to perform content negotiation. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[2] + Selected output formatter 'JsonApiDotNetCore.Formatters.JsonApiOutputFormatter' and content type '' to write the response. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: JsonApiDotNetCore.Formatters.JsonApiWriter[0] + Formatting response as JSONAPI +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.TodoItemsController.PostAsync (JsonApiDotNetCoreExample) in 78.019ms +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 102.786ms 201 application/vnd.api+json +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.TodoItemsController.PostAsync (JsonApiDotNetCoreExample) in 78.019ms +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 102.786ms 201 application/vnd.api+json +info: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[0] + User profile is available. Using '/Users/jarednance/.aspnet/DataProtection-Keys' as key repository; keys will not be encrypted at rest. +warn: Microsoft.EntityFrameworkCore.Infrastructure[10402] + More than twenty 'IServiceProvider' instances have been created for internal use by Entity Framework. Consider reviewing calls on 'DbContextOptionsBuilder' that may require new service providers to be built. +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + + SELECT CASE WHEN COUNT(*) = 0 THEN FALSE ELSE TRUE END + FROM information_schema.tables + WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema') +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 POST http://localhost/api/v1/todo-items application/vnd.api+json +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 POST http://localhost/api/v1/todo-items application/vnd.api+json +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.PostAsync (JsonApiDotNetCoreExample) with arguments (JsonApiDotNetCoreExample.Models.TodoItem) - ModelState is Valid +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.PostAsync (JsonApiDotNetCoreExample) with arguments (JsonApiDotNetCoreExample.Models.TodoItem) - ModelState is Valid +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (11ms) [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("Id", "AchievedDate", "AssigneeId", "CollectionId", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6, @p7) + RETURNING "CreatedDate"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (11ms) [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("Id", "AchievedDate", "AssigneeId", "CollectionId", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6, @p7) + RETURNING "CreatedDate"; +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: JsonApiDotNetCore.Formatters.JsonApiWriter[0] + Formatting response as JSONAPI +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.TodoItemsController.PostAsync (JsonApiDotNetCoreExample) in 72.862ms +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 94.538ms 201 application/vnd.api+json +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.TodoItemsController.PostAsync (JsonApiDotNetCoreExample) in 72.862ms +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 94.538ms 201 application/vnd.api+json +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Query[10101] + Compiling query model: + '(from TodoItem _1 in DbSet + select [_1]).LastOrDefault()' +dbug: Microsoft.EntityFrameworkCore.Query[10104] + Optimized query model: + '(from TodoItem _1 in DbSet + select [_1]).LastOrDefault()' +warn: Microsoft.EntityFrameworkCore.Query[20500] + The LINQ expression 'LastOrDefault()' could not be translated and will be evaluated locally. +warn: Microsoft.EntityFrameworkCore.Query[20500] + The LINQ expression 'LastOrDefault()' could not be translated and will be evaluated locally. +dbug: Microsoft.EntityFrameworkCore.Query[10107] + (QueryContext queryContext) => IEnumerable _InterceptExceptions( + source: IEnumerable _TrackEntities( + results: IEnumerable _ToSequence(TodoItem LastOrDefault(IEnumerable _ShapedQuery( + queryContext: queryContext, + shaperCommandContext: SelectExpression: + SELECT "t"."Id", "t"."AchievedDate", "t"."AssigneeId", "t"."CollectionId", "t"."CreatedDate", "t"."Description", "t"."GuidProperty", "t"."Ordinal", "t"."OwnerId" + FROM "TodoItems" AS "t", + shaper: UnbufferedEntityShaper))), + queryContext: queryContext, + entityTrackingInfos: { itemType: TodoItem }, + entityAccessors: List> + { + Func, + } + ), + contextType: JsonApiDotNetCoreExample.Data.AppDbContext, + logger: DiagnosticsLogger, + queryContext: queryContext) +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[], CommandType='Text', CommandTimeout='30'] + SELECT "t"."Id", "t"."AchievedDate", "t"."AssigneeId", "t"."CollectionId", "t"."CreatedDate", "t"."Description", "t"."GuidProperty", "t"."Ordinal", "t"."OwnerId" + FROM "TodoItems" AS "t" +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + SELECT "t"."Id", "t"."AchievedDate", "t"."AssigneeId", "t"."CollectionId", "t"."CreatedDate", "t"."Description", "t"."GuidProperty", "t"."Ordinal", "t"."OwnerId" + FROM "TodoItems" AS "t" +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + SELECT "t"."Id", "t"."AchievedDate", "t"."AssigneeId", "t"."CollectionId", "t"."CreatedDate", "t"."Description", "t"."GuidProperty", "t"."Ordinal", "t"."OwnerId" + FROM "TodoItems" AS "t" +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Infrastructure[10401] + An 'IServiceProvider' was created for internal use by Entity Framework. +warn: Microsoft.EntityFrameworkCore.Infrastructure[10402] + More than twenty 'IServiceProvider' instances have been created for internal use by Entity Framework. Consider reviewing calls on 'DbContextOptionsBuilder' that may require new service providers to be built. +info: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[0] + User profile is available. Using '/Users/jarednance/.aspnet/DataProtection-Keys' as key repository; keys will not be encrypted at rest. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-b040dd03-33c5-451e-8f42-3c9dd4e0dfec.xml'. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-c8147b66-2deb-407c-9421-1553f0e16d67.xml'. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-f7fa4a09-6d65-426e-a653-cbd2969e5073.xml'. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {b040dd03-33c5-451e-8f42-3c9dd4e0dfec}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {c8147b66-2deb-407c-9421-1553f0e16d67}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {f7fa4a09-6d65-426e-a653-cbd2969e5073}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.DefaultKeyResolver[13] + Considering key {c8147b66-2deb-407c-9421-1553f0e16d67} with expiration date 2018-03-03 16:22:35Z as default key. +dbug: Microsoft.AspNetCore.DataProtection.TypeForwardingActivator[0] + Forwarded activator type request from Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Version=1.1.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60 to Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Culture=neutral, PublicKeyToken=adb9793829ddae60 +dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptorFactory[11] + Using managed symmetric algorithm 'System.Security.Cryptography.Aes'. +dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptorFactory[10] + Using managed keyed hash algorithm 'System.Security.Cryptography.HMACSHA256'. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingProvider[2] + Using key {c8147b66-2deb-407c-9421-1553f0e16d67} as the default key. +dbug: Microsoft.AspNetCore.DataProtection.Internal.DataProtectionStartupFilter[0] + Key ring with default key {c8147b66-2deb-407c-9421-1553f0e16d67} was loaded during application startup. +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[], CommandType='Text', CommandTimeout='30'] + + SELECT CASE WHEN COUNT(*) = 0 THEN FALSE ELSE TRUE END + FROM information_schema.tables + WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema') +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (3ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + + SELECT CASE WHEN COUNT(*) = 0 THEN FALSE ELSE TRUE END + FROM information_schema.tables + WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema') +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[3] + Hosting starting +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[4] + Hosting started +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[0] + Loaded hosting startup assembly JsonApiDotNetCoreExample +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 DELETE http://localhost/api/v1/todo-items/10099 +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 DELETE http://localhost/api/v1/todo-items/10099 +dbug: Microsoft.AspNetCore.Routing.Tree.TreeRouter[1] + Request successfully matched the route with name '(null)' and template 'api/v1/todo-items/{id}'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample)' with id 'fe31e5b4-7432-4ff5-978a-cd27e2b93135' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.TodoItemsController.PatchAsync (JsonApiDotNetCoreExample)' with id '3c77838f-36d1-41ad-b93d-e79ea0456a72' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action JsonApiDotNetCoreExample.Controllers.TodoItemsController.DeleteAsync (JsonApiDotNetCoreExample) +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.DeleteAsync (JsonApiDotNetCoreExample) with arguments (10099) - ModelState is Valid +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Query[10101] + Compiling query model: + '(from TodoItem e in DbSet + where bool [e].Id.Equals((object)__id_0) + select [e]).SingleOrDefault()' +dbug: Microsoft.EntityFrameworkCore.Query[10104] + Optimized query model: + '(from TodoItem e in DbSet + where bool [e].Id.Equals((object)__id_0) + select [e]).SingleOrDefault()' +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.DeleteAsync (JsonApiDotNetCoreExample) with arguments (10099) - ModelState is Valid +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Query[10107] + (QueryContext queryContext) => IAsyncEnumerable _InterceptExceptions( + source: IAsyncEnumerable _TrackEntities( + results: IAsyncEnumerable _ToSequence(Task SingleOrDefault( + source: IAsyncEnumerable _ShapedQuery( + queryContext: queryContext, + shaperCommandContext: SelectExpression: + SELECT "e"."Id", "e"."AchievedDate", "e"."AssigneeId", "e"."CollectionId", "e"."CreatedDate", "e"."Description", "e"."GuidProperty", "e"."Ordinal", "e"."OwnerId" + FROM "TodoItems" AS "e" + WHERE "e"."Id" = @__id_0 + LIMIT 2, + shaper: UnbufferedEntityShaper), + cancellationToken: queryContext.CancellationToken)), + queryContext: queryContext, + entityTrackingInfos: { itemType: TodoItem }, + entityAccessors: List> + { + Func, + } + ), + contextType: JsonApiDotNetCoreExample.Data.AppDbContext, + logger: DiagnosticsLogger, + queryContext: queryContext) +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "e"."Id", "e"."AchievedDate", "e"."AssigneeId", "e"."CollectionId", "e"."CreatedDate", "e"."Description", "e"."GuidProperty", "e"."Ordinal", "e"."OwnerId" + FROM "TodoItems" AS "e" + WHERE "e"."Id" = @__id_0 + LIMIT 2 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (16ms) [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "e"."Id", "e"."AchievedDate", "e"."AssigneeId", "e"."CollectionId", "e"."CreatedDate", "e"."Description", "e"."GuidProperty", "e"."Ordinal", "e"."OwnerId" + FROM "TodoItems" AS "e" + WHERE "e"."Id" = @__id_0 + LIMIT 2 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (16ms) [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "e"."Id", "e"."AchievedDate", "e"."AssigneeId", "e"."CollectionId", "e"."CreatedDate", "e"."Description", "e"."GuidProperty", "e"."Ordinal", "e"."OwnerId" + FROM "TodoItems" AS "e" + WHERE "e"."Id" = @__id_0 + LIMIT 2 +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.DeleteAsync (JsonApiDotNetCoreExample), returned result Microsoft.AspNetCore.Mvc.NotFoundResult. +info: Microsoft.AspNetCore.Mvc.StatusCodeResult[1] + Executing HttpStatusCodeResult, setting HTTP status code 404 +info: Microsoft.AspNetCore.Mvc.StatusCodeResult[1] + Executing HttpStatusCodeResult, setting HTTP status code 404 +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.TodoItemsController.DeleteAsync (JsonApiDotNetCoreExample) in 26.655ms +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.TodoItemsController.DeleteAsync (JsonApiDotNetCoreExample) in 26.655ms +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 58.036ms 404 +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 58.036ms 404 +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20200] + Beginning transaction with isolation level 'ReadCommitted'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@p0='?', @p1='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "People" ("FirstName", "LastName") + VALUES (@p0, @p1) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p0='?', @p1='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "People" ("FirstName", "LastName") + VALUES (@p0, @p1) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p0='?', @p1='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "People" ("FirstName", "LastName") + VALUES (@p0, @p1) + RETURNING "Id"; +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?', @p8='?', @p9='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p2, @p3, @p4, @p5, @p6, @p7, @p8, @p9) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?', @p8='?', @p9='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p2, @p3, @p4, @p5, @p6, @p7, @p8, @p9) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?', @p8='?', @p9='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p2, @p3, @p4, @p5, @p6, @p7, @p8, @p9) + RETURNING "Id"; +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20202] + Committing transaction. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20204] + Disposing transaction. +dbug: Microsoft.EntityFrameworkCore.Infrastructure[10401] + An 'IServiceProvider' was created for internal use by Entity Framework. +warn: Microsoft.EntityFrameworkCore.Infrastructure[10402] + More than twenty 'IServiceProvider' instances have been created for internal use by Entity Framework. Consider reviewing calls on 'DbContextOptionsBuilder' that may require new service providers to be built. +info: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[0] + User profile is available. Using '/Users/jarednance/.aspnet/DataProtection-Keys' as key repository; keys will not be encrypted at rest. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-b040dd03-33c5-451e-8f42-3c9dd4e0dfec.xml'. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-c8147b66-2deb-407c-9421-1553f0e16d67.xml'. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-f7fa4a09-6d65-426e-a653-cbd2969e5073.xml'. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {b040dd03-33c5-451e-8f42-3c9dd4e0dfec}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {c8147b66-2deb-407c-9421-1553f0e16d67}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {f7fa4a09-6d65-426e-a653-cbd2969e5073}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.DefaultKeyResolver[13] + Considering key {c8147b66-2deb-407c-9421-1553f0e16d67} with expiration date 2018-03-03 16:22:35Z as default key. +dbug: Microsoft.AspNetCore.DataProtection.TypeForwardingActivator[0] + Forwarded activator type request from Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Version=1.1.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60 to Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Culture=neutral, PublicKeyToken=adb9793829ddae60 +dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptorFactory[11] + Using managed symmetric algorithm 'System.Security.Cryptography.Aes'. +dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptorFactory[10] + Using managed keyed hash algorithm 'System.Security.Cryptography.HMACSHA256'. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingProvider[2] + Using key {c8147b66-2deb-407c-9421-1553f0e16d67} as the default key. +dbug: Microsoft.AspNetCore.DataProtection.Internal.DataProtectionStartupFilter[0] + Key ring with default key {c8147b66-2deb-407c-9421-1553f0e16d67} was loaded during application startup. +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[], CommandType='Text', CommandTimeout='30'] + + SELECT CASE WHEN COUNT(*) = 0 THEN FALSE ELSE TRUE END + FROM information_schema.tables + WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema') +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (3ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + + SELECT CASE WHEN COUNT(*) = 0 THEN FALSE ELSE TRUE END + FROM information_schema.tables + WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema') +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[3] + Hosting starting +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[4] + Hosting started +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[0] + Loaded hosting startup assembly JsonApiDotNetCoreExample +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 GET http://localhost/api/v1/todo-items/2611?include=owner +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 GET http://localhost/api/v1/todo-items/2611?include=owner +dbug: Microsoft.AspNetCore.Routing.Tree.TreeRouter[1] + Request successfully matched the route with name '(null)' and template 'api/v1/todo-items/{id}'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.TodoItemsController.PatchAsync (JsonApiDotNetCoreExample)' with id 'da4f66ae-3f53-4439-80dc-28886ee0c729' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.TodoItemsController.DeleteAsync (JsonApiDotNetCoreExample)' with id 'df4d22d4-25aa-4cc4-b517-33a346cabff2' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) with arguments (2611) - ModelState is Valid +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) with arguments (2611) - ModelState is Valid +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Query[10101] + Compiling query model: + '(from TodoItem e in DbSet + where bool [e].Id.Equals((object)__id_0) + select [e]) + .Include("Owner") + .FirstOrDefault()' +dbug: Microsoft.EntityFrameworkCore.Query[10105] + Including navigation: '[e].Owner' +dbug: Microsoft.EntityFrameworkCore.Query[10104] + Optimized query model: + '(from TodoItem e in DbSet + join Person e.Owner in DbSet + on Property([e], "OwnerId") equals (Nullable)Property([e.Owner], "Id") into e.Owner_group + from Person e.Owner in + (from Person e.Owner_groupItem in [e.Owner_group] + select [e.Owner_groupItem]).DefaultIfEmpty() + where bool [e].Id.Equals((object)__id_0) + select TodoItem _Include( + queryContext: queryContext, + entity: [e], + included: new object[]{ [e.Owner] }, + fixup: (QueryContext queryContext | TodoItem entity | Object[] included) => + { + Void queryContext.QueryBuffer.StartTracking( + entity: entity, + entityType: EntityType: TodoItem) + return !(bool ReferenceEquals(included[0], null)) ? + { + Void queryContext.QueryBuffer.StartTracking( + entity: included[0], + entityType: EntityType: Person) + Void SetRelationshipSnapshotValue( + stateManager: queryContext.StateManager, + navigation: TodoItem.Owner, + entity: entity, + value: included[0]) + return Void AddToCollectionSnapshot( + stateManager: queryContext.StateManager, + navigation: Person.TodoItems, + entity: included[0], + value: entity) + } + : default(Void) + } + )).FirstOrDefault()' +dbug: Microsoft.EntityFrameworkCore.Query[10107] + (QueryContext queryContext) => IAsyncEnumerable _InterceptExceptions( + source: IAsyncEnumerable _TrackEntities( + results: IAsyncEnumerable _ToSequence(Task FirstOrDefault( + source: IAsyncEnumerable _Select( + source: IAsyncEnumerable> _ShapedQuery( + queryContext: queryContext, + shaperCommandContext: SelectExpression: + SELECT "e"."Id", "e"."AchievedDate", "e"."AssigneeId", "e"."CollectionId", "e"."CreatedDate", "e"."Description", "e"."GuidProperty", "e"."Ordinal", "e"."OwnerId", "e.Owner"."Id", "e.Owner"."FirstName", "e.Owner"."LastName" + FROM "TodoItems" AS "e" + LEFT JOIN "People" AS "e.Owner" ON "e"."OwnerId" = "e.Owner"."Id" + WHERE "e"."Id" = @__id_0 + LIMIT 1, + shaper: TypedCompositeShaper, TodoItem, BufferedOffsetEntityShaper, Person, TransparentIdentifier>), + selector: (TransparentIdentifier t1) => TodoItem _Include( + queryContext: queryContext, + entity: t1.Outer, + included: new object[]{ t1.Inner }, + fixup: (QueryContext queryContext | TodoItem entity | Object[] included) => + { + Void queryContext.QueryBuffer.StartTracking( + entity: entity, + entityType: EntityType: TodoItem) + return !(bool ReferenceEquals(included[0], null)) ? + { + Void queryContext.QueryBuffer.StartTracking( + entity: included[0], + entityType: EntityType: Person) + Void SetRelationshipSnapshotValue( + stateManager: queryContext.StateManager, + navigation: TodoItem.Owner, + entity: entity, + value: included[0]) + return Void AddToCollectionSnapshot( + stateManager: queryContext.StateManager, + navigation: Person.TodoItems, + entity: included[0], + value: entity) + } + : default(Void) + } + )), + cancellationToken: Unhandled parameter: queryContext.CancellationToken)), + queryContext: Unhandled parameter: queryContext, + entityTrackingInfos: { itemType: TodoItem }, + entityAccessors: List> + { + Func, + } + ), + contextType: JsonApiDotNetCoreExample.Data.AppDbContext, + logger: DiagnosticsLogger, + queryContext: Unhandled parameter: queryContext) +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "e"."Id", "e"."AchievedDate", "e"."AssigneeId", "e"."CollectionId", "e"."CreatedDate", "e"."Description", "e"."GuidProperty", "e"."Ordinal", "e"."OwnerId", "e.Owner"."Id", "e.Owner"."FirstName", "e.Owner"."LastName" + FROM "TodoItems" AS "e" + LEFT JOIN "People" AS "e.Owner" ON "e"."OwnerId" = "e.Owner"."Id" + WHERE "e"."Id" = @__id_0 + LIMIT 1 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (9ms) [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "e"."Id", "e"."AchievedDate", "e"."AssigneeId", "e"."CollectionId", "e"."CreatedDate", "e"."Description", "e"."GuidProperty", "e"."Ordinal", "e"."OwnerId", "e.Owner"."Id", "e.Owner"."FirstName", "e.Owner"."LastName" + FROM "TodoItems" AS "e" + LEFT JOIN "People" AS "e.Owner" ON "e"."OwnerId" = "e.Owner"."Id" + WHERE "e"."Id" = @__id_0 + LIMIT 1 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (9ms) [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "e"."Id", "e"."AchievedDate", "e"."AssigneeId", "e"."CollectionId", "e"."CreatedDate", "e"."Description", "e"."GuidProperty", "e"."Ordinal", "e"."OwnerId", "e.Owner"."Id", "e.Owner"."FirstName", "e.Owner"."LastName" + FROM "TodoItems" AS "e" + LEFT JOIN "People" AS "e.Owner" ON "e"."OwnerId" = "e.Owner"."Id" + WHERE "e"."Id" = @__id_0 + LIMIT 1 +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample), returned result Microsoft.AspNetCore.Mvc.OkObjectResult. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[4] + No information found on request to perform content negotiation. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[2] + Selected output formatter 'JsonApiDotNetCore.Formatters.JsonApiOutputFormatter' and content type '' to write the response. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: JsonApiDotNetCore.Formatters.JsonApiWriter[0] + Formatting response as JSONAPI +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) in 81.295ms +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 101.754ms 200 application/vnd.api+json +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) in 81.295ms +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 101.754ms 200 application/vnd.api+json +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[], CommandType='Text', CommandTimeout='30'] + SELECT "t"."Id", "t"."AchievedDate", "t"."AssigneeId", "t"."CollectionId", "t"."CreatedDate", "t"."Description", "t"."GuidProperty", "t"."Ordinal", "t"."OwnerId" + FROM "TodoItems" AS "t" +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + SELECT "t"."Id", "t"."AchievedDate", "t"."AssigneeId", "t"."CollectionId", "t"."CreatedDate", "t"."Description", "t"."GuidProperty", "t"."Ordinal", "t"."OwnerId" + FROM "TodoItems" AS "t" +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + SELECT "t"."Id", "t"."AchievedDate", "t"."AssigneeId", "t"."CollectionId", "t"."CreatedDate", "t"."Description", "t"."GuidProperty", "t"."Ordinal", "t"."OwnerId" + FROM "TodoItems" AS "t" +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20200] + Beginning transaction with isolation level 'ReadCommitted'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?', @p8='?', @p9='?', @p10='?', @p11='?', @p12='?'], CommandType='Text', CommandTimeout='30'] + DELETE FROM "TodoItems" + WHERE "Id" = @p0; + DELETE FROM "TodoItems" + WHERE "Id" = @p1; + DELETE FROM "TodoItems" + WHERE "Id" = @p2; + DELETE FROM "TodoItems" + WHERE "Id" = @p3; + DELETE FROM "TodoItems" + WHERE "Id" = @p4; + DELETE FROM "TodoItems" + WHERE "Id" = @p5; + DELETE FROM "TodoItems" + WHERE "Id" = @p6; + DELETE FROM "TodoItems" + WHERE "Id" = @p7; + DELETE FROM "TodoItems" + WHERE "Id" = @p8; + DELETE FROM "TodoItems" + WHERE "Id" = @p9; + DELETE FROM "TodoItems" + WHERE "Id" = @p10; + DELETE FROM "TodoItems" + WHERE "Id" = @p11; + DELETE FROM "TodoItems" + WHERE "Id" = @p12; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (2ms) [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?', @p8='?', @p9='?', @p10='?', @p11='?', @p12='?'], CommandType='Text', CommandTimeout='30'] + DELETE FROM "TodoItems" + WHERE "Id" = @p0; + DELETE FROM "TodoItems" + WHERE "Id" = @p1; + DELETE FROM "TodoItems" + WHERE "Id" = @p2; + DELETE FROM "TodoItems" + WHERE "Id" = @p3; + DELETE FROM "TodoItems" + WHERE "Id" = @p4; + DELETE FROM "TodoItems" + WHERE "Id" = @p5; + DELETE FROM "TodoItems" + WHERE "Id" = @p6; + DELETE FROM "TodoItems" + WHERE "Id" = @p7; + DELETE FROM "TodoItems" + WHERE "Id" = @p8; + DELETE FROM "TodoItems" + WHERE "Id" = @p9; + DELETE FROM "TodoItems" + WHERE "Id" = @p10; + DELETE FROM "TodoItems" + WHERE "Id" = @p11; + DELETE FROM "TodoItems" + WHERE "Id" = @p12; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (2ms) [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?', @p8='?', @p9='?', @p10='?', @p11='?', @p12='?'], CommandType='Text', CommandTimeout='30'] + DELETE FROM "TodoItems" + WHERE "Id" = @p0; + DELETE FROM "TodoItems" + WHERE "Id" = @p1; + DELETE FROM "TodoItems" + WHERE "Id" = @p2; + DELETE FROM "TodoItems" + WHERE "Id" = @p3; + DELETE FROM "TodoItems" + WHERE "Id" = @p4; + DELETE FROM "TodoItems" + WHERE "Id" = @p5; + DELETE FROM "TodoItems" + WHERE "Id" = @p6; + DELETE FROM "TodoItems" + WHERE "Id" = @p7; + DELETE FROM "TodoItems" + WHERE "Id" = @p8; + DELETE FROM "TodoItems" + WHERE "Id" = @p9; + DELETE FROM "TodoItems" + WHERE "Id" = @p10; + DELETE FROM "TodoItems" + WHERE "Id" = @p11; + DELETE FROM "TodoItems" + WHERE "Id" = @p12; +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20202] + Committing transaction. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20204] + Disposing transaction. +dbug: Microsoft.EntityFrameworkCore.Infrastructure[10401] + An 'IServiceProvider' was created for internal use by Entity Framework. +warn: Microsoft.EntityFrameworkCore.Infrastructure[10402] + More than twenty 'IServiceProvider' instances have been created for internal use by Entity Framework. Consider reviewing calls on 'DbContextOptionsBuilder' that may require new service providers to be built. +info: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[0] + User profile is available. Using '/Users/jarednance/.aspnet/DataProtection-Keys' as key repository; keys will not be encrypted at rest. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-b040dd03-33c5-451e-8f42-3c9dd4e0dfec.xml'. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-c8147b66-2deb-407c-9421-1553f0e16d67.xml'. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-f7fa4a09-6d65-426e-a653-cbd2969e5073.xml'. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {b040dd03-33c5-451e-8f42-3c9dd4e0dfec}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {c8147b66-2deb-407c-9421-1553f0e16d67}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {f7fa4a09-6d65-426e-a653-cbd2969e5073}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.DefaultKeyResolver[13] + Considering key {c8147b66-2deb-407c-9421-1553f0e16d67} with expiration date 2018-03-03 16:22:35Z as default key. +dbug: Microsoft.AspNetCore.DataProtection.TypeForwardingActivator[0] + Forwarded activator type request from Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Version=1.1.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60 to Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Culture=neutral, PublicKeyToken=adb9793829ddae60 +dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptorFactory[11] + Using managed symmetric algorithm 'System.Security.Cryptography.Aes'. +dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptorFactory[10] + Using managed keyed hash algorithm 'System.Security.Cryptography.HMACSHA256'. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingProvider[2] + Using key {c8147b66-2deb-407c-9421-1553f0e16d67} as the default key. +dbug: Microsoft.AspNetCore.DataProtection.Internal.DataProtectionStartupFilter[0] + Key ring with default key {c8147b66-2deb-407c-9421-1553f0e16d67} was loaded during application startup. +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[], CommandType='Text', CommandTimeout='30'] + + SELECT CASE WHEN COUNT(*) = 0 THEN FALSE ELSE TRUE END + FROM information_schema.tables + WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema') +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + + SELECT CASE WHEN COUNT(*) = 0 THEN FALSE ELSE TRUE END + FROM information_schema.tables + WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema') +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[3] + Hosting starting +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[4] + Hosting started +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[0] + Loaded hosting startup assembly JsonApiDotNetCoreExample +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 GET http://localhost/api/v1/todo-items +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 GET http://localhost/api/v1/todo-items +dbug: Microsoft.AspNetCore.Routing.Tree.TreeRouter[1] + Request successfully matched the route with name '(null)' and template 'api/v1/todo-items'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.TodoItemsController.PostAsync (JsonApiDotNetCoreExample)' with id '45c59ea2-28ca-4bbb-b184-0cd79d273bed' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) with arguments ((null)) - ModelState is Valid +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) with arguments ((null)) - ModelState is Valid +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Query[10101] + Compiling query model: + '(from TodoItem _1 in DbSet + select [_1]).Count()' +dbug: Microsoft.EntityFrameworkCore.Query[10104] + Optimized query model: + '(from TodoItem _1 in DbSet + select [_1]).Count()' +dbug: Microsoft.EntityFrameworkCore.Query[10107] + (QueryContext queryContext) => IAsyncEnumerable _InterceptExceptions( + source: IAsyncEnumerable _ToSequence(Task GetResult( + valueBuffers: IAsyncEnumerable _Query( + queryContext: queryContext, + shaperCommandContext: SelectExpression: + SELECT COUNT(*)::INT4 + FROM "TodoItems" AS "t"), + throwOnNullResult: False, + cancellationToken: queryContext.CancellationToken)), + contextType: JsonApiDotNetCoreExample.Data.AppDbContext, + logger: DiagnosticsLogger, + queryContext: queryContext) +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[], CommandType='Text', CommandTimeout='30'] + SELECT COUNT(*)::INT4 + FROM "TodoItems" AS "t" +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (8ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + SELECT COUNT(*)::INT4 + FROM "TodoItems" AS "t" +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (8ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + SELECT COUNT(*)::INT4 + FROM "TodoItems" AS "t" +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +info: JsonApiDotNetCore.Services.EntityResourceService[0] + Applying paging query. Fetching page 0 with 5 entities +dbug: Microsoft.EntityFrameworkCore.Query[10101] + Compiling query model: + '(from TodoItem _2 in DbSet + select [_2]) + .Skip(__p_0) + .Take(__p_1)' +warn: Microsoft.EntityFrameworkCore.Query[10102] + Query: '(from TodoItem _2 in DbSet select [_2]).Skip(__p_0).Take(__p_1)' uses a row limiting operation (Skip/Take) without OrderBy which may lead to unpredictable results. +warn: Microsoft.EntityFrameworkCore.Query[10102] + Query: '(from TodoItem _2 in DbSet select [_2]).Skip(__p_0).Take(__p_1)' uses a row limiting operation (Skip/Take) without OrderBy which may lead to unpredictable results. +dbug: Microsoft.EntityFrameworkCore.Query[10104] + Optimized query model: + '(from TodoItem _2 in DbSet + select [_2]) + .Skip(__p_0) + .Take(__p_1)' +dbug: Microsoft.EntityFrameworkCore.Query[10107] + (QueryContext queryContext) => IAsyncEnumerable _InterceptExceptions( + source: IAsyncEnumerable _TrackEntities( + results: IAsyncEnumerable _ShapedQuery( + queryContext: queryContext, + shaperCommandContext: SelectExpression: + SELECT "t"."Id", "t"."AchievedDate", "t"."AssigneeId", "t"."CollectionId", "t"."CreatedDate", "t"."Description", "t"."GuidProperty", "t"."Ordinal", "t"."OwnerId" + FROM "TodoItems" AS "t" + LIMIT @__p_1 OFFSET @__p_0, + shaper: UnbufferedEntityShaper), + queryContext: queryContext, + entityTrackingInfos: { itemType: TodoItem }, + entityAccessors: List> + { + Func, + } + ), + contextType: JsonApiDotNetCoreExample.Data.AppDbContext, + logger: DiagnosticsLogger, + queryContext: queryContext) +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@__p_1='?', @__p_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "t"."Id", "t"."AchievedDate", "t"."AssigneeId", "t"."CollectionId", "t"."CreatedDate", "t"."Description", "t"."GuidProperty", "t"."Ordinal", "t"."OwnerId" + FROM "TodoItems" AS "t" + LIMIT @__p_1 OFFSET @__p_0 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (2ms) [Parameters=[@__p_1='?', @__p_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "t"."Id", "t"."AchievedDate", "t"."AssigneeId", "t"."CollectionId", "t"."CreatedDate", "t"."Description", "t"."GuidProperty", "t"."Ordinal", "t"."OwnerId" + FROM "TodoItems" AS "t" + LIMIT @__p_1 OFFSET @__p_0 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (2ms) [Parameters=[@__p_1='?', @__p_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "t"."Id", "t"."AchievedDate", "t"."AssigneeId", "t"."CollectionId", "t"."CreatedDate", "t"."Description", "t"."GuidProperty", "t"."Ordinal", "t"."OwnerId" + FROM "TodoItems" AS "t" + LIMIT @__p_1 OFFSET @__p_0 +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample), returned result Microsoft.AspNetCore.Mvc.OkObjectResult. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[4] + No information found on request to perform content negotiation. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[2] + Selected output formatter 'JsonApiDotNetCore.Formatters.JsonApiOutputFormatter' and content type '' to write the response. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: JsonApiDotNetCore.Formatters.JsonApiWriter[0] + Formatting response as JSONAPI +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) in 41.443ms +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) in 41.443ms +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 57.056ms 200 application/vnd.api+json +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 57.056ms 200 application/vnd.api+json +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20200] + Beginning transaction with isolation level 'ReadCommitted'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6, @p7) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (3ms) [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6, @p7) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (3ms) [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6, @p7) + RETURNING "Id"; +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20202] + Committing transaction. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20204] + Disposing transaction. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20200] + Beginning transaction with isolation level 'ReadCommitted'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@p0='?'], CommandType='Text', CommandTimeout='30'] + DELETE FROM "TodoItems" + WHERE "Id" = @p0; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p0='?'], CommandType='Text', CommandTimeout='30'] + DELETE FROM "TodoItems" + WHERE "Id" = @p0; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p0='?'], CommandType='Text', CommandTimeout='30'] + DELETE FROM "TodoItems" + WHERE "Id" = @p0; +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20202] + Committing transaction. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20204] + Disposing transaction. +dbug: Microsoft.EntityFrameworkCore.Infrastructure[10401] + An 'IServiceProvider' was created for internal use by Entity Framework. +warn: Microsoft.EntityFrameworkCore.Infrastructure[10402] + More than twenty 'IServiceProvider' instances have been created for internal use by Entity Framework. Consider reviewing calls on 'DbContextOptionsBuilder' that may require new service providers to be built. +info: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[0] + User profile is available. Using '/Users/jarednance/.aspnet/DataProtection-Keys' as key repository; keys will not be encrypted at rest. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-b040dd03-33c5-451e-8f42-3c9dd4e0dfec.xml'. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-c8147b66-2deb-407c-9421-1553f0e16d67.xml'. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-f7fa4a09-6d65-426e-a653-cbd2969e5073.xml'. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {b040dd03-33c5-451e-8f42-3c9dd4e0dfec}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {c8147b66-2deb-407c-9421-1553f0e16d67}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {f7fa4a09-6d65-426e-a653-cbd2969e5073}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.DefaultKeyResolver[13] + Considering key {c8147b66-2deb-407c-9421-1553f0e16d67} with expiration date 2018-03-03 16:22:35Z as default key. +dbug: Microsoft.AspNetCore.DataProtection.TypeForwardingActivator[0] + Forwarded activator type request from Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Version=1.1.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60 to Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Culture=neutral, PublicKeyToken=adb9793829ddae60 +dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptorFactory[11] + Using managed symmetric algorithm 'System.Security.Cryptography.Aes'. +dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptorFactory[10] + Using managed keyed hash algorithm 'System.Security.Cryptography.HMACSHA256'. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingProvider[2] + Using key {c8147b66-2deb-407c-9421-1553f0e16d67} as the default key. +dbug: Microsoft.AspNetCore.DataProtection.Internal.DataProtectionStartupFilter[0] + Key ring with default key {c8147b66-2deb-407c-9421-1553f0e16d67} was loaded during application startup. +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[], CommandType='Text', CommandTimeout='30'] + + SELECT CASE WHEN COUNT(*) = 0 THEN FALSE ELSE TRUE END + FROM information_schema.tables + WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema') +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (3ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + + SELECT CASE WHEN COUNT(*) = 0 THEN FALSE ELSE TRUE END + FROM information_schema.tables + WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema') +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[3] + Hosting starting +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[4] + Hosting started +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[0] + Loaded hosting startup assembly JsonApiDotNetCoreExample +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 GET http://localhost/api/v1/todo-items/2612/owner +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 GET http://localhost/api/v1/todo-items/2612/owner +dbug: Microsoft.AspNetCore.Routing.Tree.TreeRouter[1] + Request successfully matched the route with name '(null)' and template 'api/v1/todo-items/{id}/{relationshipName}'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetRelationshipAsync (JsonApiDotNetCoreExample) +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetRelationshipAsync (JsonApiDotNetCoreExample) with arguments (2612, owner) - ModelState is Valid +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetRelationshipAsync (JsonApiDotNetCoreExample) with arguments (2612, owner) - ModelState is Valid +trce: JsonApiDotNetCore.Services.EntityResourceService[0] + Looking up 'Owner'... +dbug: JsonApiDotNetCore.Data.DefaultEntityRepository[0] + [JADN] GetAndIncludeAsync(2612, Owner) +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Query[10101] + Compiling query model: + '(from TodoItem e in + (from TodoItem _1 in DbSet + select [_1]).Include("Owner") + where bool [e].Id.Equals((object)__id_0) + select [e]).SingleOrDefault()' +dbug: Microsoft.EntityFrameworkCore.Query[10105] + Including navigation: '[_1].Owner' +dbug: Microsoft.EntityFrameworkCore.Query[10104] + Optimized query model: + '(from TodoItem e in DbSet + join Person e.Owner in DbSet + on Property([e], "OwnerId") equals (Nullable)Property([e.Owner], "Id") into e.Owner_group + from Person e.Owner in + (from Person e.Owner_groupItem in [e.Owner_group] + select [e.Owner_groupItem]).DefaultIfEmpty() + where bool [e].Id.Equals((object)__id_0) + select TodoItem _Include( + queryContext: queryContext, + entity: [e], + included: new object[]{ [e.Owner] }, + fixup: (QueryContext queryContext | TodoItem entity | Object[] included) => + { + Void queryContext.QueryBuffer.StartTracking( + entity: entity, + entityType: EntityType: TodoItem) + return !(bool ReferenceEquals(included[0], null)) ? + { + Void queryContext.QueryBuffer.StartTracking( + entity: included[0], + entityType: EntityType: Person) + Void SetRelationshipSnapshotValue( + stateManager: queryContext.StateManager, + navigation: TodoItem.Owner, + entity: entity, + value: included[0]) + return Void AddToCollectionSnapshot( + stateManager: queryContext.StateManager, + navigation: Person.TodoItems, + entity: included[0], + value: entity) + } + : default(Void) + } + )).SingleOrDefault()' +dbug: Microsoft.EntityFrameworkCore.Query[10107] + (QueryContext queryContext) => IAsyncEnumerable _InterceptExceptions( + source: IAsyncEnumerable _TrackEntities( + results: IAsyncEnumerable _ToSequence(Task SingleOrDefault( + source: IAsyncEnumerable _Select( + source: IAsyncEnumerable> _ShapedQuery( + queryContext: queryContext, + shaperCommandContext: SelectExpression: + SELECT "e"."Id", "e"."AchievedDate", "e"."AssigneeId", "e"."CollectionId", "e"."CreatedDate", "e"."Description", "e"."GuidProperty", "e"."Ordinal", "e"."OwnerId", "e.Owner"."Id", "e.Owner"."FirstName", "e.Owner"."LastName" + FROM "TodoItems" AS "e" + LEFT JOIN "People" AS "e.Owner" ON "e"."OwnerId" = "e.Owner"."Id" + WHERE "e"."Id" = @__id_0 + LIMIT 2, + shaper: TypedCompositeShaper, TodoItem, BufferedOffsetEntityShaper, Person, TransparentIdentifier>), + selector: (TransparentIdentifier t1) => TodoItem _Include( + queryContext: queryContext, + entity: t1.Outer, + included: new object[]{ t1.Inner }, + fixup: (QueryContext queryContext | TodoItem entity | Object[] included) => + { + Void queryContext.QueryBuffer.StartTracking( + entity: entity, + entityType: EntityType: TodoItem) + return !(bool ReferenceEquals(included[0], null)) ? + { + Void queryContext.QueryBuffer.StartTracking( + entity: included[0], + entityType: EntityType: Person) + Void SetRelationshipSnapshotValue( + stateManager: queryContext.StateManager, + navigation: TodoItem.Owner, + entity: entity, + value: included[0]) + return Void AddToCollectionSnapshot( + stateManager: queryContext.StateManager, + navigation: Person.TodoItems, + entity: included[0], + value: entity) + } + : default(Void) + } + )), + cancellationToken: Unhandled parameter: queryContext.CancellationToken)), + queryContext: Unhandled parameter: queryContext, + entityTrackingInfos: { itemType: TodoItem }, + entityAccessors: List> + { + Func, + } + ), + contextType: JsonApiDotNetCoreExample.Data.AppDbContext, + logger: DiagnosticsLogger, + queryContext: Unhandled parameter: queryContext) +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "e"."Id", "e"."AchievedDate", "e"."AssigneeId", "e"."CollectionId", "e"."CreatedDate", "e"."Description", "e"."GuidProperty", "e"."Ordinal", "e"."OwnerId", "e.Owner"."Id", "e.Owner"."FirstName", "e.Owner"."LastName" + FROM "TodoItems" AS "e" + LEFT JOIN "People" AS "e.Owner" ON "e"."OwnerId" = "e.Owner"."Id" + WHERE "e"."Id" = @__id_0 + LIMIT 2 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (10ms) [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "e"."Id", "e"."AchievedDate", "e"."AssigneeId", "e"."CollectionId", "e"."CreatedDate", "e"."Description", "e"."GuidProperty", "e"."Ordinal", "e"."OwnerId", "e.Owner"."Id", "e.Owner"."FirstName", "e.Owner"."LastName" + FROM "TodoItems" AS "e" + LEFT JOIN "People" AS "e.Owner" ON "e"."OwnerId" = "e.Owner"."Id" + WHERE "e"."Id" = @__id_0 + LIMIT 2 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (10ms) [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "e"."Id", "e"."AchievedDate", "e"."AssigneeId", "e"."CollectionId", "e"."CreatedDate", "e"."Description", "e"."GuidProperty", "e"."Ordinal", "e"."OwnerId", "e.Owner"."Id", "e.Owner"."FirstName", "e.Owner"."LastName" + FROM "TodoItems" AS "e" + LEFT JOIN "People" AS "e.Owner" ON "e"."OwnerId" = "e.Owner"."Id" + WHERE "e"."Id" = @__id_0 + LIMIT 2 +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +fail: JsonApiDotNetCore.Middleware.JsonApiExceptionFilter[0] + An unhandled exception occurred during the request +JsonApiDotNetCore.Internal.JsonApiException: Relationship Owner not found. + at JsonApiDotNetCore.Services.EntityResourceService`2.d__9.MoveNext() in /Users/jarednance/dev/json-api-dotnet-core/src/JsonApiDotNetCore/Services/EntityResourceService.cs:line 102 +--- End of stack trace from previous location where exception was thrown --- + at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) + at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult() + at JsonApiDotNetCore.Controllers.BaseJsonApiController`2.d__15.MoveNext() in /Users/jarednance/dev/json-api-dotnet-core/src/JsonApiDotNetCore/Controllers/BaseJsonApiController.cs:line 141 +--- End of stack trace from previous location where exception was thrown --- + at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) + at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult() + at JsonApiDotNetCore.Controllers.JsonApiController`2.d__6.MoveNext() in /Users/jarednance/dev/json-api-dotnet-core/src/JsonApiDotNetCore/Controllers/JsonApiController.cs:line 73 +--- End of stack trace from previous location where exception was thrown --- + at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) + at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.d__12.MoveNext() +--- End of stack trace from previous location where exception was thrown --- + at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) + at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.d__10.MoveNext() +--- End of stack trace from previous location where exception was thrown --- + at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Rethrow(ActionExecutedContext context) + at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) + at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.d__14.MoveNext() +--- End of stack trace from previous location where exception was thrown --- + at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) + at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.d__23.MoveNext() +fail: JsonApiDotNetCore.Middleware.JsonApiExceptionFilter[0] + An unhandled exception occurred during the request +JsonApiDotNetCore.Internal.JsonApiException: Relationship Owner not found. + at JsonApiDotNetCore.Services.EntityResourceService`2.d__9.MoveNext() in /Users/jarednance/dev/json-api-dotnet-core/src/JsonApiDotNetCore/Services/EntityResourceService.cs:line 102 +--- End of stack trace from previous location where exception was thrown --- + at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) + at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult() + at JsonApiDotNetCore.Controllers.BaseJsonApiController`2.d__15.MoveNext() in /Users/jarednance/dev/json-api-dotnet-core/src/JsonApiDotNetCore/Controllers/BaseJsonApiController.cs:line 141 +--- End of stack trace from previous location where exception was thrown --- + at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) + at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult() + at JsonApiDotNetCore.Controllers.JsonApiController`2.d__6.MoveNext() in /Users/jarednance/dev/json-api-dotnet-core/src/JsonApiDotNetCore/Controllers/JsonApiController.cs:line 73 +--- End of stack trace from previous location where exception was thrown --- + at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) + at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.d__12.MoveNext() +--- End of stack trace from previous location where exception was thrown --- + at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) + at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.d__10.MoveNext() +--- End of stack trace from previous location where exception was thrown --- + at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Rethrow(ActionExecutedContext context) + at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) + at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.d__14.MoveNext() +--- End of stack trace from previous location where exception was thrown --- + at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) + at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.d__23.MoveNext() +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[4] + No information found on request to perform content negotiation. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[2] + Selected output formatter 'JsonApiDotNetCore.Formatters.JsonApiOutputFormatter' and content type '' to write the response. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: JsonApiDotNetCore.Formatters.JsonApiWriter[0] + Formatting response as JSONAPI +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetRelationshipAsync (JsonApiDotNetCoreExample) in 58.256ms +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetRelationshipAsync (JsonApiDotNetCoreExample) in 58.256ms +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 78.585ms 404 application/vnd.api+json +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 78.585ms 404 application/vnd.api+json +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20200] + Beginning transaction with isolation level 'ReadCommitted'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6, @p7) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (4ms) [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6, @p7) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (4ms) [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6, @p7) + RETURNING "Id"; +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +Failed JsonApiDotNetCoreExampleTests.Acceptance.Spec.CreatingDataTests.Can_Create_And_Set_HasMany_Relationships +Error Message: + JsonApiDotNetCore.Internal.JsonApiException : Failed to deserialize request body +---- System.NullReferenceException : Object reference not set to an instance of an object. +Stack Trace: + at JsonApiDotNetCore.Serialization.JsonApiDeSerializer.Deserialize(String requestBody) in /Users/jarednance/dev/json-api-dotnet-core/src/JsonApiDotNetCore/Serialization/JsonApiDeSerializer.cs:line 38 + at JsonApiDotNetCoreExampleTests.Acceptance.Spec.CreatingDataTests.d__8.MoveNext() in /Users/jarednance/dev/json-api-dotnet-core/test/JsonApiDotNetCoreExampleTests/Acceptance/Spec/CreatingDataTests.cs:line 273 +--- End of stack trace from previous location where exception was thrown --- + at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +--- End of stack trace from previous location where exception was thrown --- + at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +--- End of stack trace from previous location where exception was thrown --- + at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +----- Inner Stack Trace ----- + at JsonApiDotNetCore.Serialization.JsonApiDeSerializer.Deserialize(String requestBody) in /Users/jarednance/dev/json-api-dotnet-core/src/JsonApiDotNetCore/Serialization/JsonApiDeSerializer.cs:line 32 +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20202] + Committing transaction. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20204] + Disposing transaction. +dbug: Microsoft.EntityFrameworkCore.Infrastructure[10401] + An 'IServiceProvider' was created for internal use by Entity Framework. +warn: Microsoft.EntityFrameworkCore.Infrastructure[10402] + More than twenty 'IServiceProvider' instances have been created for internal use by Entity Framework. Consider reviewing calls on 'DbContextOptionsBuilder' that may require new service providers to be built. +info: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[0] + User profile is available. Using '/Users/jarednance/.aspnet/DataProtection-Keys' as key repository; keys will not be encrypted at rest. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-b040dd03-33c5-451e-8f42-3c9dd4e0dfec.xml'. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-c8147b66-2deb-407c-9421-1553f0e16d67.xml'. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-f7fa4a09-6d65-426e-a653-cbd2969e5073.xml'. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {b040dd03-33c5-451e-8f42-3c9dd4e0dfec}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {c8147b66-2deb-407c-9421-1553f0e16d67}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {f7fa4a09-6d65-426e-a653-cbd2969e5073}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.DefaultKeyResolver[13] + Considering key {c8147b66-2deb-407c-9421-1553f0e16d67} with expiration date 2018-03-03 16:22:35Z as default key. +dbug: Microsoft.AspNetCore.DataProtection.TypeForwardingActivator[0] + Forwarded activator type request from Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Version=1.1.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60 to Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Culture=neutral, PublicKeyToken=adb9793829ddae60 +dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptorFactory[11] + Using managed symmetric algorithm 'System.Security.Cryptography.Aes'. +dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptorFactory[10] + Using managed keyed hash algorithm 'System.Security.Cryptography.HMACSHA256'. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingProvider[2] + Using key {c8147b66-2deb-407c-9421-1553f0e16d67} as the default key. +dbug: Microsoft.AspNetCore.DataProtection.Internal.DataProtectionStartupFilter[0] + Key ring with default key {c8147b66-2deb-407c-9421-1553f0e16d67} was loaded during application startup. +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[], CommandType='Text', CommandTimeout='30'] + + SELECT CASE WHEN COUNT(*) = 0 THEN FALSE ELSE TRUE END + FROM information_schema.tables + WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema') +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (5ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + + SELECT CASE WHEN COUNT(*) = 0 THEN FALSE ELSE TRUE END + FROM information_schema.tables + WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema') +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[3] + Hosting starting +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[4] + Hosting started +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[0] + Loaded hosting startup assembly JsonApiDotNetCoreExample +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 GET http://localhost/api/v1/todo-items/2613/owner +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 GET http://localhost/api/v1/todo-items/2613/owner +dbug: Microsoft.AspNetCore.Routing.Tree.TreeRouter[1] + Request successfully matched the route with name '(null)' and template 'api/v1/todo-items/{id}/{relationshipName}'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetRelationshipAsync (JsonApiDotNetCoreExample) +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetRelationshipAsync (JsonApiDotNetCoreExample) with arguments (2613, owner) - ModelState is Valid +trce: JsonApiDotNetCore.Services.EntityResourceService[0] + Looking up 'Owner'... +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetRelationshipAsync (JsonApiDotNetCoreExample) with arguments (2613, owner) - ModelState is Valid +dbug: JsonApiDotNetCore.Data.DefaultEntityRepository[0] + [JADN] GetAndIncludeAsync(2613, Owner) +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Query[10101] + Compiling query model: + '(from TodoItem e in + (from TodoItem _1 in DbSet + select [_1]).Include("Owner") + where bool [e].Id.Equals((object)__id_0) + select [e]).SingleOrDefault()' +dbug: Microsoft.EntityFrameworkCore.Query[10105] + Including navigation: '[_1].Owner' +dbug: Microsoft.EntityFrameworkCore.Query[10104] + Optimized query model: + '(from TodoItem e in DbSet + join Person e.Owner in DbSet + on Property([e], "OwnerId") equals (Nullable)Property([e.Owner], "Id") into e.Owner_group + from Person e.Owner in + (from Person e.Owner_groupItem in [e.Owner_group] + select [e.Owner_groupItem]).DefaultIfEmpty() + where bool [e].Id.Equals((object)__id_0) + select TodoItem _Include( + queryContext: queryContext, + entity: [e], + included: new object[]{ [e.Owner] }, + fixup: (QueryContext queryContext | TodoItem entity | Object[] included) => + { + Void queryContext.QueryBuffer.StartTracking( + entity: entity, + entityType: EntityType: TodoItem) + return !(bool ReferenceEquals(included[0], null)) ? + { + Void queryContext.QueryBuffer.StartTracking( + entity: included[0], + entityType: EntityType: Person) + Void SetRelationshipSnapshotValue( + stateManager: queryContext.StateManager, + navigation: TodoItem.Owner, + entity: entity, + value: included[0]) + return Void AddToCollectionSnapshot( + stateManager: queryContext.StateManager, + navigation: Person.TodoItems, + entity: included[0], + value: entity) + } + : default(Void) + } + )).SingleOrDefault()' +dbug: Microsoft.EntityFrameworkCore.Query[10107] + (QueryContext queryContext) => IAsyncEnumerable _InterceptExceptions( + source: IAsyncEnumerable _TrackEntities( + results: IAsyncEnumerable _ToSequence(Task SingleOrDefault( + source: IAsyncEnumerable _Select( + source: IAsyncEnumerable> _ShapedQuery( + queryContext: queryContext, + shaperCommandContext: SelectExpression: + SELECT "e"."Id", "e"."AchievedDate", "e"."AssigneeId", "e"."CollectionId", "e"."CreatedDate", "e"."Description", "e"."GuidProperty", "e"."Ordinal", "e"."OwnerId", "e.Owner"."Id", "e.Owner"."FirstName", "e.Owner"."LastName" + FROM "TodoItems" AS "e" + LEFT JOIN "People" AS "e.Owner" ON "e"."OwnerId" = "e.Owner"."Id" + WHERE "e"."Id" = @__id_0 + LIMIT 2, + shaper: TypedCompositeShaper, TodoItem, BufferedOffsetEntityShaper, Person, TransparentIdentifier>), + selector: (TransparentIdentifier t1) => TodoItem _Include( + queryContext: queryContext, + entity: t1.Outer, + included: new object[]{ t1.Inner }, + fixup: (QueryContext queryContext | TodoItem entity | Object[] included) => + { + Void queryContext.QueryBuffer.StartTracking( + entity: entity, + entityType: EntityType: TodoItem) + return !(bool ReferenceEquals(included[0], null)) ? + { + Void queryContext.QueryBuffer.StartTracking( + entity: included[0], + entityType: EntityType: Person) + Void SetRelationshipSnapshotValue( + stateManager: queryContext.StateManager, + navigation: TodoItem.Owner, + entity: entity, + value: included[0]) + return Void AddToCollectionSnapshot( + stateManager: queryContext.StateManager, + navigation: Person.TodoItems, + entity: included[0], + value: entity) + } + : default(Void) + } + )), + cancellationToken: Unhandled parameter: queryContext.CancellationToken)), + queryContext: Unhandled parameter: queryContext, + entityTrackingInfos: { itemType: TodoItem }, + entityAccessors: List> + { + Func, + } + ), + contextType: JsonApiDotNetCoreExample.Data.AppDbContext, + logger: DiagnosticsLogger, + queryContext: Unhandled parameter: queryContext) +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "e"."Id", "e"."AchievedDate", "e"."AssigneeId", "e"."CollectionId", "e"."CreatedDate", "e"."Description", "e"."GuidProperty", "e"."Ordinal", "e"."OwnerId", "e.Owner"."Id", "e.Owner"."FirstName", "e.Owner"."LastName" + FROM "TodoItems" AS "e" + LEFT JOIN "People" AS "e.Owner" ON "e"."OwnerId" = "e.Owner"."Id" + WHERE "e"."Id" = @__id_0 + LIMIT 2 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (11ms) [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "e"."Id", "e"."AchievedDate", "e"."AssigneeId", "e"."CollectionId", "e"."CreatedDate", "e"."Description", "e"."GuidProperty", "e"."Ordinal", "e"."OwnerId", "e.Owner"."Id", "e.Owner"."FirstName", "e.Owner"."LastName" + FROM "TodoItems" AS "e" + LEFT JOIN "People" AS "e.Owner" ON "e"."OwnerId" = "e.Owner"."Id" + WHERE "e"."Id" = @__id_0 + LIMIT 2 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (11ms) [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "e"."Id", "e"."AchievedDate", "e"."AssigneeId", "e"."CollectionId", "e"."CreatedDate", "e"."Description", "e"."GuidProperty", "e"."Ordinal", "e"."OwnerId", "e.Owner"."Id", "e.Owner"."FirstName", "e.Owner"."LastName" + FROM "TodoItems" AS "e" + LEFT JOIN "People" AS "e.Owner" ON "e"."OwnerId" = "e.Owner"."Id" + WHERE "e"."Id" = @__id_0 + LIMIT 2 +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetRelationshipAsync (JsonApiDotNetCoreExample), returned result Microsoft.AspNetCore.Mvc.OkObjectResult. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[4] + No information found on request to perform content negotiation. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[2] + Selected output formatter 'JsonApiDotNetCore.Formatters.JsonApiOutputFormatter' and content type '' to write the response. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: JsonApiDotNetCore.Formatters.JsonApiWriter[0] + Formatting response as JSONAPI +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetRelationshipAsync (JsonApiDotNetCoreExample) in 56.604ms +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetRelationshipAsync (JsonApiDotNetCoreExample) in 56.604ms +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 74.256ms 200 application/vnd.api+json +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 74.256ms 200 application/vnd.api+json +dbug: Microsoft.EntityFrameworkCore.Infrastructure[10401] + An 'IServiceProvider' was created for internal use by Entity Framework. +warn: Microsoft.EntityFrameworkCore.Infrastructure[10402] + More than twenty 'IServiceProvider' instances have been created for internal use by Entity Framework. Consider reviewing calls on 'DbContextOptionsBuilder' that may require new service providers to be built. +info: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[0] + User profile is available. Using '/Users/jarednance/.aspnet/DataProtection-Keys' as key repository; keys will not be encrypted at rest. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-b040dd03-33c5-451e-8f42-3c9dd4e0dfec.xml'. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-c8147b66-2deb-407c-9421-1553f0e16d67.xml'. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-f7fa4a09-6d65-426e-a653-cbd2969e5073.xml'. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {b040dd03-33c5-451e-8f42-3c9dd4e0dfec}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {c8147b66-2deb-407c-9421-1553f0e16d67}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {f7fa4a09-6d65-426e-a653-cbd2969e5073}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.DefaultKeyResolver[13] + Considering key {c8147b66-2deb-407c-9421-1553f0e16d67} with expiration date 2018-03-03 16:22:35Z as default key. +dbug: Microsoft.AspNetCore.DataProtection.TypeForwardingActivator[0] + Forwarded activator type request from Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Version=1.1.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60 to Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Culture=neutral, PublicKeyToken=adb9793829ddae60 +dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptorFactory[11] + Using managed symmetric algorithm 'System.Security.Cryptography.Aes'. +dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptorFactory[10] + Using managed keyed hash algorithm 'System.Security.Cryptography.HMACSHA256'. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingProvider[2] + Using key {c8147b66-2deb-407c-9421-1553f0e16d67} as the default key. +dbug: Microsoft.AspNetCore.DataProtection.Internal.DataProtectionStartupFilter[0] + Key ring with default key {c8147b66-2deb-407c-9421-1553f0e16d67} was loaded during application startup. +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[], CommandType='Text', CommandTimeout='30'] + + SELECT CASE WHEN COUNT(*) = 0 THEN FALSE ELSE TRUE END + FROM information_schema.tables + WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema') +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (3ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + + SELECT CASE WHEN COUNT(*) = 0 THEN FALSE ELSE TRUE END + FROM information_schema.tables + WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema') +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[3] + Hosting starting +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[4] + Hosting started +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[0] + Loaded hosting startup assembly JsonApiDotNetCoreExample +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 GET http://localhost/api/v1/todo-items?unknownKey=value +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 GET http://localhost/api/v1/todo-items?unknownKey=value +dbug: Microsoft.AspNetCore.Routing.Tree.TreeRouter[1] + Request successfully matched the route with name '(null)' and template 'api/v1/todo-items'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.TodoItemsController.PostAsync (JsonApiDotNetCoreExample)' with id '154c85f6-801d-4115-8e42-da8fe75f1bea' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) +fail: JsonApiDotNetCore.Middleware.JsonApiExceptionFilter[0] + An unhandled exception occurred during the request +JsonApiDotNetCore.Internal.JsonApiException: [unknownKey, value] is not a valid query. + at JsonApiDotNetCore.Services.QueryParser.Parse(IQueryCollection query) in /Users/jarednance/dev/json-api-dotnet-core/src/JsonApiDotNetCore/Services/QueryParser.cs:line 75 + at JsonApiDotNetCore.Services.JsonApiContext.ApplyContext[T](Object controller) in /Users/jarednance/dev/json-api-dotnet-core/src/JsonApiDotNetCore/Services/JsonApiContext.cs:line 70 + at JsonApiDotNetCore.Controllers.BaseJsonApiController`2..ctor(IJsonApiContext jsonApiContext, IResourceService`2 resourceService) in /Users/jarednance/dev/json-api-dotnet-core/src/JsonApiDotNetCore/Controllers/BaseJsonApiController.cs:line 56 + at JsonApiDotNetCore.Controllers.JsonApiController`2..ctor(IJsonApiContext jsonApiContext, IResourceService`2 resourceService, ILoggerFactory loggerFactory) in /Users/jarednance/dev/json-api-dotnet-core/src/JsonApiDotNetCore/Controllers/JsonApiController.cs:line 40 + at JsonApiDotNetCore.Controllers.JsonApiController`1..ctor(IJsonApiContext jsonApiContext, IResourceService`2 resourceService, ILoggerFactory loggerFactory) in /Users/jarednance/dev/json-api-dotnet-core/src/JsonApiDotNetCore/Controllers/JsonApiController.cs:line 17 + at JsonApiDotNetCoreExample.Controllers.TodoItemsController..ctor(IJsonApiContext jsonApiContext, IResourceService`1 resourceService, ILoggerFactory loggerFactory) in /Users/jarednance/dev/json-api-dotnet-core/src/Examples/JsonApiDotNetCoreExample/Controllers/TodoItemsController.cs:line 14 + at lambda_method(Closure , IServiceProvider , Object[] ) + at Microsoft.AspNetCore.Mvc.Controllers.ControllerFactoryProvider.<>c__DisplayClass5_0.g__CreateController|0(ControllerContext controllerContext) + at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) + at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.d__14.MoveNext() +--- End of stack trace from previous location where exception was thrown --- + at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) + at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.d__23.MoveNext() +fail: JsonApiDotNetCore.Middleware.JsonApiExceptionFilter[0] + An unhandled exception occurred during the request +JsonApiDotNetCore.Internal.JsonApiException: [unknownKey, value] is not a valid query. + at JsonApiDotNetCore.Services.QueryParser.Parse(IQueryCollection query) in /Users/jarednance/dev/json-api-dotnet-core/src/JsonApiDotNetCore/Services/QueryParser.cs:line 75 + at JsonApiDotNetCore.Services.JsonApiContext.ApplyContext[T](Object controller) in /Users/jarednance/dev/json-api-dotnet-core/src/JsonApiDotNetCore/Services/JsonApiContext.cs:line 70 + at JsonApiDotNetCore.Controllers.BaseJsonApiController`2..ctor(IJsonApiContext jsonApiContext, IResourceService`2 resourceService) in /Users/jarednance/dev/json-api-dotnet-core/src/JsonApiDotNetCore/Controllers/BaseJsonApiController.cs:line 56 + at JsonApiDotNetCore.Controllers.JsonApiController`2..ctor(IJsonApiContext jsonApiContext, IResourceService`2 resourceService, ILoggerFactory loggerFactory) in /Users/jarednance/dev/json-api-dotnet-core/src/JsonApiDotNetCore/Controllers/JsonApiController.cs:line 40 + at JsonApiDotNetCore.Controllers.JsonApiController`1..ctor(IJsonApiContext jsonApiContext, IResourceService`2 resourceService, ILoggerFactory loggerFactory) in /Users/jarednance/dev/json-api-dotnet-core/src/JsonApiDotNetCore/Controllers/JsonApiController.cs:line 17 + at JsonApiDotNetCoreExample.Controllers.TodoItemsController..ctor(IJsonApiContext jsonApiContext, IResourceService`1 resourceService, ILoggerFactory loggerFactory) in /Users/jarednance/dev/json-api-dotnet-core/src/Examples/JsonApiDotNetCoreExample/Controllers/TodoItemsController.cs:line 14 + at lambda_method(Closure , IServiceProvider , Object[] ) + at Microsoft.AspNetCore.Mvc.Controllers.ControllerFactoryProvider.<>c__DisplayClass5_0.g__CreateController|0(ControllerContext controllerContext) + at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) + at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.d__14.MoveNext() +--- End of stack trace from previous location where exception was thrown --- + at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) + at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.d__23.MoveNext() +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[4] + No information found on request to perform content negotiation. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[2] + Selected output formatter 'JsonApiDotNetCore.Formatters.JsonApiOutputFormatter' and content type '' to write the response. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: JsonApiDotNetCore.Formatters.JsonApiWriter[0] + Formatting response as JSONAPI +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) in 4.858ms +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) in 4.858ms +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 24.057ms 400 application/vnd.api+json +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 24.057ms 400 application/vnd.api+json +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20200] + Beginning transaction with isolation level 'ReadCommitted'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6, @p7) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6, @p7) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6, @p7) + RETURNING "Id"; +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20202] + Committing transaction. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20204] + Disposing transaction. +dbug: Microsoft.EntityFrameworkCore.Infrastructure[10401] + An 'IServiceProvider' was created for internal use by Entity Framework. +warn: Microsoft.EntityFrameworkCore.Infrastructure[10402] + More than twenty 'IServiceProvider' instances have been created for internal use by Entity Framework. Consider reviewing calls on 'DbContextOptionsBuilder' that may require new service providers to be built. +info: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[0] + User profile is available. Using '/Users/jarednance/.aspnet/DataProtection-Keys' as key repository; keys will not be encrypted at rest. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-b040dd03-33c5-451e-8f42-3c9dd4e0dfec.xml'. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-c8147b66-2deb-407c-9421-1553f0e16d67.xml'. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-f7fa4a09-6d65-426e-a653-cbd2969e5073.xml'. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {b040dd03-33c5-451e-8f42-3c9dd4e0dfec}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {c8147b66-2deb-407c-9421-1553f0e16d67}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {f7fa4a09-6d65-426e-a653-cbd2969e5073}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.DefaultKeyResolver[13] + Considering key {c8147b66-2deb-407c-9421-1553f0e16d67} with expiration date 2018-03-03 16:22:35Z as default key. +dbug: Microsoft.AspNetCore.DataProtection.TypeForwardingActivator[0] + Forwarded activator type request from Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Version=1.1.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60 to Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Culture=neutral, PublicKeyToken=adb9793829ddae60 +dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptorFactory[11] + Using managed symmetric algorithm 'System.Security.Cryptography.Aes'. +dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptorFactory[10] + Using managed keyed hash algorithm 'System.Security.Cryptography.HMACSHA256'. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingProvider[2] + Using key {c8147b66-2deb-407c-9421-1553f0e16d67} as the default key. +dbug: Microsoft.AspNetCore.DataProtection.Internal.DataProtectionStartupFilter[0] + Key ring with default key {c8147b66-2deb-407c-9421-1553f0e16d67} was loaded during application startup. +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[], CommandType='Text', CommandTimeout='30'] + + SELECT CASE WHEN COUNT(*) = 0 THEN FALSE ELSE TRUE END + FROM information_schema.tables + WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema') +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + + SELECT CASE WHEN COUNT(*) = 0 THEN FALSE ELSE TRUE END + FROM information_schema.tables + WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema') +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[3] + Hosting starting +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[4] + Hosting started +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[0] + Loaded hosting startup assembly JsonApiDotNetCoreExample +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 GET http://localhost/api/v1/todo-items/2614?fields[todo-items]=description,created-date +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 GET http://localhost/api/v1/todo-items/2614?fields[todo-items]=description,created-date +dbug: Microsoft.AspNetCore.Routing.Tree.TreeRouter[1] + Request successfully matched the route with name '(null)' and template 'api/v1/todo-items/{id}'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.TodoItemsController.PatchAsync (JsonApiDotNetCoreExample)' with id 'ce1f18f1-2c9d-469e-8706-cdda1d627b0c' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.TodoItemsController.DeleteAsync (JsonApiDotNetCoreExample)' with id '736779bb-b124-40ac-a9e5-58f8ea4bdcc3' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) with arguments (2614) - ModelState is Valid +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) with arguments (2614) - ModelState is Valid +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Query[10101] + Compiling query model: + '(from TodoItem model in DbSet + where bool new TodoItem{ + Id = [model].Id, + Description = [model].Description, + CreatedDate = [model].CreatedDate + } + .Id.Equals((object)__id_0) + select new TodoItem{ + Id = [model].Id, + Description = [model].Description, + CreatedDate = [model].CreatedDate + } + ).SingleOrDefault()' +dbug: Microsoft.EntityFrameworkCore.Query[10104] + Optimized query model: + '(from TodoItem model in DbSet + where bool new TodoItem{ + Id = [model].Id, + Description = [model].Description, + CreatedDate = [model].CreatedDate + } + .Id.Equals((object)__id_0) + select new TodoItem{ + Id = [model].Id, + Description = [model].Description, + CreatedDate = [model].CreatedDate + } + ).SingleOrDefault()' +warn: Microsoft.EntityFrameworkCore.Query[20500] + The LINQ expression 'where new TodoItem() {Id = [model].Id, Description = [model].Description, CreatedDate = [model].CreatedDate}.Id.Equals(Convert(__id_0, Object))' could not be translated and will be evaluated locally. +warn: Microsoft.EntityFrameworkCore.Query[20500] + The LINQ expression 'where new TodoItem() {Id = [model].Id, Description = [model].Description, CreatedDate = [model].CreatedDate}.Id.Equals(Convert(__id_0, Object))' could not be translated and will be evaluated locally. +warn: Microsoft.EntityFrameworkCore.Query[20500] + The LINQ expression 'SingleOrDefault()' could not be translated and will be evaluated locally. +warn: Microsoft.EntityFrameworkCore.Query[20500] + The LINQ expression 'SingleOrDefault()' could not be translated and will be evaluated locally. +dbug: Microsoft.EntityFrameworkCore.Query[10107] + (QueryContext queryContext) => IAsyncEnumerable _InterceptExceptions( + source: IAsyncEnumerable _ToSequence(Task SingleOrDefault( + source: IAsyncEnumerable _Select( + source: IAsyncEnumerable _Where( + source: IAsyncEnumerable _ShapedQuery( + queryContext: queryContext, + shaperCommandContext: SelectExpression: + SELECT "model"."Id", "model"."Description", "model"."CreatedDate" + FROM "TodoItems" AS "model", + shaper: ValueBufferShaper), + predicate: (ValueBuffer model) => bool new TodoItem{ + Id = int TryReadValue(model, 0, TodoItem.Id), + Description = string TryReadValue(model, 1, TodoItem.Description), + CreatedDate = DateTime TryReadValue(model, 2, TodoItem.CreatedDate) + } + .Id.Equals((object)int GetParameterValue( + queryContext: queryContext, + parameterName: "__id_0"))), + selector: (ValueBuffer model) => new TodoItem{ + Id = int TryReadValue(model, 0, TodoItem.Id), + Description = string TryReadValue(model, 1, TodoItem.Description), + CreatedDate = DateTime TryReadValue(model, 2, TodoItem.CreatedDate) + } + ), + cancellationToken: queryContext.CancellationToken)), + contextType: JsonApiDotNetCoreExample.Data.AppDbContext, + logger: DiagnosticsLogger, + queryContext: queryContext) +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[], CommandType='Text', CommandTimeout='30'] + SELECT "model"."Id", "model"."Description", "model"."CreatedDate" + FROM "TodoItems" AS "model" +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (10ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + SELECT "model"."Id", "model"."Description", "model"."CreatedDate" + FROM "TodoItems" AS "model" +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (10ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + SELECT "model"."Id", "model"."Description", "model"."CreatedDate" + FROM "TodoItems" AS "model" +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample), returned result Microsoft.AspNetCore.Mvc.OkObjectResult. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[4] + No information found on request to perform content negotiation. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[2] + Selected output formatter 'JsonApiDotNetCore.Formatters.JsonApiOutputFormatter' and content type '' to write the response. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: JsonApiDotNetCore.Formatters.JsonApiWriter[0] + Formatting response as JSONAPI +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) in 105.374ms +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) in 105.374ms +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 125.325ms 200 application/vnd.api+json +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 125.325ms 200 application/vnd.api+json +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20200] + Beginning transaction with isolation level 'ReadCommitted'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6, @p7) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6, @p7) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6, @p7) + RETURNING "Id"; +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20202] + Committing transaction. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20204] + Disposing transaction. +dbug: Microsoft.EntityFrameworkCore.Query[10101] + Compiling query model: + 'from TodoItem t in DbSet + where [t].Id == 2615 + select new TodoItem{ + Id = [t].Id, + Description = [t].Description, + CreatedDate = [t].CreatedDate, + AchievedDate = [t].AchievedDate + } + ' +dbug: Microsoft.EntityFrameworkCore.Query[10104] + Optimized query model: + 'from TodoItem t in DbSet + where [t].Id == 2615 + select new TodoItem{ + Id = [t].Id, + Description = [t].Description, + CreatedDate = [t].CreatedDate, + AchievedDate = [t].AchievedDate + } + ' +dbug: Microsoft.EntityFrameworkCore.Query[10107] + (QueryContext queryContext) => IEnumerable _InterceptExceptions( + source: IEnumerable _ShapedQuery( + queryContext: queryContext, + shaperCommandContext: SelectExpression: + SELECT "t"."Id", "t"."Description", "t"."CreatedDate", "t"."AchievedDate" + FROM "TodoItems" AS "t" + WHERE "t"."Id" = 2615, + shaper: TypedProjectionShaper), + contextType: JsonApiDotNetCoreExample.Data.AppDbContext, + logger: DiagnosticsLogger, + queryContext: queryContext) +dbug: Microsoft.EntityFrameworkCore.Query[10101] + Compiling query model: + '(from TodoItem t in DbSet + where [t].Id == __todoItem_Id_0 + select new TodoItem{ + Id = [t].Id, + Description = [t].Description, + CreatedDate = [t].CreatedDate, + AchievedDate = [t].AchievedDate + } + ).First()' +dbug: Microsoft.EntityFrameworkCore.Query[10104] + Optimized query model: + '(from TodoItem t in DbSet + where [t].Id == __todoItem_Id_0 + select new TodoItem{ + Id = [t].Id, + Description = [t].Description, + CreatedDate = [t].CreatedDate, + AchievedDate = [t].AchievedDate + } + ).First()' +dbug: Microsoft.EntityFrameworkCore.Query[10107] + (QueryContext queryContext) => IAsyncEnumerable _InterceptExceptions( + source: IAsyncEnumerable _ToSequence(Task First( + source: IAsyncEnumerable _ShapedQuery( + queryContext: queryContext, + shaperCommandContext: SelectExpression: + SELECT "t"."Id", "t"."Description", "t"."CreatedDate", "t"."AchievedDate" + FROM "TodoItems" AS "t" + WHERE "t"."Id" = @__todoItem_Id_0 + LIMIT 1, + shaper: TypedProjectionShaper), + cancellationToken: queryContext.CancellationToken)), + contextType: JsonApiDotNetCoreExample.Data.AppDbContext, + logger: DiagnosticsLogger, + queryContext: queryContext) +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@__todoItem_Id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "t"."Id", "t"."Description", "t"."CreatedDate", "t"."AchievedDate" + FROM "TodoItems" AS "t" + WHERE "t"."Id" = @__todoItem_Id_0 + LIMIT 1 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@__todoItem_Id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "t"."Id", "t"."Description", "t"."CreatedDate", "t"."AchievedDate" + FROM "TodoItems" AS "t" + WHERE "t"."Id" = @__todoItem_Id_0 + LIMIT 1 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@__todoItem_Id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "t"."Id", "t"."Description", "t"."CreatedDate", "t"."AchievedDate" + FROM "TodoItems" AS "t" + WHERE "t"."Id" = @__todoItem_Id_0 + LIMIT 1 +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20200] + Beginning transaction with isolation level 'ReadCommitted'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?', @p8='?', @p9='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "People" ("FirstName", "LastName") + VALUES (@p0, @p1) + RETURNING "Id"; + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p2, @p3, @p4, @p5, @p6, @p7, @p8, @p9) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?', @p8='?', @p9='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "People" ("FirstName", "LastName") + VALUES (@p0, @p1) + RETURNING "Id"; + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p2, @p3, @p4, @p5, @p6, @p7, @p8, @p9) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?', @p8='?', @p9='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "People" ("FirstName", "LastName") + VALUES (@p0, @p1) + RETURNING "Id"; + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p2, @p3, @p4, @p5, @p6, @p7, @p8, @p9) + RETURNING "Id"; +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20202] + Committing transaction. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20204] + Disposing transaction. +dbug: Microsoft.EntityFrameworkCore.Infrastructure[10401] + An 'IServiceProvider' was created for internal use by Entity Framework. +warn: Microsoft.EntityFrameworkCore.Infrastructure[10402] + More than twenty 'IServiceProvider' instances have been created for internal use by Entity Framework. Consider reviewing calls on 'DbContextOptionsBuilder' that may require new service providers to be built. +info: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[0] + User profile is available. Using '/Users/jarednance/.aspnet/DataProtection-Keys' as key repository; keys will not be encrypted at rest. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-b040dd03-33c5-451e-8f42-3c9dd4e0dfec.xml'. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-c8147b66-2deb-407c-9421-1553f0e16d67.xml'. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-f7fa4a09-6d65-426e-a653-cbd2969e5073.xml'. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {b040dd03-33c5-451e-8f42-3c9dd4e0dfec}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {c8147b66-2deb-407c-9421-1553f0e16d67}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {f7fa4a09-6d65-426e-a653-cbd2969e5073}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.DefaultKeyResolver[13] + Considering key {c8147b66-2deb-407c-9421-1553f0e16d67} with expiration date 2018-03-03 16:22:35Z as default key. +dbug: Microsoft.AspNetCore.DataProtection.TypeForwardingActivator[0] + Forwarded activator type request from Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Version=1.1.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60 to Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Culture=neutral, PublicKeyToken=adb9793829ddae60 +dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptorFactory[11] + Using managed symmetric algorithm 'System.Security.Cryptography.Aes'. +dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptorFactory[10] + Using managed keyed hash algorithm 'System.Security.Cryptography.HMACSHA256'. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingProvider[2] + Using key {c8147b66-2deb-407c-9421-1553f0e16d67} as the default key. +dbug: Microsoft.AspNetCore.DataProtection.Internal.DataProtectionStartupFilter[0] + Key ring with default key {c8147b66-2deb-407c-9421-1553f0e16d67} was loaded during application startup. +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[], CommandType='Text', CommandTimeout='30'] + + SELECT CASE WHEN COUNT(*) = 0 THEN FALSE ELSE TRUE END + FROM information_schema.tables + WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema') +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (2ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + + SELECT CASE WHEN COUNT(*) = 0 THEN FALSE ELSE TRUE END + FROM information_schema.tables + WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema') +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[3] + Hosting starting +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[4] + Hosting started +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[0] + Loaded hosting startup assembly JsonApiDotNetCoreExample +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 PATCH http://localhost/api/v1/todo-items/2616 application/vnd.api+json +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 PATCH http://localhost/api/v1/todo-items/2616 application/vnd.api+json +dbug: Microsoft.AspNetCore.Routing.Tree.TreeRouter[1] + Request successfully matched the route with name '(null)' and template 'api/v1/todo-items/{id}'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample)' with id '99416189-fd56-43fd-accb-b675b7d46314' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.TodoItemsController.DeleteAsync (JsonApiDotNetCoreExample)' with id '7d80e15e-9750-4047-b86c-88bfc61fd12f' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action JsonApiDotNetCoreExample.Controllers.TodoItemsController.PatchAsync (JsonApiDotNetCoreExample) +dbug: Microsoft.AspNetCore.Mvc.ModelBinding.Binders.BodyModelBinder[1] + Selected input formatter 'JsonApiDotNetCore.Formatters.JsonApiInputFormatter' for content type 'application/vnd.api+json'. +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.PatchAsync (JsonApiDotNetCoreExample) with arguments (2616, JsonApiDotNetCoreExample.Models.TodoItem) - ModelState is Valid +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.PatchAsync (JsonApiDotNetCoreExample) with arguments (2616, JsonApiDotNetCoreExample.Models.TodoItem) - ModelState is Valid +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Query[10101] + Compiling query model: + '(from TodoItem e in DbSet + where bool [e].Id.Equals((object)__id_0) + select [e]).SingleOrDefault()' +dbug: Microsoft.EntityFrameworkCore.Query[10104] + Optimized query model: + '(from TodoItem e in DbSet + where bool [e].Id.Equals((object)__id_0) + select [e]).SingleOrDefault()' +dbug: Microsoft.EntityFrameworkCore.Query[10107] + (QueryContext queryContext) => IAsyncEnumerable _InterceptExceptions( + source: IAsyncEnumerable _TrackEntities( + results: IAsyncEnumerable _ToSequence(Task SingleOrDefault( + source: IAsyncEnumerable _ShapedQuery( + queryContext: queryContext, + shaperCommandContext: SelectExpression: + SELECT "e"."Id", "e"."AchievedDate", "e"."AssigneeId", "e"."CollectionId", "e"."CreatedDate", "e"."Description", "e"."GuidProperty", "e"."Ordinal", "e"."OwnerId" + FROM "TodoItems" AS "e" + WHERE "e"."Id" = @__id_0 + LIMIT 2, + shaper: UnbufferedEntityShaper), + cancellationToken: queryContext.CancellationToken)), + queryContext: queryContext, + entityTrackingInfos: { itemType: TodoItem }, + entityAccessors: List> + { + Func, + } + ), + contextType: JsonApiDotNetCoreExample.Data.AppDbContext, + logger: DiagnosticsLogger, + queryContext: queryContext) +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "e"."Id", "e"."AchievedDate", "e"."AssigneeId", "e"."CollectionId", "e"."CreatedDate", "e"."Description", "e"."GuidProperty", "e"."Ordinal", "e"."OwnerId" + FROM "TodoItems" AS "e" + WHERE "e"."Id" = @__id_0 + LIMIT 2 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (11ms) [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "e"."Id", "e"."AchievedDate", "e"."AssigneeId", "e"."CollectionId", "e"."CreatedDate", "e"."Description", "e"."GuidProperty", "e"."Ordinal", "e"."OwnerId" + FROM "TodoItems" AS "e" + WHERE "e"."Id" = @__id_0 + LIMIT 2 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (11ms) [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "e"."Id", "e"."AchievedDate", "e"."AssigneeId", "e"."CollectionId", "e"."CreatedDate", "e"."Description", "e"."GuidProperty", "e"."Ordinal", "e"."OwnerId" + FROM "TodoItems" AS "e" + WHERE "e"."Id" = @__id_0 + LIMIT 2 +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20200] + Beginning transaction with isolation level 'ReadCommitted'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@p1='?', @p0='?'], CommandType='Text', CommandTimeout='30'] + UPDATE "TodoItems" SET "OwnerId" = @p0 + WHERE "Id" = @p1; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p1='?', @p0='?'], CommandType='Text', CommandTimeout='30'] + UPDATE "TodoItems" SET "OwnerId" = @p0 + WHERE "Id" = @p1; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p1='?', @p0='?'], CommandType='Text', CommandTimeout='30'] + UPDATE "TodoItems" SET "OwnerId" = @p0 + WHERE "Id" = @p1; +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20202] + Committing transaction. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20204] + Disposing transaction. +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.PatchAsync (JsonApiDotNetCoreExample), returned result Microsoft.AspNetCore.Mvc.OkObjectResult. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[4] + No information found on request to perform content negotiation. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[2] + Selected output formatter 'JsonApiDotNetCore.Formatters.JsonApiOutputFormatter' and content type '' to write the response. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: JsonApiDotNetCore.Formatters.JsonApiWriter[0] + Formatting response as JSONAPI +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.TodoItemsController.PatchAsync (JsonApiDotNetCoreExample) in 95.019ms +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.TodoItemsController.PatchAsync (JsonApiDotNetCoreExample) in 95.019ms +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 116.16ms 200 application/vnd.api+json +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 116.16ms 200 application/vnd.api+json +dbug: Microsoft.EntityFrameworkCore.Query[10101] + Compiling query model: + '(from TodoItem t in + (from TodoItem _1 in DbSet + select [_1]) + .AsNoTracking() + .Include("Owner") + where [t].Id == __todoItem_Id_0 + select [t]).SingleOrDefault()' +dbug: Microsoft.EntityFrameworkCore.Query[10105] + Including navigation: '[_1].Owner' +dbug: Microsoft.EntityFrameworkCore.Query[10104] + Optimized query model: + '(from TodoItem t in DbSet + join Person t.Owner in DbSet + on Property([t], "OwnerId") equals (Nullable)Property([t.Owner], "Id") into t.Owner_group + from Person t.Owner in + (from Person t.Owner_groupItem in [t.Owner_group] + select [t.Owner_groupItem]).DefaultIfEmpty() + where [t].Id == __todoItem_Id_0 + select TodoItem _Include( + queryContext: queryContext, + entity: [t], + included: new object[]{ [t.Owner] }, + fixup: (QueryContext queryContext | TodoItem entity | Object[] included) => + { + return !(bool ReferenceEquals(included[0], null)) ? + { + entity.Owner = (Person)included[0] + return bool ClrICollectionAccessor, TodoItem>.Add( + instance: included[0], + value: entity) + } + : default(bool) + } + )).SingleOrDefault()' +dbug: Microsoft.EntityFrameworkCore.Query[10107] + (QueryContext queryContext) => IEnumerable _InterceptExceptions( + source: IEnumerable _ToSequence(TodoItem SingleOrDefault(IEnumerable _Select( + source: IEnumerable> _ShapedQuery( + queryContext: queryContext, + shaperCommandContext: SelectExpression: + SELECT "t"."Id", "t"."AchievedDate", "t"."AssigneeId", "t"."CollectionId", "t"."CreatedDate", "t"."Description", "t"."GuidProperty", "t"."Ordinal", "t"."OwnerId", "t.Owner"."Id", "t.Owner"."FirstName", "t.Owner"."LastName" + FROM "TodoItems" AS "t" + LEFT JOIN "People" AS "t.Owner" ON "t"."OwnerId" = "t.Owner"."Id" + WHERE "t"."Id" = @__todoItem_Id_0 + LIMIT 2, + shaper: TypedCompositeShaper, TodoItem, BufferedOffsetEntityShaper, Person, TransparentIdentifier>), + selector: (TransparentIdentifier t1) => TodoItem _Include( + queryContext: queryContext, + entity: t1.Outer, + included: new object[]{ t1.Inner }, + fixup: (QueryContext queryContext | TodoItem entity | Object[] included) => + { + return !(bool ReferenceEquals(included[0], null)) ? + { + entity.Owner = (Person)included[0] + return bool ClrICollectionAccessor, TodoItem>.Add( + instance: included[0], + value: entity) + } + : default(bool) + } + )))), + contextType: JsonApiDotNetCoreExample.Data.AppDbContext, + logger: DiagnosticsLogger, + queryContext: Unhandled parameter: queryContext) +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@__todoItem_Id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "t"."Id", "t"."AchievedDate", "t"."AssigneeId", "t"."CollectionId", "t"."CreatedDate", "t"."Description", "t"."GuidProperty", "t"."Ordinal", "t"."OwnerId", "t.Owner"."Id", "t.Owner"."FirstName", "t.Owner"."LastName" + FROM "TodoItems" AS "t" + LEFT JOIN "People" AS "t.Owner" ON "t"."OwnerId" = "t.Owner"."Id" + WHERE "t"."Id" = @__todoItem_Id_0 + LIMIT 2 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@__todoItem_Id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "t"."Id", "t"."AchievedDate", "t"."AssigneeId", "t"."CollectionId", "t"."CreatedDate", "t"."Description", "t"."GuidProperty", "t"."Ordinal", "t"."OwnerId", "t.Owner"."Id", "t.Owner"."FirstName", "t.Owner"."LastName" + FROM "TodoItems" AS "t" + LEFT JOIN "People" AS "t.Owner" ON "t"."OwnerId" = "t.Owner"."Id" + WHERE "t"."Id" = @__todoItem_Id_0 + LIMIT 2 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@__todoItem_Id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "t"."Id", "t"."AchievedDate", "t"."AssigneeId", "t"."CollectionId", "t"."CreatedDate", "t"."Description", "t"."GuidProperty", "t"."Ordinal", "t"."OwnerId", "t.Owner"."Id", "t.Owner"."FirstName", "t.Owner"."LastName" + FROM "TodoItems" AS "t" + LEFT JOIN "People" AS "t.Owner" ON "t"."OwnerId" = "t.Owner"."Id" + WHERE "t"."Id" = @__todoItem_Id_0 + LIMIT 2 +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[], CommandType='Text', CommandTimeout='30'] + SELECT "t"."Id", "t"."AchievedDate", "t"."AssigneeId", "t"."CollectionId", "t"."CreatedDate", "t"."Description", "t"."GuidProperty", "t"."Ordinal", "t"."OwnerId" + FROM "TodoItems" AS "t" +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + SELECT "t"."Id", "t"."AchievedDate", "t"."AssigneeId", "t"."CollectionId", "t"."CreatedDate", "t"."Description", "t"."GuidProperty", "t"."Ordinal", "t"."OwnerId" + FROM "TodoItems" AS "t" +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + SELECT "t"."Id", "t"."AchievedDate", "t"."AssigneeId", "t"."CollectionId", "t"."CreatedDate", "t"."Description", "t"."GuidProperty", "t"."Ordinal", "t"."OwnerId" + FROM "TodoItems" AS "t" +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Infrastructure[10401] + An 'IServiceProvider' was created for internal use by Entity Framework. +warn: Microsoft.EntityFrameworkCore.Infrastructure[10402] + More than twenty 'IServiceProvider' instances have been created for internal use by Entity Framework. Consider reviewing calls on 'DbContextOptionsBuilder' that may require new service providers to be built. +info: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[0] + User profile is available. Using '/Users/jarednance/.aspnet/DataProtection-Keys' as key repository; keys will not be encrypted at rest. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-b040dd03-33c5-451e-8f42-3c9dd4e0dfec.xml'. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-c8147b66-2deb-407c-9421-1553f0e16d67.xml'. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-f7fa4a09-6d65-426e-a653-cbd2969e5073.xml'. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {b040dd03-33c5-451e-8f42-3c9dd4e0dfec}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {c8147b66-2deb-407c-9421-1553f0e16d67}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {f7fa4a09-6d65-426e-a653-cbd2969e5073}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.DefaultKeyResolver[13] + Considering key {c8147b66-2deb-407c-9421-1553f0e16d67} with expiration date 2018-03-03 16:22:35Z as default key. +dbug: Microsoft.AspNetCore.DataProtection.TypeForwardingActivator[0] + Forwarded activator type request from Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Version=1.1.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60 to Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Culture=neutral, PublicKeyToken=adb9793829ddae60 +dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptorFactory[11] + Using managed symmetric algorithm 'System.Security.Cryptography.Aes'. +dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptorFactory[10] + Using managed keyed hash algorithm 'System.Security.Cryptography.HMACSHA256'. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingProvider[2] + Using key {c8147b66-2deb-407c-9421-1553f0e16d67} as the default key. +dbug: Microsoft.AspNetCore.DataProtection.Internal.DataProtectionStartupFilter[0] + Key ring with default key {c8147b66-2deb-407c-9421-1553f0e16d67} was loaded during application startup. +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[], CommandType='Text', CommandTimeout='30'] + + SELECT CASE WHEN COUNT(*) = 0 THEN FALSE ELSE TRUE END + FROM information_schema.tables + WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema') +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (2ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + + SELECT CASE WHEN COUNT(*) = 0 THEN FALSE ELSE TRUE END + FROM information_schema.tables + WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema') +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[3] + Hosting starting +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[4] + Hosting started +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[0] + Loaded hosting startup assembly JsonApiDotNetCoreExample +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 PATCH http://localhost/api/v1/todo-items/2716 application/vnd.api+json +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 PATCH http://localhost/api/v1/todo-items/2716 application/vnd.api+json +dbug: Microsoft.AspNetCore.Routing.Tree.TreeRouter[1] + Request successfully matched the route with name '(null)' and template 'api/v1/todo-items/{id}'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample)' with id '2a9a328a-ccd2-441f-86b9-778e783257c7' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.TodoItemsController.DeleteAsync (JsonApiDotNetCoreExample)' with id 'f400e30f-a558-41ca-9432-b889d803f5d2' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action JsonApiDotNetCoreExample.Controllers.TodoItemsController.PatchAsync (JsonApiDotNetCoreExample) +dbug: Microsoft.AspNetCore.Mvc.ModelBinding.Binders.BodyModelBinder[1] + Selected input formatter 'JsonApiDotNetCore.Formatters.JsonApiInputFormatter' for content type 'application/vnd.api+json'. +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.PatchAsync (JsonApiDotNetCoreExample) with arguments (2716, JsonApiDotNetCoreExample.Models.TodoItem) - ModelState is Valid +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.PatchAsync (JsonApiDotNetCoreExample) with arguments (2716, JsonApiDotNetCoreExample.Models.TodoItem) - ModelState is Valid +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Query[10101] + Compiling query model: + '(from TodoItem e in DbSet + where bool [e].Id.Equals((object)__id_0) + select [e]).SingleOrDefault()' +dbug: Microsoft.EntityFrameworkCore.Query[10104] + Optimized query model: + '(from TodoItem e in DbSet + where bool [e].Id.Equals((object)__id_0) + select [e]).SingleOrDefault()' +dbug: Microsoft.EntityFrameworkCore.Query[10107] + (QueryContext queryContext) => IAsyncEnumerable _InterceptExceptions( + source: IAsyncEnumerable _TrackEntities( + results: IAsyncEnumerable _ToSequence(Task SingleOrDefault( + source: IAsyncEnumerable _ShapedQuery( + queryContext: queryContext, + shaperCommandContext: SelectExpression: + SELECT "e"."Id", "e"."AchievedDate", "e"."AssigneeId", "e"."CollectionId", "e"."CreatedDate", "e"."Description", "e"."GuidProperty", "e"."Ordinal", "e"."OwnerId" + FROM "TodoItems" AS "e" + WHERE "e"."Id" = @__id_0 + LIMIT 2, + shaper: UnbufferedEntityShaper), + cancellationToken: queryContext.CancellationToken)), + queryContext: queryContext, + entityTrackingInfos: { itemType: TodoItem }, + entityAccessors: List> + { + Func, + } + ), + contextType: JsonApiDotNetCoreExample.Data.AppDbContext, + logger: DiagnosticsLogger, + queryContext: queryContext) +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "e"."Id", "e"."AchievedDate", "e"."AssigneeId", "e"."CollectionId", "e"."CreatedDate", "e"."Description", "e"."GuidProperty", "e"."Ordinal", "e"."OwnerId" + FROM "TodoItems" AS "e" + WHERE "e"."Id" = @__id_0 + LIMIT 2 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (9ms) [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "e"."Id", "e"."AchievedDate", "e"."AssigneeId", "e"."CollectionId", "e"."CreatedDate", "e"."Description", "e"."GuidProperty", "e"."Ordinal", "e"."OwnerId" + FROM "TodoItems" AS "e" + WHERE "e"."Id" = @__id_0 + LIMIT 2 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (9ms) [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "e"."Id", "e"."AchievedDate", "e"."AssigneeId", "e"."CollectionId", "e"."CreatedDate", "e"."Description", "e"."GuidProperty", "e"."Ordinal", "e"."OwnerId" + FROM "TodoItems" AS "e" + WHERE "e"."Id" = @__id_0 + LIMIT 2 +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.PatchAsync (JsonApiDotNetCoreExample), returned result Microsoft.AspNetCore.Mvc.NotFoundResult. +info: Microsoft.AspNetCore.Mvc.StatusCodeResult[1] + Executing HttpStatusCodeResult, setting HTTP status code 404 +info: Microsoft.AspNetCore.Mvc.StatusCodeResult[1] + Executing HttpStatusCodeResult, setting HTTP status code 404 +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.TodoItemsController.PatchAsync (JsonApiDotNetCoreExample) in 27.817ms +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.TodoItemsController.PatchAsync (JsonApiDotNetCoreExample) in 27.817ms +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 47.257ms 404 +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 47.257ms 404 +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20200] + Beginning transaction with isolation level 'ReadCommitted'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?', @p8='?', @p9='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "People" ("FirstName", "LastName") + VALUES (@p0, @p1) + RETURNING "Id"; + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p2, @p3, @p4, @p5, @p6, @p7, @p8, @p9) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?', @p8='?', @p9='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "People" ("FirstName", "LastName") + VALUES (@p0, @p1) + RETURNING "Id"; + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p2, @p3, @p4, @p5, @p6, @p7, @p8, @p9) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?', @p8='?', @p9='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "People" ("FirstName", "LastName") + VALUES (@p0, @p1) + RETURNING "Id"; + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p2, @p3, @p4, @p5, @p6, @p7, @p8, @p9) + RETURNING "Id"; +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20202] + Committing transaction. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20204] + Disposing transaction. +dbug: Microsoft.EntityFrameworkCore.Infrastructure[10401] + An 'IServiceProvider' was created for internal use by Entity Framework. +warn: Microsoft.EntityFrameworkCore.Infrastructure[10402] + More than twenty 'IServiceProvider' instances have been created for internal use by Entity Framework. Consider reviewing calls on 'DbContextOptionsBuilder' that may require new service providers to be built. +info: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[0] + User profile is available. Using '/Users/jarednance/.aspnet/DataProtection-Keys' as key repository; keys will not be encrypted at rest. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-b040dd03-33c5-451e-8f42-3c9dd4e0dfec.xml'. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-c8147b66-2deb-407c-9421-1553f0e16d67.xml'. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-f7fa4a09-6d65-426e-a653-cbd2969e5073.xml'. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {b040dd03-33c5-451e-8f42-3c9dd4e0dfec}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {c8147b66-2deb-407c-9421-1553f0e16d67}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {f7fa4a09-6d65-426e-a653-cbd2969e5073}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.DefaultKeyResolver[13] + Considering key {c8147b66-2deb-407c-9421-1553f0e16d67} with expiration date 2018-03-03 16:22:35Z as default key. +dbug: Microsoft.AspNetCore.DataProtection.TypeForwardingActivator[0] + Forwarded activator type request from Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Version=1.1.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60 to Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Culture=neutral, PublicKeyToken=adb9793829ddae60 +dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptorFactory[11] + Using managed symmetric algorithm 'System.Security.Cryptography.Aes'. +dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptorFactory[10] + Using managed keyed hash algorithm 'System.Security.Cryptography.HMACSHA256'. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingProvider[2] + Using key {c8147b66-2deb-407c-9421-1553f0e16d67} as the default key. +dbug: Microsoft.AspNetCore.DataProtection.Internal.DataProtectionStartupFilter[0] + Key ring with default key {c8147b66-2deb-407c-9421-1553f0e16d67} was loaded during application startup. +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[], CommandType='Text', CommandTimeout='30'] + + SELECT CASE WHEN COUNT(*) = 0 THEN FALSE ELSE TRUE END + FROM information_schema.tables + WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema') +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (3ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + + SELECT CASE WHEN COUNT(*) = 0 THEN FALSE ELSE TRUE END + FROM information_schema.tables + WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema') +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[3] + Hosting starting +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[4] + Hosting started +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[0] + Loaded hosting startup assembly JsonApiDotNetCoreExample +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 PATCH http://localhost/api/v1/todo-items/2617/relationships/owner application/vnd.api+json +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 PATCH http://localhost/api/v1/todo-items/2617/relationships/owner application/vnd.api+json +dbug: Microsoft.AspNetCore.Routing.Tree.TreeRouter[1] + Request successfully matched the route with name '(null)' and template 'api/v1/todo-items/{id}/relationships/{relationshipName}'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetRelationshipsAsync (JsonApiDotNetCoreExample)' with id '3fde0ec7-9039-455f-910c-e568544f788a' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action JsonApiDotNetCoreExample.Controllers.TodoItemsController.PatchRelationshipsAsync (JsonApiDotNetCoreExample) +dbug: Microsoft.AspNetCore.Mvc.ModelBinding.Binders.BodyModelBinder[1] + Selected input formatter 'JsonApiDotNetCore.Formatters.JsonApiInputFormatter' for content type 'application/vnd.api+json'. +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.PatchRelationshipsAsync (JsonApiDotNetCoreExample) with arguments (2617, owner, System.Collections.Generic.List`1[JsonApiDotNetCore.Models.DocumentData]) - ModelState is Valid +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.PatchRelationshipsAsync (JsonApiDotNetCoreExample) with arguments (2617, owner, System.Collections.Generic.List`1[JsonApiDotNetCore.Models.DocumentData]) - ModelState is Valid +dbug: JsonApiDotNetCore.Data.DefaultEntityRepository[0] + [JADN] GetAndIncludeAsync(2617, Owner) +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Query[10101] + Compiling query model: + '(from TodoItem e in + (from TodoItem _1 in DbSet + select [_1]).Include("Owner") + where bool [e].Id.Equals((object)__id_0) + select [e]).SingleOrDefault()' +dbug: Microsoft.EntityFrameworkCore.Query[10105] + Including navigation: '[_1].Owner' +dbug: Microsoft.EntityFrameworkCore.Query[10104] + Optimized query model: + '(from TodoItem e in DbSet + join Person e.Owner in DbSet + on Property([e], "OwnerId") equals (Nullable)Property([e.Owner], "Id") into e.Owner_group + from Person e.Owner in + (from Person e.Owner_groupItem in [e.Owner_group] + select [e.Owner_groupItem]).DefaultIfEmpty() + where bool [e].Id.Equals((object)__id_0) + select TodoItem _Include( + queryContext: queryContext, + entity: [e], + included: new object[]{ [e.Owner] }, + fixup: (QueryContext queryContext | TodoItem entity | Object[] included) => + { + Void queryContext.QueryBuffer.StartTracking( + entity: entity, + entityType: EntityType: TodoItem) + return !(bool ReferenceEquals(included[0], null)) ? + { + Void queryContext.QueryBuffer.StartTracking( + entity: included[0], + entityType: EntityType: Person) + Void SetRelationshipSnapshotValue( + stateManager: queryContext.StateManager, + navigation: TodoItem.Owner, + entity: entity, + value: included[0]) + return Void AddToCollectionSnapshot( + stateManager: queryContext.StateManager, + navigation: Person.TodoItems, + entity: included[0], + value: entity) + } + : default(Void) + } + )).SingleOrDefault()' +dbug: Microsoft.EntityFrameworkCore.Query[10107] + (QueryContext queryContext) => IAsyncEnumerable _InterceptExceptions( + source: IAsyncEnumerable _TrackEntities( + results: IAsyncEnumerable _ToSequence(Task SingleOrDefault( + source: IAsyncEnumerable _Select( + source: IAsyncEnumerable> _ShapedQuery( + queryContext: queryContext, + shaperCommandContext: SelectExpression: + SELECT "e"."Id", "e"."AchievedDate", "e"."AssigneeId", "e"."CollectionId", "e"."CreatedDate", "e"."Description", "e"."GuidProperty", "e"."Ordinal", "e"."OwnerId", "e.Owner"."Id", "e.Owner"."FirstName", "e.Owner"."LastName" + FROM "TodoItems" AS "e" + LEFT JOIN "People" AS "e.Owner" ON "e"."OwnerId" = "e.Owner"."Id" + WHERE "e"."Id" = @__id_0 + LIMIT 2, + shaper: TypedCompositeShaper, TodoItem, BufferedOffsetEntityShaper, Person, TransparentIdentifier>), + selector: (TransparentIdentifier t1) => TodoItem _Include( + queryContext: queryContext, + entity: t1.Outer, + included: new object[]{ t1.Inner }, + fixup: (QueryContext queryContext | TodoItem entity | Object[] included) => + { + Void queryContext.QueryBuffer.StartTracking( + entity: entity, + entityType: EntityType: TodoItem) + return !(bool ReferenceEquals(included[0], null)) ? + { + Void queryContext.QueryBuffer.StartTracking( + entity: included[0], + entityType: EntityType: Person) + Void SetRelationshipSnapshotValue( + stateManager: queryContext.StateManager, + navigation: TodoItem.Owner, + entity: entity, + value: included[0]) + return Void AddToCollectionSnapshot( + stateManager: queryContext.StateManager, + navigation: Person.TodoItems, + entity: included[0], + value: entity) + } + : default(Void) + } + )), + cancellationToken: Unhandled parameter: queryContext.CancellationToken)), + queryContext: Unhandled parameter: queryContext, + entityTrackingInfos: { itemType: TodoItem }, + entityAccessors: List> + { + Func, + } + ), + contextType: JsonApiDotNetCoreExample.Data.AppDbContext, + logger: DiagnosticsLogger, + queryContext: Unhandled parameter: queryContext) +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "e"."Id", "e"."AchievedDate", "e"."AssigneeId", "e"."CollectionId", "e"."CreatedDate", "e"."Description", "e"."GuidProperty", "e"."Ordinal", "e"."OwnerId", "e.Owner"."Id", "e.Owner"."FirstName", "e.Owner"."LastName" + FROM "TodoItems" AS "e" + LEFT JOIN "People" AS "e.Owner" ON "e"."OwnerId" = "e.Owner"."Id" + WHERE "e"."Id" = @__id_0 + LIMIT 2 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (12ms) [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "e"."Id", "e"."AchievedDate", "e"."AssigneeId", "e"."CollectionId", "e"."CreatedDate", "e"."Description", "e"."GuidProperty", "e"."Ordinal", "e"."OwnerId", "e.Owner"."Id", "e.Owner"."FirstName", "e.Owner"."LastName" + FROM "TodoItems" AS "e" + LEFT JOIN "People" AS "e.Owner" ON "e"."OwnerId" = "e.Owner"."Id" + WHERE "e"."Id" = @__id_0 + LIMIT 2 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (12ms) [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "e"."Id", "e"."AchievedDate", "e"."AssigneeId", "e"."CollectionId", "e"."CreatedDate", "e"."Description", "e"."GuidProperty", "e"."Ordinal", "e"."OwnerId", "e.Owner"."Id", "e.Owner"."FirstName", "e.Owner"."LastName" + FROM "TodoItems" AS "e" + LEFT JOIN "People" AS "e.Owner" ON "e"."OwnerId" = "e.Owner"."Id" + WHERE "e"."Id" = @__id_0 + LIMIT 2 +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Query[10101] + Compiling query model: + '(from Person x in DbSet + where __First_0 == [x].StringId + select [x]).SingleOrDefault()' +dbug: Microsoft.EntityFrameworkCore.Query[10104] + Optimized query model: + '(from Person x in DbSet + where __First_0 == [x].StringId + select [x]).SingleOrDefault()' +warn: Microsoft.EntityFrameworkCore.Query[20500] + The LINQ expression 'where (__First_0 == [x].StringId)' could not be translated and will be evaluated locally. +warn: Microsoft.EntityFrameworkCore.Query[20500] + The LINQ expression 'where (__First_0 == [x].StringId)' could not be translated and will be evaluated locally. +warn: Microsoft.EntityFrameworkCore.Query[20500] + The LINQ expression 'SingleOrDefault()' could not be translated and will be evaluated locally. +warn: Microsoft.EntityFrameworkCore.Query[20500] + The LINQ expression 'SingleOrDefault()' could not be translated and will be evaluated locally. +dbug: Microsoft.EntityFrameworkCore.Query[10107] + (QueryContext queryContext) => IEnumerable _InterceptExceptions( + source: IEnumerable _TrackEntities( + results: IEnumerable _ToSequence(Person SingleOrDefault(IEnumerable _Where( + source: IEnumerable _ShapedQuery( + queryContext: queryContext, + shaperCommandContext: SelectExpression: + SELECT "x"."Id", "x"."FirstName", "x"."LastName" + FROM "People" AS "x", + shaper: UnbufferedEntityShaper), + predicate: (Person x) => string GetParameterValue( + queryContext: queryContext, + parameterName: "__First_0") == x.StringId))), + queryContext: queryContext, + entityTrackingInfos: { itemType: Person }, + entityAccessors: List> + { + Func, + } + ), + contextType: JsonApiDotNetCoreExample.Data.AppDbContext, + logger: DiagnosticsLogger, + queryContext: queryContext) +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[], CommandType='Text', CommandTimeout='30'] + SELECT "x"."Id", "x"."FirstName", "x"."LastName" + FROM "People" AS "x" +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (3ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + SELECT "x"."Id", "x"."FirstName", "x"."LastName" + FROM "People" AS "x" +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (3ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + SELECT "x"."Id", "x"."FirstName", "x"."LastName" + FROM "People" AS "x" +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20200] + Beginning transaction with isolation level 'ReadCommitted'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@p1='?', @p0='?'], CommandType='Text', CommandTimeout='30'] + UPDATE "TodoItems" SET "OwnerId" = @p0 + WHERE "Id" = @p1; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (2ms) [Parameters=[@p1='?', @p0='?'], CommandType='Text', CommandTimeout='30'] + UPDATE "TodoItems" SET "OwnerId" = @p0 + WHERE "Id" = @p1; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (2ms) [Parameters=[@p1='?', @p0='?'], CommandType='Text', CommandTimeout='30'] + UPDATE "TodoItems" SET "OwnerId" = @p0 + WHERE "Id" = @p1; +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20202] + Committing transaction. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20204] + Disposing transaction. +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.PatchRelationshipsAsync (JsonApiDotNetCoreExample), returned result Microsoft.AspNetCore.Mvc.OkResult. +info: Microsoft.AspNetCore.Mvc.StatusCodeResult[1] + Executing HttpStatusCodeResult, setting HTTP status code 200 +info: Microsoft.AspNetCore.Mvc.StatusCodeResult[1] + Executing HttpStatusCodeResult, setting HTTP status code 200 +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.TodoItemsController.PatchRelationshipsAsync (JsonApiDotNetCoreExample) in 128.36ms +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.TodoItemsController.PatchRelationshipsAsync (JsonApiDotNetCoreExample) in 128.36ms +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 147.825ms 200 +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 147.825ms 200 +dbug: Microsoft.EntityFrameworkCore.Query[10101] + Compiling query model: + '(from TodoItem t in + (from TodoItem t in DbSet + select [t]).Include("Owner") + where [t].Id == __todoItem_Id_0 + select [t]).Single()' +dbug: Microsoft.EntityFrameworkCore.Query[10105] + Including navigation: '[t].Owner' +dbug: Microsoft.EntityFrameworkCore.Query[10104] + Optimized query model: + '(from TodoItem t in DbSet + join Person t.Owner in DbSet + on Property([t], "OwnerId") equals (Nullable)Property([t.Owner], "Id") into t.Owner_group + from Person t.Owner in + (from Person t.Owner_groupItem in [t.Owner_group] + select [t.Owner_groupItem]).DefaultIfEmpty() + where [t].Id == __todoItem_Id_0 + select TodoItem _Include( + queryContext: queryContext, + entity: [t], + included: new object[]{ [t.Owner] }, + fixup: (QueryContext queryContext | TodoItem entity | Object[] included) => + { + Void queryContext.QueryBuffer.StartTracking( + entity: entity, + entityType: EntityType: TodoItem) + return !(bool ReferenceEquals(included[0], null)) ? + { + Void queryContext.QueryBuffer.StartTracking( + entity: included[0], + entityType: EntityType: Person) + Void SetRelationshipSnapshotValue( + stateManager: queryContext.StateManager, + navigation: TodoItem.Owner, + entity: entity, + value: included[0]) + return Void AddToCollectionSnapshot( + stateManager: queryContext.StateManager, + navigation: Person.TodoItems, + entity: included[0], + value: entity) + } + : default(Void) + } + )).Single()' +dbug: Microsoft.EntityFrameworkCore.Query[10107] + (QueryContext queryContext) => IEnumerable _InterceptExceptions( + source: IEnumerable _TrackEntities( + results: IEnumerable _ToSequence(TodoItem Single(IEnumerable _Select( + source: IEnumerable> _ShapedQuery( + queryContext: queryContext, + shaperCommandContext: SelectExpression: + SELECT "t"."Id", "t"."AchievedDate", "t"."AssigneeId", "t"."CollectionId", "t"."CreatedDate", "t"."Description", "t"."GuidProperty", "t"."Ordinal", "t"."OwnerId", "t.Owner"."Id", "t.Owner"."FirstName", "t.Owner"."LastName" + FROM "TodoItems" AS "t" + LEFT JOIN "People" AS "t.Owner" ON "t"."OwnerId" = "t.Owner"."Id" + WHERE "t"."Id" = @__todoItem_Id_0 + LIMIT 2, + shaper: TypedCompositeShaper, TodoItem, BufferedOffsetEntityShaper, Person, TransparentIdentifier>), + selector: (TransparentIdentifier t1) => TodoItem _Include( + queryContext: queryContext, + entity: t1.Outer, + included: new object[]{ t1.Inner }, + fixup: (QueryContext queryContext | TodoItem entity | Object[] included) => + { + Void queryContext.QueryBuffer.StartTracking( + entity: entity, + entityType: EntityType: TodoItem) + return !(bool ReferenceEquals(included[0], null)) ? + { + Void queryContext.QueryBuffer.StartTracking( + entity: included[0], + entityType: EntityType: Person) + Void SetRelationshipSnapshotValue( + stateManager: queryContext.StateManager, + navigation: TodoItem.Owner, + entity: entity, + value: included[0]) + return Void AddToCollectionSnapshot( + stateManager: queryContext.StateManager, + navigation: Person.TodoItems, + entity: included[0], + value: entity) + } + : default(Void) + } + )))), + queryContext: Unhandled parameter: queryContext, + entityTrackingInfos: { itemType: TodoItem }, + entityAccessors: List> + { + Func, + } + ), + contextType: JsonApiDotNetCoreExample.Data.AppDbContext, + logger: DiagnosticsLogger, + queryContext: Unhandled parameter: queryContext) +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@__todoItem_Id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "t"."Id", "t"."AchievedDate", "t"."AssigneeId", "t"."CollectionId", "t"."CreatedDate", "t"."Description", "t"."GuidProperty", "t"."Ordinal", "t"."OwnerId", "t.Owner"."Id", "t.Owner"."FirstName", "t.Owner"."LastName" + FROM "TodoItems" AS "t" + LEFT JOIN "People" AS "t.Owner" ON "t"."OwnerId" = "t.Owner"."Id" + WHERE "t"."Id" = @__todoItem_Id_0 + LIMIT 2 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@__todoItem_Id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "t"."Id", "t"."AchievedDate", "t"."AssigneeId", "t"."CollectionId", "t"."CreatedDate", "t"."Description", "t"."GuidProperty", "t"."Ordinal", "t"."OwnerId", "t.Owner"."Id", "t.Owner"."FirstName", "t.Owner"."LastName" + FROM "TodoItems" AS "t" + LEFT JOIN "People" AS "t.Owner" ON "t"."OwnerId" = "t.Owner"."Id" + WHERE "t"."Id" = @__todoItem_Id_0 + LIMIT 2 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@__todoItem_Id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "t"."Id", "t"."AchievedDate", "t"."AssigneeId", "t"."CollectionId", "t"."CreatedDate", "t"."Description", "t"."GuidProperty", "t"."Ordinal", "t"."OwnerId", "t.Owner"."Id", "t.Owner"."FirstName", "t.Owner"."LastName" + FROM "TodoItems" AS "t" + LEFT JOIN "People" AS "t.Owner" ON "t"."OwnerId" = "t.Owner"."Id" + WHERE "t"."Id" = @__todoItem_Id_0 + LIMIT 2 +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20200] + Beginning transaction with isolation level 'ReadCommitted'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?', @p8='?', @p9='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "People" ("FirstName", "LastName") + VALUES (@p0, @p1) + RETURNING "Id"; + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p2, @p3, @p4, @p5, @p6, @p7, @p8, @p9) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?', @p8='?', @p9='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "People" ("FirstName", "LastName") + VALUES (@p0, @p1) + RETURNING "Id"; + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p2, @p3, @p4, @p5, @p6, @p7, @p8, @p9) + RETURNING "Id"; +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?', @p8='?', @p9='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "People" ("FirstName", "LastName") + VALUES (@p0, @p1) + RETURNING "Id"; + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p2, @p3, @p4, @p5, @p6, @p7, @p8, @p9) + RETURNING "Id"; +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20202] + Committing transaction. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20204] + Disposing transaction. +dbug: Microsoft.EntityFrameworkCore.Infrastructure[10401] + An 'IServiceProvider' was created for internal use by Entity Framework. +warn: Microsoft.EntityFrameworkCore.Infrastructure[10402] + More than twenty 'IServiceProvider' instances have been created for internal use by Entity Framework. Consider reviewing calls on 'DbContextOptionsBuilder' that may require new service providers to be built. +info: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[0] + User profile is available. Using '/Users/jarednance/.aspnet/DataProtection-Keys' as key repository; keys will not be encrypted at rest. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-b040dd03-33c5-451e-8f42-3c9dd4e0dfec.xml'. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-c8147b66-2deb-407c-9421-1553f0e16d67.xml'. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-f7fa4a09-6d65-426e-a653-cbd2969e5073.xml'. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {b040dd03-33c5-451e-8f42-3c9dd4e0dfec}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {c8147b66-2deb-407c-9421-1553f0e16d67}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {f7fa4a09-6d65-426e-a653-cbd2969e5073}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.DefaultKeyResolver[13] + Considering key {c8147b66-2deb-407c-9421-1553f0e16d67} with expiration date 2018-03-03 16:22:35Z as default key. +dbug: Microsoft.AspNetCore.DataProtection.TypeForwardingActivator[0] + Forwarded activator type request from Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Version=1.1.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60 to Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Culture=neutral, PublicKeyToken=adb9793829ddae60 +dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptorFactory[11] + Using managed symmetric algorithm 'System.Security.Cryptography.Aes'. +dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptorFactory[10] + Using managed keyed hash algorithm 'System.Security.Cryptography.HMACSHA256'. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingProvider[2] + Using key {c8147b66-2deb-407c-9421-1553f0e16d67} as the default key. +dbug: Microsoft.AspNetCore.DataProtection.Internal.DataProtectionStartupFilter[0] + Key ring with default key {c8147b66-2deb-407c-9421-1553f0e16d67} was loaded during application startup. +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[], CommandType='Text', CommandTimeout='30'] + + SELECT CASE WHEN COUNT(*) = 0 THEN FALSE ELSE TRUE END + FROM information_schema.tables + WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema') +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (2ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + + SELECT CASE WHEN COUNT(*) = 0 THEN FALSE ELSE TRUE END + FROM information_schema.tables + WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema') +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[3] + Hosting starting +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[4] + Hosting started +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[0] + Loaded hosting startup assembly JsonApiDotNetCoreExample +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 PATCH http://localhost/api/v1/people/887/relationships/todo-items application/vnd.api+json +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 PATCH http://localhost/api/v1/people/887/relationships/todo-items application/vnd.api+json +dbug: Microsoft.AspNetCore.Routing.Tree.TreeRouter[1] + Request successfully matched the route with name '(null)' and template 'api/v1/people/{id}/relationships/{relationshipName}'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.PeopleController.GetRelationshipsAsync (JsonApiDotNetCoreExample)' with id '55bc06aa-666a-4e45-9dba-c3c04b1e2592' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action JsonApiDotNetCoreExample.Controllers.PeopleController.PatchRelationshipsAsync (JsonApiDotNetCoreExample) +dbug: Microsoft.AspNetCore.Mvc.ModelBinding.Binders.BodyModelBinder[1] + Selected input formatter 'JsonApiDotNetCore.Formatters.JsonApiInputFormatter' for content type 'application/vnd.api+json'. +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.PeopleController.PatchRelationshipsAsync (JsonApiDotNetCoreExample) with arguments (887, todo-items, System.Collections.Generic.List`1[JsonApiDotNetCore.Models.DocumentData]) - ModelState is Valid +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.PeopleController.PatchRelationshipsAsync (JsonApiDotNetCoreExample) with arguments (887, todo-items, System.Collections.Generic.List`1[JsonApiDotNetCore.Models.DocumentData]) - ModelState is Valid +dbug: JsonApiDotNetCore.Data.DefaultEntityRepository[0] + [JADN] GetAndIncludeAsync(887, TodoItems) +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Query[10101] + Compiling query model: + '(from Person e in + (from Person _1 in DbSet + select [_1]).Include("TodoItems") + where bool [e].Id.Equals((object)__id_0) + select [e]).SingleOrDefault()' +dbug: Microsoft.EntityFrameworkCore.Query[10105] + Including navigation: '[_1].TodoItems' +dbug: Microsoft.EntityFrameworkCore.Query[10104] + Optimized query model: + '(from Person e in DbSet + where bool [e].Id.Equals((object)__id_0) + order by (Nullable)EF.Property(?[e]?, "Id") asc + select Task _IncludeAsync( + queryContext: queryContext, + entity: [e], + included: new object[]{ }, + fixup: (QueryContext queryContext | Person entity | Object[] included | CancellationToken ct) => + { + Void queryContext.QueryBuffer.StartTracking( + entity: entity, + entityType: EntityType: Person) + return Task queryContext.QueryBuffer.IncludeCollectionAsync( + includeId: 0, + navigation: Person.TodoItems, + inverseNavigation: TodoItem.Owner, + targetEntityType: EntityType: TodoItem, + clrCollectionAccessor: ClrICollectionAccessor, TodoItem>, + inverseClrPropertySetter: ClrPropertySetter, + tracking: True, + instance: entity, + valuesFactory: (Func>)() => + from TodoItem e.TodoItems in DbSet + join AnonymousObject _e in + (from Person e in DbSet + where bool [e].Id.Equals((object)__id_0) + order by (Nullable)EF.Property(?[e]?, "Id") asc + select new AnonymousObject(new object[]{ (object)EF.Property(?[e]?, "Id") })).Take(1) + on Property([e.TodoItems], "OwnerId") equals (Nullable)object [_e].GetValue(0) + order by object [_e].GetValue(0) asc + select [e.TodoItems], + cancellationToken: ct) + } + , + cancellationToken: ct).Result).SingleOrDefault()' +dbug: Microsoft.EntityFrameworkCore.Query[10107] + (QueryContext queryContext) => IAsyncEnumerable _InterceptExceptions( + source: IAsyncEnumerable _TrackEntities( + results: IAsyncEnumerable _ToSequence(Task SingleOrDefault( + source: IAsyncEnumerable _SelectAsync( + source: IAsyncEnumerable _ShapedQuery( + queryContext: queryContext, + shaperCommandContext: SelectExpression: + SELECT "e"."Id", "e"."FirstName", "e"."LastName" + FROM "People" AS "e" + WHERE "e"."Id" = @__id_0 + ORDER BY "e"."Id" + LIMIT 2, + shaper: BufferedEntityShaper), + selector: (Person e | CancellationToken ct) => Task _ExecuteAsync( + taskFactories: new Func>[]{ () => Task _ToObjectTask(Task _IncludeAsync( + queryContext: queryContext, + entity: e, + included: new object[]{ }, + fixup: (QueryContext queryContext | Person entity | Object[] included | CancellationToken ct) => + { + Void queryContext.QueryBuffer.StartTracking( + entity: entity, + entityType: EntityType: Person) + return Task queryContext.QueryBuffer.IncludeCollectionAsync( + includeId: 0, + navigation: Person.TodoItems, + inverseNavigation: TodoItem.Owner, + targetEntityType: EntityType: TodoItem, + clrCollectionAccessor: ClrICollectionAccessor, TodoItem>, + inverseClrPropertySetter: ClrPropertySetter, + tracking: True, + instance: entity, + valuesFactory: (Func>)() => IAsyncEnumerable _ShapedQuery( + queryContext: queryContext, + shaperCommandContext: SelectExpression: + SELECT "e.TodoItems"."Id", "e.TodoItems"."AchievedDate", "e.TodoItems"."AssigneeId", "e.TodoItems"."CollectionId", "e.TodoItems"."CreatedDate", "e.TodoItems"."Description", "e.TodoItems"."GuidProperty", "e.TodoItems"."Ordinal", "e.TodoItems"."OwnerId" + FROM "TodoItems" AS "e.TodoItems" + INNER JOIN ( + SELECT "e0"."Id" + FROM "People" AS "e0" + WHERE "e0"."Id" = @__id_0 + ORDER BY "e0"."Id" + LIMIT 1 + ) AS "t" ON "e.TodoItems"."OwnerId" = "t"."Id" + ORDER BY "t"."Id", + shaper: BufferedEntityShaper), + cancellationToken: ct) + } + , + cancellationToken: Unhandled parameter: ct)) }, + selector: (Object[] results) => (Person)results[0])), + cancellationToken: Unhandled parameter: queryContext.CancellationToken)), + queryContext: Unhandled parameter: queryContext, + entityTrackingInfos: { itemType: Person }, + entityAccessors: List> + { + Func, + } + ), + contextType: JsonApiDotNetCoreExample.Data.AppDbContext, + logger: DiagnosticsLogger, + queryContext: Unhandled parameter: queryContext) +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "e"."Id", "e"."FirstName", "e"."LastName" + FROM "People" AS "e" + WHERE "e"."Id" = @__id_0 + ORDER BY "e"."Id" + LIMIT 2 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (5ms) [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "e"."Id", "e"."FirstName", "e"."LastName" + FROM "People" AS "e" + WHERE "e"."Id" = @__id_0 + ORDER BY "e"."Id" + LIMIT 2 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (5ms) [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "e"."Id", "e"."FirstName", "e"."LastName" + FROM "People" AS "e" + WHERE "e"."Id" = @__id_0 + ORDER BY "e"."Id" + LIMIT 2 +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "e.TodoItems"."Id", "e.TodoItems"."AchievedDate", "e.TodoItems"."AssigneeId", "e.TodoItems"."CollectionId", "e.TodoItems"."CreatedDate", "e.TodoItems"."Description", "e.TodoItems"."GuidProperty", "e.TodoItems"."Ordinal", "e.TodoItems"."OwnerId" + FROM "TodoItems" AS "e.TodoItems" + INNER JOIN ( + SELECT "e0"."Id" + FROM "People" AS "e0" + WHERE "e0"."Id" = @__id_0 + ORDER BY "e0"."Id" + LIMIT 1 + ) AS "t" ON "e.TodoItems"."OwnerId" = "t"."Id" + ORDER BY "t"."Id" +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "e.TodoItems"."Id", "e.TodoItems"."AchievedDate", "e.TodoItems"."AssigneeId", "e.TodoItems"."CollectionId", "e.TodoItems"."CreatedDate", "e.TodoItems"."Description", "e.TodoItems"."GuidProperty", "e.TodoItems"."Ordinal", "e.TodoItems"."OwnerId" + FROM "TodoItems" AS "e.TodoItems" + INNER JOIN ( + SELECT "e0"."Id" + FROM "People" AS "e0" + WHERE "e0"."Id" = @__id_0 + ORDER BY "e0"."Id" + LIMIT 1 + ) AS "t" ON "e.TodoItems"."OwnerId" = "t"."Id" + ORDER BY "t"."Id" +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "e.TodoItems"."Id", "e.TodoItems"."AchievedDate", "e.TodoItems"."AssigneeId", "e.TodoItems"."CollectionId", "e.TodoItems"."CreatedDate", "e.TodoItems"."Description", "e.TodoItems"."GuidProperty", "e.TodoItems"."Ordinal", "e.TodoItems"."OwnerId" + FROM "TodoItems" AS "e.TodoItems" + INNER JOIN ( + SELECT "e0"."Id" + FROM "People" AS "e0" + WHERE "e0"."Id" = @__id_0 + ORDER BY "e0"."Id" + LIMIT 1 + ) AS "t" ON "e.TodoItems"."OwnerId" = "t"."Id" + ORDER BY "t"."Id" +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Query[10101] + Compiling query model: + 'from TodoItem x in DbSet + where + (from string _1 in __relationshipIds_0 + select [_1]).Contains([x].StringId) + select [x]' +dbug: Microsoft.EntityFrameworkCore.Query[10104] + Optimized query model: + 'from TodoItem x in DbSet + where + (from string _1 in __relationshipIds_0 + select [_1]).Contains([x].StringId) + select [x]' +warn: Microsoft.EntityFrameworkCore.Query[20500] + The LINQ expression 'where {__relationshipIds_0 => Contains([x].StringId)}' could not be translated and will be evaluated locally. +warn: Microsoft.EntityFrameworkCore.Query[20500] + The LINQ expression 'where {__relationshipIds_0 => Contains([x].StringId)}' could not be translated and will be evaluated locally. +warn: Microsoft.EntityFrameworkCore.Query[20500] + The LINQ expression 'Contains([x].StringId)' could not be translated and will be evaluated locally. +warn: Microsoft.EntityFrameworkCore.Query[20500] + The LINQ expression 'Contains([x].StringId)' could not be translated and will be evaluated locally. +dbug: Microsoft.EntityFrameworkCore.Query[10107] + (QueryContext queryContext) => IEnumerable _InterceptExceptions( + source: IEnumerable _TrackEntities( + results: IEnumerable _Where( + source: IEnumerable _ShapedQuery( + queryContext: queryContext, + shaperCommandContext: SelectExpression: + SELECT "x"."Id", "x"."AchievedDate", "x"."AssigneeId", "x"."CollectionId", "x"."CreatedDate", "x"."Description", "x"."GuidProperty", "x"."Ordinal", "x"."OwnerId" + FROM "TodoItems" AS "x", + shaper: UnbufferedEntityShaper), + predicate: (TodoItem x) => bool Contains( + source: IEnumerable GetParameterValue( + queryContext: queryContext, + parameterName: "__relationshipIds_0"), + value: x.StringId)), + queryContext: queryContext, + entityTrackingInfos: { itemType: TodoItem }, + entityAccessors: List> + { + Func, + } + ), + contextType: JsonApiDotNetCoreExample.Data.AppDbContext, + logger: DiagnosticsLogger, + queryContext: queryContext) +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[], CommandType='Text', CommandTimeout='30'] + SELECT "x"."Id", "x"."AchievedDate", "x"."AssigneeId", "x"."CollectionId", "x"."CreatedDate", "x"."Description", "x"."GuidProperty", "x"."Ordinal", "x"."OwnerId" + FROM "TodoItems" AS "x" +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + SELECT "x"."Id", "x"."AchievedDate", "x"."AssigneeId", "x"."CollectionId", "x"."CreatedDate", "x"."Description", "x"."GuidProperty", "x"."Ordinal", "x"."OwnerId" + FROM "TodoItems" AS "x" +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + SELECT "x"."Id", "x"."AchievedDate", "x"."AssigneeId", "x"."CollectionId", "x"."CreatedDate", "x"."Description", "x"."GuidProperty", "x"."Ordinal", "x"."OwnerId" + FROM "TodoItems" AS "x" +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20200] + Beginning transaction with isolation level 'ReadCommitted'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@p1='?', @p0='?'], CommandType='Text', CommandTimeout='30'] + UPDATE "TodoItems" SET "OwnerId" = @p0 + WHERE "Id" = @p1; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p1='?', @p0='?'], CommandType='Text', CommandTimeout='30'] + UPDATE "TodoItems" SET "OwnerId" = @p0 + WHERE "Id" = @p1; +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p1='?', @p0='?'], CommandType='Text', CommandTimeout='30'] + UPDATE "TodoItems" SET "OwnerId" = @p0 + WHERE "Id" = @p1; +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20202] + Committing transaction. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20204] + Disposing transaction. +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action method JsonApiDotNetCoreExample.Controllers.PeopleController.PatchRelationshipsAsync (JsonApiDotNetCoreExample), returned result Microsoft.AspNetCore.Mvc.OkResult. +info: Microsoft.AspNetCore.Mvc.StatusCodeResult[1] + Executing HttpStatusCodeResult, setting HTTP status code 200 +info: Microsoft.AspNetCore.Mvc.StatusCodeResult[1] + Executing HttpStatusCodeResult, setting HTTP status code 200 +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.PeopleController.PatchRelationshipsAsync (JsonApiDotNetCoreExample) in 222.821ms +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.PeopleController.PatchRelationshipsAsync (JsonApiDotNetCoreExample) in 222.821ms +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 254.919ms 200 +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 254.919ms 200 +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Query[10101] + Compiling query model: + '(from Person p in + (from Person p in DbSet + select [p]).Include("TodoItems") + where [p].Id == __person_Id_0 + select [p]).Single()' +dbug: Microsoft.EntityFrameworkCore.Query[10105] + Including navigation: '[p].TodoItems' +dbug: Microsoft.EntityFrameworkCore.Query[10104] + Optimized query model: + '(from Person p in DbSet + where [p].Id == __person_Id_0 + order by (Nullable)EF.Property(?[p]?, "Id") asc + select Person _Include( + queryContext: queryContext, + entity: [p], + included: new object[]{ }, + fixup: (QueryContext queryContext | Person entity | Object[] included) => + { + Void queryContext.QueryBuffer.StartTracking( + entity: entity, + entityType: EntityType: Person) + return Void queryContext.QueryBuffer.IncludeCollection( + includeId: 0, + navigation: Person.TodoItems, + inverseNavigation: TodoItem.Owner, + targetEntityType: EntityType: TodoItem, + clrCollectionAccessor: ClrICollectionAccessor, TodoItem>, + inverseClrPropertySetter: ClrPropertySetter, + tracking: True, + instance: entity, + valuesFactory: () => + from TodoItem p.TodoItems in DbSet + join AnonymousObject _p in + (from Person p in DbSet + where [p].Id == __person_Id_0 + order by (Nullable)EF.Property(?[p]?, "Id") asc + select new AnonymousObject(new object[]{ (object)EF.Property(?[p]?, "Id") })).Take(1) + on Property([p.TodoItems], "OwnerId") equals (Nullable)object [_p].GetValue(0) + order by object [_p].GetValue(0) asc + select [p.TodoItems]) + } + )).Single()' +dbug: Microsoft.EntityFrameworkCore.Query[10107] + (QueryContext queryContext) => IEnumerable _InterceptExceptions( + source: IEnumerable _TrackEntities( + results: IEnumerable _ToSequence(Person Single(IEnumerable _Select( + source: IEnumerable _ShapedQuery( + queryContext: queryContext, + shaperCommandContext: SelectExpression: + SELECT "p"."Id", "p"."FirstName", "p"."LastName" + FROM "People" AS "p" + WHERE "p"."Id" = @__person_Id_0 + ORDER BY "p"."Id" + LIMIT 2, + shaper: BufferedEntityShaper), + selector: (Person p) => Person _Include( + queryContext: queryContext, + entity: p, + included: new object[]{ }, + fixup: (QueryContext queryContext | Person entity | Object[] included) => + { + Void queryContext.QueryBuffer.StartTracking( + entity: entity, + entityType: EntityType: Person) + return Void queryContext.QueryBuffer.IncludeCollection( + includeId: 0, + navigation: Person.TodoItems, + inverseNavigation: TodoItem.Owner, + targetEntityType: EntityType: TodoItem, + clrCollectionAccessor: ClrICollectionAccessor, TodoItem>, + inverseClrPropertySetter: ClrPropertySetter, + tracking: True, + instance: entity, + valuesFactory: () => IEnumerable _ShapedQuery( + queryContext: queryContext, + shaperCommandContext: SelectExpression: + SELECT "p.TodoItems"."Id", "p.TodoItems"."AchievedDate", "p.TodoItems"."AssigneeId", "p.TodoItems"."CollectionId", "p.TodoItems"."CreatedDate", "p.TodoItems"."Description", "p.TodoItems"."GuidProperty", "p.TodoItems"."Ordinal", "p.TodoItems"."OwnerId" + FROM "TodoItems" AS "p.TodoItems" + INNER JOIN ( + SELECT "p0"."Id" + FROM "People" AS "p0" + WHERE "p0"."Id" = @__person_Id_0 + ORDER BY "p0"."Id" + LIMIT 1 + ) AS "t" ON "p.TodoItems"."OwnerId" = "t"."Id" + ORDER BY "t"."Id", + shaper: BufferedEntityShaper)) + } + )))), + queryContext: Unhandled parameter: queryContext, + entityTrackingInfos: { itemType: Person }, + entityAccessors: List> + { + Func, + } + ), + contextType: JsonApiDotNetCoreExample.Data.AppDbContext, + logger: DiagnosticsLogger, + queryContext: Unhandled parameter: queryContext) +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@__person_Id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "p"."Id", "p"."FirstName", "p"."LastName" + FROM "People" AS "p" + WHERE "p"."Id" = @__person_Id_0 + ORDER BY "p"."Id" + LIMIT 2 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@__person_Id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "p"."Id", "p"."FirstName", "p"."LastName" + FROM "People" AS "p" + WHERE "p"."Id" = @__person_Id_0 + ORDER BY "p"."Id" + LIMIT 2 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@__person_Id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "p"."Id", "p"."FirstName", "p"."LastName" + FROM "People" AS "p" + WHERE "p"."Id" = @__person_Id_0 + ORDER BY "p"."Id" + LIMIT 2 +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@__person_Id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "p.TodoItems"."Id", "p.TodoItems"."AchievedDate", "p.TodoItems"."AssigneeId", "p.TodoItems"."CollectionId", "p.TodoItems"."CreatedDate", "p.TodoItems"."Description", "p.TodoItems"."GuidProperty", "p.TodoItems"."Ordinal", "p.TodoItems"."OwnerId" + FROM "TodoItems" AS "p.TodoItems" + INNER JOIN ( + SELECT "p0"."Id" + FROM "People" AS "p0" + WHERE "p0"."Id" = @__person_Id_0 + ORDER BY "p0"."Id" + LIMIT 1 + ) AS "t" ON "p.TodoItems"."OwnerId" = "t"."Id" + ORDER BY "t"."Id" +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@__person_Id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "p.TodoItems"."Id", "p.TodoItems"."AchievedDate", "p.TodoItems"."AssigneeId", "p.TodoItems"."CollectionId", "p.TodoItems"."CreatedDate", "p.TodoItems"."Description", "p.TodoItems"."GuidProperty", "p.TodoItems"."Ordinal", "p.TodoItems"."OwnerId" + FROM "TodoItems" AS "p.TodoItems" + INNER JOIN ( + SELECT "p0"."Id" + FROM "People" AS "p0" + WHERE "p0"."Id" = @__person_Id_0 + ORDER BY "p0"."Id" + LIMIT 1 + ) AS "t" ON "p.TodoItems"."OwnerId" = "t"."Id" + ORDER BY "t"."Id" +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@__person_Id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "p.TodoItems"."Id", "p.TodoItems"."AchievedDate", "p.TodoItems"."AssigneeId", "p.TodoItems"."CollectionId", "p.TodoItems"."CreatedDate", "p.TodoItems"."Description", "p.TodoItems"."GuidProperty", "p.TodoItems"."Ordinal", "p.TodoItems"."OwnerId" + FROM "TodoItems" AS "p.TodoItems" + INNER JOIN ( + SELECT "p0"."Id" + FROM "People" AS "p0" + WHERE "p0"."Id" = @__person_Id_0 + ORDER BY "p0"."Id" + LIMIT 1 + ) AS "t" ON "p.TodoItems"."OwnerId" = "t"."Id" + ORDER BY "t"."Id" +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Query[10101] + Compiling query model: + 'from Person _0 in DbSet + select [_0]' +dbug: Microsoft.EntityFrameworkCore.Query[10104] + Optimized query model: + 'from Person _0 in DbSet + select [_0]' +dbug: Microsoft.EntityFrameworkCore.Query[10107] + (QueryContext queryContext) => IEnumerable _InterceptExceptions( + source: IEnumerable _TrackEntities( + results: IEnumerable _ShapedQuery( + queryContext: queryContext, + shaperCommandContext: SelectExpression: + SELECT "p"."Id", "p"."FirstName", "p"."LastName" + FROM "People" AS "p", + shaper: UnbufferedEntityShaper), + queryContext: queryContext, + entityTrackingInfos: { itemType: Person }, + entityAccessors: List> + { + Func, + } + ), + contextType: JsonApiDotNetCoreExample.Data.AppDbContext, + logger: DiagnosticsLogger, + queryContext: queryContext) +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[], CommandType='Text', CommandTimeout='30'] + SELECT "p"."Id", "p"."FirstName", "p"."LastName" + FROM "People" AS "p" +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (0ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + SELECT "p"."Id", "p"."FirstName", "p"."LastName" + FROM "People" AS "p" +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (0ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + SELECT "p"."Id", "p"."FirstName", "p"."LastName" + FROM "People" AS "p" +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[], CommandType='Text', CommandTimeout='30'] + SELECT "t"."Id", "t"."AchievedDate", "t"."AssigneeId", "t"."CollectionId", "t"."CreatedDate", "t"."Description", "t"."GuidProperty", "t"."Ordinal", "t"."OwnerId" + FROM "TodoItems" AS "t" +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + SELECT "t"."Id", "t"."AchievedDate", "t"."AssigneeId", "t"."CollectionId", "t"."CreatedDate", "t"."Description", "t"."GuidProperty", "t"."Ordinal", "t"."OwnerId" + FROM "TodoItems" AS "t" +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + SELECT "t"."Id", "t"."AchievedDate", "t"."AssigneeId", "t"."CollectionId", "t"."CreatedDate", "t"."Description", "t"."GuidProperty", "t"."Ordinal", "t"."OwnerId" + FROM "TodoItems" AS "t" +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20200] + Beginning transaction with isolation level 'ReadCommitted'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?', @p8='?', @p9='?', @p10='?', @p11='?', @p12='?', @p13='?', @p14='?', @p15='?', @p16='?', @p17='?', @p18='?', @p19='?', @p20='?', @p21='?', @p22='?', @p23='?', @p24='?', @p25='?', @p26='?', @p27='?'], CommandType='Text', CommandTimeout='30'] + DELETE FROM "People" + WHERE "Id" = @p0; + DELETE FROM "People" + WHERE "Id" = @p1; + DELETE FROM "People" + WHERE "Id" = @p2; + DELETE FROM "People" + WHERE "Id" = @p3; + DELETE FROM "People" + WHERE "Id" = @p4; + DELETE FROM "People" + WHERE "Id" = @p5; + DELETE FROM "People" + WHERE "Id" = @p6; + DELETE FROM "People" + WHERE "Id" = @p7; + DELETE FROM "People" + WHERE "Id" = @p8; + DELETE FROM "People" + WHERE "Id" = @p9; + DELETE FROM "People" + WHERE "Id" = @p10; + DELETE FROM "People" + WHERE "Id" = @p11; + DELETE FROM "People" + WHERE "Id" = @p12; + DELETE FROM "People" + WHERE "Id" = @p13; + DELETE FROM "People" + WHERE "Id" = @p14; + DELETE FROM "People" + WHERE "Id" = @p15; + DELETE FROM "People" + WHERE "Id" = @p16; + DELETE FROM "People" + WHERE "Id" = @p17; + DELETE FROM "People" + WHERE "Id" = @p18; + DELETE FROM "People" + WHERE "Id" = @p19; + INSERT INTO "People" ("FirstName", "LastName") + VALUES (@p20, @p21) + RETURNING "Id"; + DELETE FROM "TodoItems" + WHERE "Id" = @p22; + DELETE FROM "TodoItems" + WHERE "Id" = @p23; + DELETE FROM "TodoItems" + WHERE "Id" = @p24; + DELETE FROM "TodoItems" + WHERE "Id" = @p25; + DELETE FROM "TodoItems" + WHERE "Id" = @p26; + DELETE FROM "TodoItems" + WHERE "Id" = @p27; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (4ms) [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?', @p8='?', @p9='?', @p10='?', @p11='?', @p12='?', @p13='?', @p14='?', @p15='?', @p16='?', @p17='?', @p18='?', @p19='?', @p20='?', @p21='?', @p22='?', @p23='?', @p24='?', @p25='?', @p26='?', @p27='?'], CommandType='Text', CommandTimeout='30'] + DELETE FROM "People" + WHERE "Id" = @p0; + DELETE FROM "People" + WHERE "Id" = @p1; + DELETE FROM "People" + WHERE "Id" = @p2; + DELETE FROM "People" + WHERE "Id" = @p3; + DELETE FROM "People" + WHERE "Id" = @p4; + DELETE FROM "People" + WHERE "Id" = @p5; + DELETE FROM "People" + WHERE "Id" = @p6; + DELETE FROM "People" + WHERE "Id" = @p7; + DELETE FROM "People" + WHERE "Id" = @p8; + DELETE FROM "People" + WHERE "Id" = @p9; + DELETE FROM "People" + WHERE "Id" = @p10; + DELETE FROM "People" + WHERE "Id" = @p11; + DELETE FROM "People" + WHERE "Id" = @p12; + DELETE FROM "People" + WHERE "Id" = @p13; + DELETE FROM "People" + WHERE "Id" = @p14; + DELETE FROM "People" + WHERE "Id" = @p15; + DELETE FROM "People" + WHERE "Id" = @p16; + DELETE FROM "People" + WHERE "Id" = @p17; + DELETE FROM "People" + WHERE "Id" = @p18; + DELETE FROM "People" + WHERE "Id" = @p19; + INSERT INTO "People" ("FirstName", "LastName") + VALUES (@p20, @p21) + RETURNING "Id"; + DELETE FROM "TodoItems" + WHERE "Id" = @p22; + DELETE FROM "TodoItems" + WHERE "Id" = @p23; + DELETE FROM "TodoItems" + WHERE "Id" = @p24; + DELETE FROM "TodoItems" + WHERE "Id" = @p25; + DELETE FROM "TodoItems" + WHERE "Id" = @p26; + DELETE FROM "TodoItems" + WHERE "Id" = @p27; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (4ms) [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?', @p8='?', @p9='?', @p10='?', @p11='?', @p12='?', @p13='?', @p14='?', @p15='?', @p16='?', @p17='?', @p18='?', @p19='?', @p20='?', @p21='?', @p22='?', @p23='?', @p24='?', @p25='?', @p26='?', @p27='?'], CommandType='Text', CommandTimeout='30'] + DELETE FROM "People" + WHERE "Id" = @p0; + DELETE FROM "People" + WHERE "Id" = @p1; + DELETE FROM "People" + WHERE "Id" = @p2; + DELETE FROM "People" + WHERE "Id" = @p3; + DELETE FROM "People" + WHERE "Id" = @p4; + DELETE FROM "People" + WHERE "Id" = @p5; + DELETE FROM "People" + WHERE "Id" = @p6; + DELETE FROM "People" + WHERE "Id" = @p7; + DELETE FROM "People" + WHERE "Id" = @p8; + DELETE FROM "People" + WHERE "Id" = @p9; + DELETE FROM "People" + WHERE "Id" = @p10; + DELETE FROM "People" + WHERE "Id" = @p11; + DELETE FROM "People" + WHERE "Id" = @p12; + DELETE FROM "People" + WHERE "Id" = @p13; + DELETE FROM "People" + WHERE "Id" = @p14; + DELETE FROM "People" + WHERE "Id" = @p15; + DELETE FROM "People" + WHERE "Id" = @p16; + DELETE FROM "People" + WHERE "Id" = @p17; + DELETE FROM "People" + WHERE "Id" = @p18; + DELETE FROM "People" + WHERE "Id" = @p19; + INSERT INTO "People" ("FirstName", "LastName") + VALUES (@p20, @p21) + RETURNING "Id"; + DELETE FROM "TodoItems" + WHERE "Id" = @p22; + DELETE FROM "TodoItems" + WHERE "Id" = @p23; + DELETE FROM "TodoItems" + WHERE "Id" = @p24; + DELETE FROM "TodoItems" + WHERE "Id" = @p25; + DELETE FROM "TodoItems" + WHERE "Id" = @p26; + DELETE FROM "TodoItems" + WHERE "Id" = @p27; +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@p28='?', @p29='?', @p30='?', @p31='?', @p32='?', @p33='?', @p34='?', @p35='?', @p36='?', @p37='?', @p38='?', @p39='?', @p40='?', @p41='?', @p42='?', @p43='?', @p44='?', @p45='?', @p46='?'], CommandType='Text', CommandTimeout='30'] + DELETE FROM "People" + WHERE "Id" = @p28; + DELETE FROM "People" + WHERE "Id" = @p29; + DELETE FROM "People" + WHERE "Id" = @p30; + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p31, @p32, @p33, @p34, @p35, @p36, @p37, @p38) + RETURNING "Id"; + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p39, @p40, @p41, @p42, @p43, @p44, @p45, @p46) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p28='?', @p29='?', @p30='?', @p31='?', @p32='?', @p33='?', @p34='?', @p35='?', @p36='?', @p37='?', @p38='?', @p39='?', @p40='?', @p41='?', @p42='?', @p43='?', @p44='?', @p45='?', @p46='?'], CommandType='Text', CommandTimeout='30'] + DELETE FROM "People" + WHERE "Id" = @p28; + DELETE FROM "People" + WHERE "Id" = @p29; + DELETE FROM "People" + WHERE "Id" = @p30; + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p31, @p32, @p33, @p34, @p35, @p36, @p37, @p38) + RETURNING "Id"; + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p39, @p40, @p41, @p42, @p43, @p44, @p45, @p46) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p28='?', @p29='?', @p30='?', @p31='?', @p32='?', @p33='?', @p34='?', @p35='?', @p36='?', @p37='?', @p38='?', @p39='?', @p40='?', @p41='?', @p42='?', @p43='?', @p44='?', @p45='?', @p46='?'], CommandType='Text', CommandTimeout='30'] + DELETE FROM "People" + WHERE "Id" = @p28; + DELETE FROM "People" + WHERE "Id" = @p29; + DELETE FROM "People" + WHERE "Id" = @p30; + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p31, @p32, @p33, @p34, @p35, @p36, @p37, @p38) + RETURNING "Id"; + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p39, @p40, @p41, @p42, @p43, @p44, @p45, @p46) + RETURNING "Id"; +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20202] + Committing transaction. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20204] + Disposing transaction. +dbug: Microsoft.EntityFrameworkCore.Infrastructure[10401] + An 'IServiceProvider' was created for internal use by Entity Framework. +warn: Microsoft.EntityFrameworkCore.Infrastructure[10402] + More than twenty 'IServiceProvider' instances have been created for internal use by Entity Framework. Consider reviewing calls on 'DbContextOptionsBuilder' that may require new service providers to be built. +info: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[0] + User profile is available. Using '/Users/jarednance/.aspnet/DataProtection-Keys' as key repository; keys will not be encrypted at rest. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-b040dd03-33c5-451e-8f42-3c9dd4e0dfec.xml'. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-c8147b66-2deb-407c-9421-1553f0e16d67.xml'. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-f7fa4a09-6d65-426e-a653-cbd2969e5073.xml'. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {b040dd03-33c5-451e-8f42-3c9dd4e0dfec}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {c8147b66-2deb-407c-9421-1553f0e16d67}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {f7fa4a09-6d65-426e-a653-cbd2969e5073}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.DefaultKeyResolver[13] + Considering key {c8147b66-2deb-407c-9421-1553f0e16d67} with expiration date 2018-03-03 16:22:35Z as default key. +dbug: Microsoft.AspNetCore.DataProtection.TypeForwardingActivator[0] + Forwarded activator type request from Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Version=1.1.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60 to Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Culture=neutral, PublicKeyToken=adb9793829ddae60 +dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptorFactory[11] + Using managed symmetric algorithm 'System.Security.Cryptography.Aes'. +dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptorFactory[10] + Using managed keyed hash algorithm 'System.Security.Cryptography.HMACSHA256'. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingProvider[2] + Using key {c8147b66-2deb-407c-9421-1553f0e16d67} as the default key. +dbug: Microsoft.AspNetCore.DataProtection.Internal.DataProtectionStartupFilter[0] + Key ring with default key {c8147b66-2deb-407c-9421-1553f0e16d67} was loaded during application startup. +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[], CommandType='Text', CommandTimeout='30'] + + SELECT CASE WHEN COUNT(*) = 0 THEN FALSE ELSE TRUE END + FROM information_schema.tables + WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema') +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + + SELECT CASE WHEN COUNT(*) = 0 THEN FALSE ELSE TRUE END + FROM information_schema.tables + WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema') +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[3] + Hosting starting +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[4] + Hosting started +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[0] + Loaded hosting startup assembly JsonApiDotNetCoreExample +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 GET http://localhost/api/v1/todo-items?include=owner +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 GET http://localhost/api/v1/todo-items?include=owner +dbug: Microsoft.AspNetCore.Routing.Tree.TreeRouter[1] + Request successfully matched the route with name '(null)' and template 'api/v1/todo-items'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.TodoItemsController.PostAsync (JsonApiDotNetCoreExample)' with id '5d8ec96c-5e08-48d8-8af5-20d91d1acfd0' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) with arguments ((null)) - ModelState is Valid +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) with arguments ((null)) - ModelState is Valid +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +warn: Microsoft.EntityFrameworkCore.Query[10106] + The Include operation for navigation '[_2].Owner' is unnecessary and was ignored because the navigation is not reachable in the final query results. See https://go.microsoft.com/fwlink/?linkid=850303 for more information. +dbug: Microsoft.EntityFrameworkCore.Query[10101] + Compiling query model: + '(from TodoItem _2 in DbSet + select [_2]) + .Include("Owner") + .Count()' +warn: Microsoft.EntityFrameworkCore.Query[10106] + The Include operation for navigation '[_2].Owner' is unnecessary and was ignored because the navigation is not reachable in the final query results. See https://go.microsoft.com/fwlink/?linkid=850303 for more information. +dbug: Microsoft.EntityFrameworkCore.Query[10104] + Optimized query model: + '(from TodoItem _2 in DbSet + select [_2]).Count()' +dbug: Microsoft.EntityFrameworkCore.Query[10107] + (QueryContext queryContext) => IAsyncEnumerable _InterceptExceptions( + source: IAsyncEnumerable _ToSequence(Task GetResult( + valueBuffers: IAsyncEnumerable _Query( + queryContext: queryContext, + shaperCommandContext: SelectExpression: + SELECT COUNT(*)::INT4 + FROM "TodoItems" AS "t"), + throwOnNullResult: False, + cancellationToken: queryContext.CancellationToken)), + contextType: JsonApiDotNetCoreExample.Data.AppDbContext, + logger: DiagnosticsLogger, + queryContext: queryContext) +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[], CommandType='Text', CommandTimeout='30'] + SELECT COUNT(*)::INT4 + FROM "TodoItems" AS "t" +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (3ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + SELECT COUNT(*)::INT4 + FROM "TodoItems" AS "t" +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (3ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + SELECT COUNT(*)::INT4 + FROM "TodoItems" AS "t" +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +info: JsonApiDotNetCore.Services.EntityResourceService[0] + Applying paging query. Fetching page 0 with 5 entities +dbug: Microsoft.EntityFrameworkCore.Query[10101] + Compiling query model: + '(from TodoItem _3 in DbSet + select [_3]) + .Include("Owner") + .Skip(__p_0) + .Take(__p_1)' +warn: Microsoft.EntityFrameworkCore.Query[10102] + Query: '(from TodoItem _3 in DbSet select [_3]).Skip(__p_0).Take(__p_1)' uses a row limiting operation (Skip/Take) without OrderBy which may lead to unpredictable results. +warn: Microsoft.EntityFrameworkCore.Query[10102] + Query: '(from TodoItem _3 in DbSet select [_3]).Skip(__p_0).Take(__p_1)' uses a row limiting operation (Skip/Take) without OrderBy which may lead to unpredictable results. +dbug: Microsoft.EntityFrameworkCore.Query[10105] + Including navigation: '[_3].Owner' +dbug: Microsoft.EntityFrameworkCore.Query[10104] + Optimized query model: + '(from TodoItem _3 in DbSet + join Person t.Owner in DbSet + on Property([_3], "OwnerId") equals (Nullable)Property([t.Owner], "Id") into t.Owner_group + from Person t.Owner in + (from Person t.Owner_groupItem in [t.Owner_group] + select [t.Owner_groupItem]).DefaultIfEmpty() + select TodoItem _Include( + queryContext: queryContext, + entity: [_3], + included: new object[]{ [t.Owner] }, + fixup: (QueryContext queryContext | TodoItem entity | Object[] included) => + { + Void queryContext.QueryBuffer.StartTracking( + entity: entity, + entityType: EntityType: TodoItem) + return !(bool ReferenceEquals(included[0], null)) ? + { + Void queryContext.QueryBuffer.StartTracking( + entity: included[0], + entityType: EntityType: Person) + Void SetRelationshipSnapshotValue( + stateManager: queryContext.StateManager, + navigation: TodoItem.Owner, + entity: entity, + value: included[0]) + return Void AddToCollectionSnapshot( + stateManager: queryContext.StateManager, + navigation: Person.TodoItems, + entity: included[0], + value: entity) + } + : default(Void) + } + )) + .Skip(__p_0) + .Take(__p_1)' +dbug: Microsoft.EntityFrameworkCore.Query[10107] + (QueryContext queryContext) => IAsyncEnumerable _InterceptExceptions( + source: IAsyncEnumerable _TrackEntities( + results: IAsyncEnumerable _Select( + source: IAsyncEnumerable> _ShapedQuery( + queryContext: queryContext, + shaperCommandContext: SelectExpression: + SELECT "t"."Id", "t"."AchievedDate", "t"."AssigneeId", "t"."CollectionId", "t"."CreatedDate", "t"."Description", "t"."GuidProperty", "t"."Ordinal", "t"."OwnerId", "t.Owner"."Id", "t.Owner"."FirstName", "t.Owner"."LastName" + FROM "TodoItems" AS "t" + LEFT JOIN "People" AS "t.Owner" ON "t"."OwnerId" = "t.Owner"."Id" + LIMIT @__p_1 OFFSET @__p_0, + shaper: TypedCompositeShaper, TodoItem, BufferedOffsetEntityShaper, Person, TransparentIdentifier>), + selector: (TransparentIdentifier t1) => TodoItem _Include( + queryContext: queryContext, + entity: t1.Outer, + included: new object[]{ t1.Inner }, + fixup: (QueryContext queryContext | TodoItem entity | Object[] included) => + { + Void queryContext.QueryBuffer.StartTracking( + entity: entity, + entityType: EntityType: TodoItem) + return !(bool ReferenceEquals(included[0], null)) ? + { + Void queryContext.QueryBuffer.StartTracking( + entity: included[0], + entityType: EntityType: Person) + Void SetRelationshipSnapshotValue( + stateManager: queryContext.StateManager, + navigation: TodoItem.Owner, + entity: entity, + value: included[0]) + return Void AddToCollectionSnapshot( + stateManager: queryContext.StateManager, + navigation: Person.TodoItems, + entity: included[0], + value: entity) + } + : default(Void) + } + )), + queryContext: Unhandled parameter: queryContext, + entityTrackingInfos: { itemType: TodoItem }, + entityAccessors: List> + { + Func, + } + ), + contextType: JsonApiDotNetCoreExample.Data.AppDbContext, + logger: DiagnosticsLogger, + queryContext: Unhandled parameter: queryContext) +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@__p_1='?', @__p_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "t"."Id", "t"."AchievedDate", "t"."AssigneeId", "t"."CollectionId", "t"."CreatedDate", "t"."Description", "t"."GuidProperty", "t"."Ordinal", "t"."OwnerId", "t.Owner"."Id", "t.Owner"."FirstName", "t.Owner"."LastName" + FROM "TodoItems" AS "t" + LEFT JOIN "People" AS "t.Owner" ON "t"."OwnerId" = "t.Owner"."Id" + LIMIT @__p_1 OFFSET @__p_0 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@__p_1='?', @__p_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "t"."Id", "t"."AchievedDate", "t"."AssigneeId", "t"."CollectionId", "t"."CreatedDate", "t"."Description", "t"."GuidProperty", "t"."Ordinal", "t"."OwnerId", "t.Owner"."Id", "t.Owner"."FirstName", "t.Owner"."LastName" + FROM "TodoItems" AS "t" + LEFT JOIN "People" AS "t.Owner" ON "t"."OwnerId" = "t.Owner"."Id" + LIMIT @__p_1 OFFSET @__p_0 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@__p_1='?', @__p_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "t"."Id", "t"."AchievedDate", "t"."AssigneeId", "t"."CollectionId", "t"."CreatedDate", "t"."Description", "t"."GuidProperty", "t"."Ordinal", "t"."OwnerId", "t.Owner"."Id", "t.Owner"."FirstName", "t.Owner"."LastName" + FROM "TodoItems" AS "t" + LEFT JOIN "People" AS "t.Owner" ON "t"."OwnerId" = "t.Owner"."Id" + LIMIT @__p_1 OFFSET @__p_0 +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample), returned result Microsoft.AspNetCore.Mvc.OkObjectResult. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[4] + No information found on request to perform content negotiation. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[2] + Selected output formatter 'JsonApiDotNetCore.Formatters.JsonApiOutputFormatter' and content type '' to write the response. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: JsonApiDotNetCore.Formatters.JsonApiWriter[0] + Formatting response as JSONAPI +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) in 76.304ms +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) in 76.304ms +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 96.232ms 200 application/vnd.api+json +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 96.232ms 200 application/vnd.api+json +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[], CommandType='Text', CommandTimeout='30'] + SELECT "t"."Id", "t"."AchievedDate", "t"."AssigneeId", "t"."CollectionId", "t"."CreatedDate", "t"."Description", "t"."GuidProperty", "t"."Ordinal", "t"."OwnerId" + FROM "TodoItems" AS "t" +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + SELECT "t"."Id", "t"."AchievedDate", "t"."AssigneeId", "t"."CollectionId", "t"."CreatedDate", "t"."Description", "t"."GuidProperty", "t"."Ordinal", "t"."OwnerId" + FROM "TodoItems" AS "t" +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + SELECT "t"."Id", "t"."AchievedDate", "t"."AssigneeId", "t"."CollectionId", "t"."CreatedDate", "t"."Description", "t"."GuidProperty", "t"."Ordinal", "t"."OwnerId" + FROM "TodoItems" AS "t" +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20200] + Beginning transaction with isolation level 'ReadCommitted'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "People" ("FirstName", "LastName") + VALUES (@p0, @p1) + RETURNING "Id"; + DELETE FROM "TodoItems" + WHERE "Id" = @p2; + DELETE FROM "TodoItems" + WHERE "Id" = @p3; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "People" ("FirstName", "LastName") + VALUES (@p0, @p1) + RETURNING "Id"; + DELETE FROM "TodoItems" + WHERE "Id" = @p2; + DELETE FROM "TodoItems" + WHERE "Id" = @p3; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "People" ("FirstName", "LastName") + VALUES (@p0, @p1) + RETURNING "Id"; + DELETE FROM "TodoItems" + WHERE "Id" = @p2; + DELETE FROM "TodoItems" + WHERE "Id" = @p3; +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@p4='?', @p5='?', @p6='?', @p7='?', @p8='?', @p9='?', @p10='?', @p11='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p4, @p5, @p6, @p7, @p8, @p9, @p10, @p11) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (0ms) [Parameters=[@p4='?', @p5='?', @p6='?', @p7='?', @p8='?', @p9='?', @p10='?', @p11='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p4, @p5, @p6, @p7, @p8, @p9, @p10, @p11) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (0ms) [Parameters=[@p4='?', @p5='?', @p6='?', @p7='?', @p8='?', @p9='?', @p10='?', @p11='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p4, @p5, @p6, @p7, @p8, @p9, @p10, @p11) + RETURNING "Id"; +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20202] + Committing transaction. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20204] + Disposing transaction. +dbug: Microsoft.EntityFrameworkCore.Infrastructure[10401] + An 'IServiceProvider' was created for internal use by Entity Framework. +warn: Microsoft.EntityFrameworkCore.Infrastructure[10402] + More than twenty 'IServiceProvider' instances have been created for internal use by Entity Framework. Consider reviewing calls on 'DbContextOptionsBuilder' that may require new service providers to be built. +info: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[0] + User profile is available. Using '/Users/jarednance/.aspnet/DataProtection-Keys' as key repository; keys will not be encrypted at rest. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-b040dd03-33c5-451e-8f42-3c9dd4e0dfec.xml'. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-c8147b66-2deb-407c-9421-1553f0e16d67.xml'. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-f7fa4a09-6d65-426e-a653-cbd2969e5073.xml'. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {b040dd03-33c5-451e-8f42-3c9dd4e0dfec}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {c8147b66-2deb-407c-9421-1553f0e16d67}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {f7fa4a09-6d65-426e-a653-cbd2969e5073}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.DefaultKeyResolver[13] + Considering key {c8147b66-2deb-407c-9421-1553f0e16d67} with expiration date 2018-03-03 16:22:35Z as default key. +dbug: Microsoft.AspNetCore.DataProtection.TypeForwardingActivator[0] + Forwarded activator type request from Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Version=1.1.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60 to Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Culture=neutral, PublicKeyToken=adb9793829ddae60 +dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptorFactory[11] + Using managed symmetric algorithm 'System.Security.Cryptography.Aes'. +dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptorFactory[10] + Using managed keyed hash algorithm 'System.Security.Cryptography.HMACSHA256'. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingProvider[2] + Using key {c8147b66-2deb-407c-9421-1553f0e16d67} as the default key. +dbug: Microsoft.AspNetCore.DataProtection.Internal.DataProtectionStartupFilter[0] + Key ring with default key {c8147b66-2deb-407c-9421-1553f0e16d67} was loaded during application startup. +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[], CommandType='Text', CommandTimeout='30'] + + SELECT CASE WHEN COUNT(*) = 0 THEN FALSE ELSE TRUE END + FROM information_schema.tables + WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema') +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (2ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + + SELECT CASE WHEN COUNT(*) = 0 THEN FALSE ELSE TRUE END + FROM information_schema.tables + WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema') +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[3] + Hosting starting +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[4] + Hosting started +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[0] + Loaded hosting startup assembly JsonApiDotNetCoreExample +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 GET http://localhost/api/v1/todo-items?include=owner +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 GET http://localhost/api/v1/todo-items?include=owner +dbug: Microsoft.AspNetCore.Routing.Tree.TreeRouter[1] + Request successfully matched the route with name '(null)' and template 'api/v1/todo-items'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.TodoItemsController.PostAsync (JsonApiDotNetCoreExample)' with id '5b834c60-041f-4099-83c5-05901ad2c3a8' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) with arguments ((null)) - ModelState is Valid +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) with arguments ((null)) - ModelState is Valid +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Query[10101] + Compiling query model: + '(from TodoItem _2 in DbSet + select [_2]) + .Include("Owner") + .Count()' +warn: Microsoft.EntityFrameworkCore.Query[10106] + The Include operation for navigation '[_2].Owner' is unnecessary and was ignored because the navigation is not reachable in the final query results. See https://go.microsoft.com/fwlink/?linkid=850303 for more information. +warn: Microsoft.EntityFrameworkCore.Query[10106] + The Include operation for navigation '[_2].Owner' is unnecessary and was ignored because the navigation is not reachable in the final query results. See https://go.microsoft.com/fwlink/?linkid=850303 for more information. +dbug: Microsoft.EntityFrameworkCore.Query[10104] + Optimized query model: + '(from TodoItem _2 in DbSet + select [_2]).Count()' +dbug: Microsoft.EntityFrameworkCore.Query[10107] + (QueryContext queryContext) => IAsyncEnumerable _InterceptExceptions( + source: IAsyncEnumerable _ToSequence(Task GetResult( + valueBuffers: IAsyncEnumerable _Query( + queryContext: queryContext, + shaperCommandContext: SelectExpression: + SELECT COUNT(*)::INT4 + FROM "TodoItems" AS "t"), + throwOnNullResult: False, + cancellationToken: queryContext.CancellationToken)), + contextType: JsonApiDotNetCoreExample.Data.AppDbContext, + logger: DiagnosticsLogger, + queryContext: queryContext) +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[], CommandType='Text', CommandTimeout='30'] + SELECT COUNT(*)::INT4 + FROM "TodoItems" AS "t" +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + SELECT COUNT(*)::INT4 + FROM "TodoItems" AS "t" +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + SELECT COUNT(*)::INT4 + FROM "TodoItems" AS "t" +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +info: JsonApiDotNetCore.Services.EntityResourceService[0] + Applying paging query. Fetching page 0 with 5 entities +dbug: Microsoft.EntityFrameworkCore.Query[10101] + Compiling query model: + '(from TodoItem _3 in DbSet + select [_3]) + .Include("Owner") + .Skip(__p_0) + .Take(__p_1)' +warn: Microsoft.EntityFrameworkCore.Query[10102] + Query: '(from TodoItem _3 in DbSet select [_3]).Skip(__p_0).Take(__p_1)' uses a row limiting operation (Skip/Take) without OrderBy which may lead to unpredictable results. +warn: Microsoft.EntityFrameworkCore.Query[10102] + Query: '(from TodoItem _3 in DbSet select [_3]).Skip(__p_0).Take(__p_1)' uses a row limiting operation (Skip/Take) without OrderBy which may lead to unpredictable results. +dbug: Microsoft.EntityFrameworkCore.Query[10105] + Including navigation: '[_3].Owner' +dbug: Microsoft.EntityFrameworkCore.Query[10104] + Optimized query model: + '(from TodoItem _3 in DbSet + join Person t.Owner in DbSet + on Property([_3], "OwnerId") equals (Nullable)Property([t.Owner], "Id") into t.Owner_group + from Person t.Owner in + (from Person t.Owner_groupItem in [t.Owner_group] + select [t.Owner_groupItem]).DefaultIfEmpty() + select TodoItem _Include( + queryContext: queryContext, + entity: [_3], + included: new object[]{ [t.Owner] }, + fixup: (QueryContext queryContext | TodoItem entity | Object[] included) => + { + Void queryContext.QueryBuffer.StartTracking( + entity: entity, + entityType: EntityType: TodoItem) + return !(bool ReferenceEquals(included[0], null)) ? + { + Void queryContext.QueryBuffer.StartTracking( + entity: included[0], + entityType: EntityType: Person) + Void SetRelationshipSnapshotValue( + stateManager: queryContext.StateManager, + navigation: TodoItem.Owner, + entity: entity, + value: included[0]) + return Void AddToCollectionSnapshot( + stateManager: queryContext.StateManager, + navigation: Person.TodoItems, + entity: included[0], + value: entity) + } + : default(Void) + } + )) + .Skip(__p_0) + .Take(__p_1)' +dbug: Microsoft.EntityFrameworkCore.Query[10107] + (QueryContext queryContext) => IAsyncEnumerable _InterceptExceptions( + source: IAsyncEnumerable _TrackEntities( + results: IAsyncEnumerable _Select( + source: IAsyncEnumerable> _ShapedQuery( + queryContext: queryContext, + shaperCommandContext: SelectExpression: + SELECT "t"."Id", "t"."AchievedDate", "t"."AssigneeId", "t"."CollectionId", "t"."CreatedDate", "t"."Description", "t"."GuidProperty", "t"."Ordinal", "t"."OwnerId", "t.Owner"."Id", "t.Owner"."FirstName", "t.Owner"."LastName" + FROM "TodoItems" AS "t" + LEFT JOIN "People" AS "t.Owner" ON "t"."OwnerId" = "t.Owner"."Id" + LIMIT @__p_1 OFFSET @__p_0, + shaper: TypedCompositeShaper, TodoItem, BufferedOffsetEntityShaper, Person, TransparentIdentifier>), + selector: (TransparentIdentifier t1) => TodoItem _Include( + queryContext: queryContext, + entity: t1.Outer, + included: new object[]{ t1.Inner }, + fixup: (QueryContext queryContext | TodoItem entity | Object[] included) => + { + Void queryContext.QueryBuffer.StartTracking( + entity: entity, + entityType: EntityType: TodoItem) + return !(bool ReferenceEquals(included[0], null)) ? + { + Void queryContext.QueryBuffer.StartTracking( + entity: included[0], + entityType: EntityType: Person) + Void SetRelationshipSnapshotValue( + stateManager: queryContext.StateManager, + navigation: TodoItem.Owner, + entity: entity, + value: included[0]) + return Void AddToCollectionSnapshot( + stateManager: queryContext.StateManager, + navigation: Person.TodoItems, + entity: included[0], + value: entity) + } + : default(Void) + } + )), + queryContext: Unhandled parameter: queryContext, + entityTrackingInfos: { itemType: TodoItem }, + entityAccessors: List> + { + Func, + } + ), + contextType: JsonApiDotNetCoreExample.Data.AppDbContext, + logger: DiagnosticsLogger, + queryContext: Unhandled parameter: queryContext) +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@__p_1='?', @__p_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "t"."Id", "t"."AchievedDate", "t"."AssigneeId", "t"."CollectionId", "t"."CreatedDate", "t"."Description", "t"."GuidProperty", "t"."Ordinal", "t"."OwnerId", "t.Owner"."Id", "t.Owner"."FirstName", "t.Owner"."LastName" + FROM "TodoItems" AS "t" + LEFT JOIN "People" AS "t.Owner" ON "t"."OwnerId" = "t.Owner"."Id" + LIMIT @__p_1 OFFSET @__p_0 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@__p_1='?', @__p_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "t"."Id", "t"."AchievedDate", "t"."AssigneeId", "t"."CollectionId", "t"."CreatedDate", "t"."Description", "t"."GuidProperty", "t"."Ordinal", "t"."OwnerId", "t.Owner"."Id", "t.Owner"."FirstName", "t.Owner"."LastName" + FROM "TodoItems" AS "t" + LEFT JOIN "People" AS "t.Owner" ON "t"."OwnerId" = "t.Owner"."Id" + LIMIT @__p_1 OFFSET @__p_0 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@__p_1='?', @__p_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "t"."Id", "t"."AchievedDate", "t"."AssigneeId", "t"."CollectionId", "t"."CreatedDate", "t"."Description", "t"."GuidProperty", "t"."Ordinal", "t"."OwnerId", "t.Owner"."Id", "t.Owner"."FirstName", "t.Owner"."LastName" + FROM "TodoItems" AS "t" + LEFT JOIN "People" AS "t.Owner" ON "t"."OwnerId" = "t.Owner"."Id" + LIMIT @__p_1 OFFSET @__p_0 +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample), returned result Microsoft.AspNetCore.Mvc.OkObjectResult. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[4] + No information found on request to perform content negotiation. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[2] + Selected output formatter 'JsonApiDotNetCore.Formatters.JsonApiOutputFormatter' and content type '' to write the response. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: JsonApiDotNetCore.Formatters.JsonApiWriter[0] + Formatting response as JSONAPI +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) in 80.648ms +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) in 80.648ms +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 100.942ms 200 application/vnd.api+json +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 100.942ms 200 application/vnd.api+json +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Query[10101] + Compiling query model: + '(from Person _1 in DbSet + select [_1]).First()' +warn: Microsoft.EntityFrameworkCore.Query[10103] + Query: '(from Person _1 in DbSet select [_1]).First()' uses First/FirstOrDefault operation without OrderBy and filter which may lead to unpredictable results. +warn: Microsoft.EntityFrameworkCore.Query[10103] + Query: '(from Person _1 in DbSet select [_1]).First()' uses First/FirstOrDefault operation without OrderBy and filter which may lead to unpredictable results. +dbug: Microsoft.EntityFrameworkCore.Query[10104] + Optimized query model: + '(from Person _1 in DbSet + select [_1]).First()' +dbug: Microsoft.EntityFrameworkCore.Query[10107] + (QueryContext queryContext) => IEnumerable _InterceptExceptions( + source: IEnumerable _TrackEntities( + results: IEnumerable _ToSequence(Person First(IEnumerable _ShapedQuery( + queryContext: queryContext, + shaperCommandContext: SelectExpression: + SELECT "p"."Id", "p"."FirstName", "p"."LastName" + FROM "People" AS "p" + LIMIT 1, + shaper: UnbufferedEntityShaper))), + queryContext: queryContext, + entityTrackingInfos: { itemType: Person }, + entityAccessors: List> + { + Func, + } + ), + contextType: JsonApiDotNetCoreExample.Data.AppDbContext, + logger: DiagnosticsLogger, + queryContext: queryContext) +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[], CommandType='Text', CommandTimeout='30'] + SELECT "p"."Id", "p"."FirstName", "p"."LastName" + FROM "People" AS "p" + LIMIT 1 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + SELECT "p"."Id", "p"."FirstName", "p"."LastName" + FROM "People" AS "p" + LIMIT 1 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + SELECT "p"."Id", "p"."FirstName", "p"."LastName" + FROM "People" AS "p" + LIMIT 1 +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Infrastructure[10401] + An 'IServiceProvider' was created for internal use by Entity Framework. +warn: Microsoft.EntityFrameworkCore.Infrastructure[10402] + More than twenty 'IServiceProvider' instances have been created for internal use by Entity Framework. Consider reviewing calls on 'DbContextOptionsBuilder' that may require new service providers to be built. +: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[0] + User profile is available. Using '/Users/jarednance/.aspnet/DataProtection-Keys' as key repository; keys will not be encrypted at rest. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-b040dd03-33c5-451e-8f42-3c9dd4e0dfec.xml'. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-c8147b66-2deb-407c-9421-1553f0e16d67.xml'. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-f7fa4a09-6d65-426e-a653-cbd2969e5073.xml'. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {b040dd03-33c5-451e-8f42-3c9dd4e0dfec}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {c8147b66-2deb-407c-9421-1553f0e16d67}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {f7fa4a09-6d65-426e-a653-cbd2969e5073}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.DefaultKeyResolver[13] + Considering key {c8147b66-2deb-407c-9421-1553f0e16d67} with expiration date 2018-03-03 16:22:35Z as default key. +dbug: Microsoft.AspNetCore.DataProtection.TypeForwardingActivator[0] + Forwarded activator type request from Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Version=1.1.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60 to Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Culture=neutral, PublicKeyToken=adb9793829ddae60 +dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptorFactory[11] + Using managed symmetric algorithm 'System.Security.Cryptography.Aes'. +dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptorFactory[10] + Using managed keyed hash algorithm 'System.Security.Cryptography.HMACSHA256'. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingProvider[2] + Using key {c8147b66-2deb-407c-9421-1553f0e16d67} as the default key. +dbug: Microsoft.AspNetCore.DataProtection.Internal.DataProtectionStartupFilter[0] + Key ring with default key {c8147b66-2deb-407c-9421-1553f0e16d67} was loaded during application startup. +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[], CommandType='Text', CommandTimeout='30'] + + SELECT CASE WHEN COUNT(*) = 0 THEN FALSE ELSE TRUE END + FROM information_schema.tables + WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema') +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + + SELECT CASE WHEN COUNT(*) = 0 THEN FALSE ELSE TRUE END + FROM information_schema.tables + WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema') +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[3] + Hosting starting +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[4] + Hosting started +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[0] + Loaded hosting startup assembly JsonApiDotNetCoreExample +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 GET http://localhost/api/v1/people/888?include=non-existent-relationship +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 GET http://localhost/api/v1/people/888?include=non-existent-relationship +dbug: Microsoft.AspNetCore.Routing.Tree.TreeRouter[1] + Request successfully matched the route with name '(null)' and template 'api/v1/people/{id}'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.PeopleController.PatchAsync (JsonApiDotNetCoreExample)' with id 'e3d89928-9c88-496c-b73a-f712ea6b3a37' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.PeopleController.DeleteAsync (JsonApiDotNetCoreExample)' with id '0564ca1d-138d-4994-89ff-4c633b77efa6' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action JsonApiDotNetCoreExample.Controllers.PeopleController.GetAsync (JsonApiDotNetCoreExample) +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.PeopleController.GetAsync (JsonApiDotNetCoreExample) with arguments (888) - ModelState is Valid +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.PeopleController.GetAsync (JsonApiDotNetCoreExample) with arguments (888) - ModelState is Valid +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +fail: JsonApiDotNetCore.Middleware.JsonApiExceptionFilter[0] + An unhandled exception occurred during the request +JsonApiDotNetCore.Internal.JsonApiException: Invalid relationship non-existent-relationship on people + at JsonApiDotNetCore.Data.DefaultEntityRepository`2.Include(IQueryable`1 entities, String relationshipName) in /Users/jarednance/dev/json-api-dotnet-core/src/JsonApiDotNetCore/Data/DefaultEntityRepository.cs:line 139 + at JsonApiDotNetCore.Services.EntityResourceService`2.<>c__DisplayClass7_0.b__0(String r) in /Users/jarednance/dev/json-api-dotnet-core/src/JsonApiDotNetCore/Services/EntityResourceService.cs:line 77 + at System.Collections.Generic.List`1.ForEach(Action`1 action) + at JsonApiDotNetCore.Services.EntityResourceService`2.d__7.MoveNext() in /Users/jarednance/dev/json-api-dotnet-core/src/JsonApiDotNetCore/Services/EntityResourceService.cs:line 75 +--- End of stack trace from previous location where exception was thrown --- + at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) + at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult() + at JsonApiDotNetCore.Services.EntityResourceService`2.d__5.MoveNext() in /Users/jarednance/dev/json-api-dotnet-core/src/JsonApiDotNetCore/Services/EntityResourceService.cs:line 63 +--- End of stack trace from previous location where exception was thrown --- + at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) + at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult() + at JsonApiDotNetCore.Controllers.BaseJsonApiController`2.d__13.MoveNext() in /Users/jarednance/dev/json-api-dotnet-core/src/JsonApiDotNetCore/Controllers/BaseJsonApiController.cs:line 118 +--- End of stack trace from previous location where exception was thrown --- + at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) + at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult() + at JsonApiDotNetCore.Controllers.JsonApiController`2.d__4.MoveNext() in /Users/jarednance/dev/json-api-dotnet-core/src/JsonApiDotNetCore/Controllers/JsonApiController.cs:line 65 +--- End of stack trace from previous location where exception was thrown --- + at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) + at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.d__12.MoveNext() +--- End of stack trace from previous location where exception was thrown --- + at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) + at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.d__10.MoveNext() +--- End of stack trace from previous location where exception was thrown --- + at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Rethrow(ActionExecutedContext context) + at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) + at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.d__14.MoveNext() +--- End of stack trace from previous location where exception was thrown --- + at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) + at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.d__23.MoveNext() +fail: JsonApiDotNetCore.Middleware.JsonApiExceptionFilter[0] + An unhandled exception occurred during the request +JsonApiDotNetCore.Internal.JsonApiException: Invalid relationship non-existent-relationship on people + at JsonApiDotNetCore.Data.DefaultEntityRepository`2.Include(IQueryable`1 entities, String relationshipName) in /Users/jarednance/dev/json-api-dotnet-core/src/JsonApiDotNetCore/Data/DefaultEntityRepository.cs:line 139 + at JsonApiDotNetCore.Services.EntityResourceService`2.<>c__DisplayClass7_0.b__0(String r) in /Users/jarednance/dev/json-api-dotnet-core/src/JsonApiDotNetCore/Services/EntityResourceService.cs:line 77 + at System.Collections.Generic.List`1.ForEach(Action`1 action) + at JsonApiDotNetCore.Services.EntityResourceService`2.d__7.MoveNext() in /Users/jarednance/dev/json-api-dotnet-core/src/JsonApiDotNetCore/Services/EntityResourceService.cs:line 75 +--- End of stack trace from previous location where exception was thrown --- + at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) + at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult() + at JsonApiDotNetCore.Services.EntityResourceService`2.d__5.MoveNext() in /Users/jarednance/dev/json-api-dotnet-core/src/JsonApiDotNetCore/Services/EntityResourceService.cs:line 63 +--- End of stack trace from previous location where exception was thrown --- + at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) + at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult() + at JsonApiDotNetCore.Controllers.BaseJsonApiController`2.d__13.MoveNext() in /Users/jarednance/dev/json-api-dotnet-core/src/JsonApiDotNetCore/Controllers/BaseJsonApiController.cs:line 118 +--- End of stack trace from previous location where exception was thrown --- + at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) + at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult() + at JsonApiDotNetCore.Controllers.JsonApiController`2.d__4.MoveNext() in /Users/jarednance/dev/json-api-dotnet-core/src/JsonApiDotNetCore/Controllers/JsonApiController.cs:line 65 +--- End of stack trace from previous location where exception was thrown --- + at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) + at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.d__12.MoveNext() +--- End of stack trace from previous location where exception was thrown --- + at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) + at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.d__10.MoveNext() +--- End of stack trace from previous location where exception was thrown --- + at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Rethrow(ActionExecutedContext context) + at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) + at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.d__14.MoveNext() +--- End of stack trace from previous location where exception was thrown --- + at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) + at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.d__23.MoveNext() +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[4] + No information found on request to perform content negotiation. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[2] + Selected output formatter 'JsonApiDotNetCore.Formatters.JsonApiOutputFormatter' and content type '' to write the response. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: JsonApiDotNetCore.Formatters.JsonApiWriter[0] + Formatting response as JSONAPI +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.PeopleController.GetAsync (JsonApiDotNetCoreExample) in 14.734ms +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.PeopleController.GetAsync (JsonApiDotNetCoreExample) in 14.734ms +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 32.884ms 400 application/vnd.api+json +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 32.884ms 400 application/vnd.api+json +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20200] + Beginning transaction with isolation level 'ReadCommitted'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@p0='?', @p1='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "People" ("FirstName", "LastName") + VALUES (@p0, @p1) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p0='?', @p1='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "People" ("FirstName", "LastName") + VALUES (@p0, @p1) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p0='?', @p1='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "People" ("FirstName", "LastName") + VALUES (@p0, @p1) + RETURNING "Id"; +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?', @p8='?', @p9='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p2, @p3, @p4, @p5, @p6, @p7, @p8, @p9) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?', @p8='?', @p9='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p2, @p3, @p4, @p5, @p6, @p7, @p8, @p9) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?', @p8='?', @p9='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p2, @p3, @p4, @p5, @p6, @p7, @p8, @p9) + RETURNING "Id"; +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20202] + Committing transaction. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20204] + Disposing transaction. +dbug: Microsoft.EntityFrameworkCore.Infrastructure[10401] + An 'IServiceProvider' was created for internal use by Entity Framework. +warn: Microsoft.EntityFrameworkCore.Infrastructure[10402] + More than twenty 'IServiceProvider' instances have been created for internal use by Entity Framework. Consider reviewing calls on 'DbContextOptionsBuilder' that may require new service providers to be built. +info: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[0] + User profile is available. Using '/Users/jarednance/.aspnet/DataProtection-Keys' as key repository; keys will not be encrypted at rest. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-b040dd03-33c5-451e-8f42-3c9dd4e0dfec.xml'. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-c8147b66-2deb-407c-9421-1553f0e16d67.xml'. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-f7fa4a09-6d65-426e-a653-cbd2969e5073.xml'. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {b040dd03-33c5-451e-8f42-3c9dd4e0dfec}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {c8147b66-2deb-407c-9421-1553f0e16d67}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {f7fa4a09-6d65-426e-a653-cbd2969e5073}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.DefaultKeyResolver[13] + Considering key {c8147b66-2deb-407c-9421-1553f0e16d67} with expiration date 2018-03-03 16:22:35Z as default key. +dbug: Microsoft.AspNetCore.DataProtection.TypeForwardingActivator[0] + Forwarded activator type request from Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Version=1.1.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60 to Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Culture=neutral, PublicKeyToken=adb9793829ddae60 +dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptorFactory[11] + Using managed symmetric algorithm 'System.Security.Cryptography.Aes'. +dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptorFactory[10] + Using managed keyed hash algorithm 'System.Security.Cryptography.HMACSHA256'. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingProvider[2] + Using key {c8147b66-2deb-407c-9421-1553f0e16d67} as the default key. +dbug: Microsoft.AspNetCore.DataProtection.Internal.DataProtectionStartupFilter[0] + Key ring with default key {c8147b66-2deb-407c-9421-1553f0e16d67} was loaded during application startup. +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[], CommandType='Text', CommandTimeout='30'] + + SELECT CASE WHEN COUNT(*) = 0 THEN FALSE ELSE TRUE END + FROM information_schema.tables + WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema') +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (3ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + + SELECT CASE WHEN COUNT(*) = 0 THEN FALSE ELSE TRUE END + FROM information_schema.tables + WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema') +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[3] + Hosting starting +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[4] + Hosting started +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[0] + Loaded hosting startup assembly JsonApiDotNetCoreExample +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 GET http://localhost/api/v1/todo-items/2622?include=owner +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 GET http://localhost/api/v1/todo-items/2622?include=owner +dbug: Microsoft.AspNetCore.Routing.Tree.TreeRouter[1] + Request successfully matched the route with name '(null)' and template 'api/v1/todo-items/{id}'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.TodoItemsController.PatchAsync (JsonApiDotNetCoreExample)' with id '2e60476c-d745-4d1d-9734-3048cf0e06f7' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.TodoItemsController.DeleteAsync (JsonApiDotNetCoreExample)' with id '892e3c0c-6a62-4b84-bc3b-630712d4abda' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) with arguments (2622) - ModelState is Valid +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) with arguments (2622) - ModelState is Valid +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Query[10101] + Compiling query model: + '(from TodoItem e in DbSet + where bool [e].Id.Equals((object)__id_0) + select [e]) + .Include("Owner") + .FirstOrDefault()' +dbug: Microsoft.EntityFrameworkCore.Query[10105] + Including navigation: '[e].Owner' +dbug: Microsoft.EntityFrameworkCore.Query[10104] + Optimized query model: + '(from TodoItem e in DbSet + join Person e.Owner in DbSet + on Property([e], "OwnerId") equals (Nullable)Property([e.Owner], "Id") into e.Owner_group + from Person e.Owner in + (from Person e.Owner_groupItem in [e.Owner_group] + select [e.Owner_groupItem]).DefaultIfEmpty() + where bool [e].Id.Equals((object)__id_0) + select TodoItem _Include( + queryContext: queryContext, + entity: [e], + included: new object[]{ [e.Owner] }, + fixup: (QueryContext queryContext | TodoItem entity | Object[] included) => + { + Void queryContext.QueryBuffer.StartTracking( + entity: entity, + entityType: EntityType: TodoItem) + return !(bool ReferenceEquals(included[0], null)) ? + { + Void queryContext.QueryBuffer.StartTracking( + entity: included[0], + entityType: EntityType: Person) + Void SetRelationshipSnapshotValue( + stateManager: queryContext.StateManager, + navigation: TodoItem.Owner, + entity: entity, + value: included[0]) + return Void AddToCollectionSnapshot( + stateManager: queryContext.StateManager, + navigation: Person.TodoItems, + entity: included[0], + value: entity) + } + : default(Void) + } + )).FirstOrDefault()' +dbug: Microsoft.EntityFrameworkCore.Query[10107] + (QueryContext queryContext) => IAsyncEnumerable _InterceptExceptions( + source: IAsyncEnumerable _TrackEntities( + results: IAsyncEnumerable _ToSequence(Task FirstOrDefault( + source: IAsyncEnumerable _Select( + source: IAsyncEnumerable> _ShapedQuery( + queryContext: queryContext, + shaperCommandContext: SelectExpression: + SELECT "e"."Id", "e"."AchievedDate", "e"."AssigneeId", "e"."CollectionId", "e"."CreatedDate", "e"."Description", "e"."GuidProperty", "e"."Ordinal", "e"."OwnerId", "e.Owner"."Id", "e.Owner"."FirstName", "e.Owner"."LastName" + FROM "TodoItems" AS "e" + LEFT JOIN "People" AS "e.Owner" ON "e"."OwnerId" = "e.Owner"."Id" + WHERE "e"."Id" = @__id_0 + LIMIT 1, + shaper: TypedCompositeShaper, TodoItem, BufferedOffsetEntityShaper, Person, TransparentIdentifier>), + selector: (TransparentIdentifier t1) => TodoItem _Include( + queryContext: queryContext, + entity: t1.Outer, + included: new object[]{ t1.Inner }, + fixup: (QueryContext queryContext | TodoItem entity | Object[] included) => + { + Void queryContext.QueryBuffer.StartTracking( + entity: entity, + entityType: EntityType: TodoItem) + return !(bool ReferenceEquals(included[0], null)) ? + { + Void queryContext.QueryBuffer.StartTracking( + entity: included[0], + entityType: EntityType: Person) + Void SetRelationshipSnapshotValue( + stateManager: queryContext.StateManager, + navigation: TodoItem.Owner, + entity: entity, + value: included[0]) + return Void AddToCollectionSnapshot( + stateManager: queryContext.StateManager, + navigation: Person.TodoItems, + entity: included[0], + value: entity) + } + : default(Void) + } + )), + cancellationToken: Unhandled parameter: queryContext.CancellationToken)), + queryContext: Unhandled parameter: queryContext, + entityTrackingInfos: { itemType: TodoItem }, + entityAccessors: List> + { + Func, + } + ), + contextType: JsonApiDotNetCoreExample.Data.AppDbContext, + logger: DiagnosticsLogger, + queryContext: Unhandled parameter: queryContext) +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "e"."Id", "e"."AchievedDate", "e"."AssigneeId", "e"."CollectionId", "e"."CreatedDate", "e"."Description", "e"."GuidProperty", "e"."Ordinal", "e"."OwnerId", "e.Owner"."Id", "e.Owner"."FirstName", "e.Owner"."LastName" + FROM "TodoItems" AS "e" + LEFT JOIN "People" AS "e.Owner" ON "e"."OwnerId" = "e.Owner"."Id" + WHERE "e"."Id" = @__id_0 + LIMIT 1 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (2ms) [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "e"."Id", "e"."AchievedDate", "e"."AssigneeId", "e"."CollectionId", "e"."CreatedDate", "e"."Description", "e"."GuidProperty", "e"."Ordinal", "e"."OwnerId", "e.Owner"."Id", "e.Owner"."FirstName", "e.Owner"."LastName" + FROM "TodoItems" AS "e" + LEFT JOIN "People" AS "e.Owner" ON "e"."OwnerId" = "e.Owner"."Id" + WHERE "e"."Id" = @__id_0 + LIMIT 1 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (2ms) [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "e"."Id", "e"."AchievedDate", "e"."AssigneeId", "e"."CollectionId", "e"."CreatedDate", "e"."Description", "e"."GuidProperty", "e"."Ordinal", "e"."OwnerId", "e.Owner"."Id", "e.Owner"."FirstName", "e.Owner"."LastName" + FROM "TodoItems" AS "e" + LEFT JOIN "People" AS "e.Owner" ON "e"."OwnerId" = "e.Owner"."Id" + WHERE "e"."Id" = @__id_0 + LIMIT 1 +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample), returned result Microsoft.AspNetCore.Mvc.OkObjectResult. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[4] + No information found on request to perform content negotiation. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[2] + Selected output formatter 'JsonApiDotNetCore.Formatters.JsonApiOutputFormatter' and content type '' to write the response. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: JsonApiDotNetCore.Formatters.JsonApiWriter[0] + Formatting response as JSONAPI +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) in 68.602ms +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) in 68.602ms +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 92.782ms 200 application/vnd.api+json +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 92.782ms 200 application/vnd.api+json +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20200] + Beginning transaction with isolation level 'ReadCommitted'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@p0='?', @p1='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "People" ("FirstName", "LastName") + VALUES (@p0, @p1) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p0='?', @p1='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "People" ("FirstName", "LastName") + VALUES (@p0, @p1) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p0='?', @p1='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "People" ("FirstName", "LastName") + VALUES (@p0, @p1) + RETURNING "Id"; +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?', @p8='?', @p9='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p2, @p3, @p4, @p5, @p6, @p7, @p8, @p9) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?', @p8='?', @p9='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p2, @p3, @p4, @p5, @p6, @p7, @p8, @p9) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?', @p8='?', @p9='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p2, @p3, @p4, @p5, @p6, @p7, @p8, @p9) + RETURNING "Id"; +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20202] + Committing transaction. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20204] + Disposing transaction. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20200] + Beginning transaction with isolation level 'ReadCommitted'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6, @p7) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6, @p7) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6, @p7) + RETURNING "Id"; +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20202] + Committing transaction. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20204] + Disposing transaction. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20200] + Beginning transaction with isolation level 'ReadCommitted'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6, @p7) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6, @p7) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6, @p7) + RETURNING "Id"; +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20202] + Committing transaction. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20204] + Disposing transaction. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20200] + Beginning transaction with isolation level 'ReadCommitted'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6, @p7) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6, @p7) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6, @p7) + RETURNING "Id"; +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20202] + Committing transaction. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20204] + Disposing transaction. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20200] + Beginning transaction with isolation level 'ReadCommitted'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6, @p7) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6, @p7) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6, @p7) + RETURNING "Id"; +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20202] + Committing transaction. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20204] + Disposing transaction. +dbug: Microsoft.EntityFrameworkCore.Infrastructure[10401] + An 'IServiceProvider' was created for internal use by Entity Framework. +warn: Microsoft.EntityFrameworkCore.Infrastructure[10402] + More than twenty 'IServiceProvider' instances have been created for internal use by Entity Framework. Consider reviewing calls on 'DbContextOptionsBuilder' that may require new service providers to be built. +info: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[0] + User profile is available. Using '/Users/jarednance/.aspnet/DataProtection-Keys' as key repository; keys will not be encrypted at rest. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-b040dd03-33c5-451e-8f42-3c9dd4e0dfec.xml'. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-c8147b66-2deb-407c-9421-1553f0e16d67.xml'. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-f7fa4a09-6d65-426e-a653-cbd2969e5073.xml'. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {b040dd03-33c5-451e-8f42-3c9dd4e0dfec}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {c8147b66-2deb-407c-9421-1553f0e16d67}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {f7fa4a09-6d65-426e-a653-cbd2969e5073}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.DefaultKeyResolver[13] + Considering key {c8147b66-2deb-407c-9421-1553f0e16d67} with expiration date 2018-03-03 16:22:35Z as default key. +dbug: Microsoft.AspNetCore.DataProtection.TypeForwardingActivator[0] + Forwarded activator type request from Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Version=1.1.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60 to Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Culture=neutral, PublicKeyToken=adb9793829ddae60 +dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptorFactory[11] + Using managed symmetric algorithm 'System.Security.Cryptography.Aes'. +dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptorFactory[10] + Using managed keyed hash algorithm 'System.Security.Cryptography.HMACSHA256'. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingProvider[2] + Using key {c8147b66-2deb-407c-9421-1553f0e16d67} as the default key. +dbug: Microsoft.AspNetCore.DataProtection.Internal.DataProtectionStartupFilter[0] + Key ring with default key {c8147b66-2deb-407c-9421-1553f0e16d67} was loaded during application startup. +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[], CommandType='Text', CommandTimeout='30'] + + SELECT CASE WHEN COUNT(*) = 0 THEN FALSE ELSE TRUE END + FROM information_schema.tables + WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema') +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (2ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + + SELECT CASE WHEN COUNT(*) = 0 THEN FALSE ELSE TRUE END + FROM information_schema.tables + WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema') +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[3] + Hosting starting +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[4] + Hosting started +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[0] + Loaded hosting startup assembly JsonApiDotNetCoreExample +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 GET http://localhost/api/v1/people/891?include=todo-items +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 GET http://localhost/api/v1/people/891?include=todo-items +dbug: Microsoft.AspNetCore.Routing.Tree.TreeRouter[1] + Request successfully matched the route with name '(null)' and template 'api/v1/people/{id}'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.PeopleController.PatchAsync (JsonApiDotNetCoreExample)' with id '422cb7bd-76e2-4921-a970-fd3b6e53cbc5' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.PeopleController.DeleteAsync (JsonApiDotNetCoreExample)' with id '704b8366-e2fb-4047-91ac-ef75d37aadf9' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action JsonApiDotNetCoreExample.Controllers.PeopleController.GetAsync (JsonApiDotNetCoreExample) +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.PeopleController.GetAsync (JsonApiDotNetCoreExample) with arguments (891) - ModelState is Valid +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.PeopleController.GetAsync (JsonApiDotNetCoreExample) with arguments (891) - ModelState is Valid +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Query[10101] + Compiling query model: + '(from Person e in DbSet + where bool [e].Id.Equals((object)__id_0) + select [e]) + .Include("TodoItems") + .FirstOrDefault()' +dbug: Microsoft.EntityFrameworkCore.Query[10105] + Including navigation: '[e].TodoItems' +dbug: Microsoft.EntityFrameworkCore.Query[10104] + Optimized query model: + '(from Person e in DbSet + where bool [e].Id.Equals((object)__id_0) + order by (Nullable)EF.Property(?[e]?, "Id") asc + select Task _IncludeAsync( + queryContext: queryContext, + entity: [e], + included: new object[]{ }, + fixup: (QueryContext queryContext | Person entity | Object[] included | CancellationToken ct) => + { + Void queryContext.QueryBuffer.StartTracking( + entity: entity, + entityType: EntityType: Person) + return Task queryContext.QueryBuffer.IncludeCollectionAsync( + includeId: 0, + navigation: Person.TodoItems, + inverseNavigation: TodoItem.Owner, + targetEntityType: EntityType: TodoItem, + clrCollectionAccessor: ClrICollectionAccessor, TodoItem>, + inverseClrPropertySetter: ClrPropertySetter, + tracking: True, + instance: entity, + valuesFactory: (Func>)() => + from TodoItem e.TodoItems in DbSet + join AnonymousObject _e in + (from Person e in DbSet + where bool [e].Id.Equals((object)__id_0) + order by (Nullable)EF.Property(?[e]?, "Id") asc + select new AnonymousObject(new object[]{ (object)EF.Property(?[e]?, "Id") })).Take(1) + on Property([e.TodoItems], "OwnerId") equals (Nullable)object [_e].GetValue(0) + order by object [_e].GetValue(0) asc + select [e.TodoItems], + cancellationToken: ct) + } + , + cancellationToken: ct).Result).FirstOrDefault()' +dbug: Microsoft.EntityFrameworkCore.Query[10107] + (QueryContext queryContext) => IAsyncEnumerable _InterceptExceptions( + source: IAsyncEnumerable _TrackEntities( + results: IAsyncEnumerable _ToSequence(Task FirstOrDefault( + source: IAsyncEnumerable _SelectAsync( + source: IAsyncEnumerable _ShapedQuery( + queryContext: queryContext, + shaperCommandContext: SelectExpression: + SELECT "e"."Id", "e"."FirstName", "e"."LastName" + FROM "People" AS "e" + WHERE "e"."Id" = @__id_0 + ORDER BY "e"."Id" + LIMIT 1, + shaper: BufferedEntityShaper), + selector: (Person e | CancellationToken ct) => Task _ExecuteAsync( + taskFactories: new Func>[]{ () => Task _ToObjectTask(Task _IncludeAsync( + queryContext: queryContext, + entity: e, + included: new object[]{ }, + fixup: (QueryContext queryContext | Person entity | Object[] included | CancellationToken ct) => + { + Void queryContext.QueryBuffer.StartTracking( + entity: entity, + entityType: EntityType: Person) + return Task queryContext.QueryBuffer.IncludeCollectionAsync( + includeId: 0, + navigation: Person.TodoItems, + inverseNavigation: TodoItem.Owner, + targetEntityType: EntityType: TodoItem, + clrCollectionAccessor: ClrICollectionAccessor, TodoItem>, + inverseClrPropertySetter: ClrPropertySetter, + tracking: True, + instance: entity, + valuesFactory: (Func>)() => IAsyncEnumerable _ShapedQuery( + queryContext: queryContext, + shaperCommandContext: SelectExpression: + SELECT "e.TodoItems"."Id", "e.TodoItems"."AchievedDate", "e.TodoItems"."AssigneeId", "e.TodoItems"."CollectionId", "e.TodoItems"."CreatedDate", "e.TodoItems"."Description", "e.TodoItems"."GuidProperty", "e.TodoItems"."Ordinal", "e.TodoItems"."OwnerId" + FROM "TodoItems" AS "e.TodoItems" + INNER JOIN ( + SELECT "e0"."Id" + FROM "People" AS "e0" + WHERE "e0"."Id" = @__id_0 + ORDER BY "e0"."Id" + LIMIT 1 + ) AS "t" ON "e.TodoItems"."OwnerId" = "t"."Id" + ORDER BY "t"."Id", + shaper: BufferedEntityShaper), + cancellationToken: ct) + } + , + cancellationToken: Unhandled parameter: ct)) }, + selector: (Object[] results) => (Person)results[0])), + cancellationToken: Unhandled parameter: queryContext.CancellationToken)), + queryContext: Unhandled parameter: queryContext, + entityTrackingInfos: { itemType: Person }, + entityAccessors: List> + { + Func, + } + ), + contextType: JsonApiDotNetCoreExample.Data.AppDbContext, + logger: DiagnosticsLogger, + queryContext: Unhandled parameter: queryContext) +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "e"."Id", "e"."FirstName", "e"."LastName" + FROM "People" AS "e" + WHERE "e"."Id" = @__id_0 + ORDER BY "e"."Id" + LIMIT 1 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "e"."Id", "e"."FirstName", "e"."LastName" + FROM "People" AS "e" + WHERE "e"."Id" = @__id_0 + ORDER BY "e"."Id" + LIMIT 1 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "e"."Id", "e"."FirstName", "e"."LastName" + FROM "People" AS "e" + WHERE "e"."Id" = @__id_0 + ORDER BY "e"."Id" + LIMIT 1 +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "e.TodoItems"."Id", "e.TodoItems"."AchievedDate", "e.TodoItems"."AssigneeId", "e.TodoItems"."CollectionId", "e.TodoItems"."CreatedDate", "e.TodoItems"."Description", "e.TodoItems"."GuidProperty", "e.TodoItems"."Ordinal", "e.TodoItems"."OwnerId" + FROM "TodoItems" AS "e.TodoItems" + INNER JOIN ( + SELECT "e0"."Id" + FROM "People" AS "e0" + WHERE "e0"."Id" = @__id_0 + ORDER BY "e0"."Id" + LIMIT 1 + ) AS "t" ON "e.TodoItems"."OwnerId" = "t"."Id" + ORDER BY "t"."Id" +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (5ms) [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "e.TodoItems"."Id", "e.TodoItems"."AchievedDate", "e.TodoItems"."AssigneeId", "e.TodoItems"."CollectionId", "e.TodoItems"."CreatedDate", "e.TodoItems"."Description", "e.TodoItems"."GuidProperty", "e.TodoItems"."Ordinal", "e.TodoItems"."OwnerId" + FROM "TodoItems" AS "e.TodoItems" + INNER JOIN ( + SELECT "e0"."Id" + FROM "People" AS "e0" + WHERE "e0"."Id" = @__id_0 + ORDER BY "e0"."Id" + LIMIT 1 + ) AS "t" ON "e.TodoItems"."OwnerId" = "t"."Id" + ORDER BY "t"."Id" +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (5ms) [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "e.TodoItems"."Id", "e.TodoItems"."AchievedDate", "e.TodoItems"."AssigneeId", "e.TodoItems"."CollectionId", "e.TodoItems"."CreatedDate", "e.TodoItems"."Description", "e.TodoItems"."GuidProperty", "e.TodoItems"."Ordinal", "e.TodoItems"."OwnerId" + FROM "TodoItems" AS "e.TodoItems" + INNER JOIN ( + SELECT "e0"."Id" + FROM "People" AS "e0" + WHERE "e0"."Id" = @__id_0 + ORDER BY "e0"."Id" + LIMIT 1 + ) AS "t" ON "e.TodoItems"."OwnerId" = "t"."Id" + ORDER BY "t"."Id" +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action method JsonApiDotNetCoreExample.Controllers.PeopleController.GetAsync (JsonApiDotNetCoreExample), returned result Microsoft.AspNetCore.Mvc.OkObjectResult. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[4] + No information found on request to perform content negotiation. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[2] + Selected output formatter 'JsonApiDotNetCore.Formatters.JsonApiOutputFormatter' and content type '' to write the response. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: JsonApiDotNetCore.Formatters.JsonApiWriter[0] + Formatting response as JSONAPI +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.PeopleController.GetAsync (JsonApiDotNetCoreExample) in 121.247ms +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.PeopleController.GetAsync (JsonApiDotNetCoreExample) in 121.247ms +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 140.619ms 200 application/vnd.api+json +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 140.619ms 200 application/vnd.api+json +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[], CommandType='Text', CommandTimeout='30'] + SELECT "p"."Id", "p"."FirstName", "p"."LastName" + FROM "People" AS "p" + LIMIT 1 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + SELECT "p"."Id", "p"."FirstName", "p"."LastName" + FROM "People" AS "p" + LIMIT 1 +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + SELECT "p"."Id", "p"."FirstName", "p"."LastName" + FROM "People" AS "p" + LIMIT 1 +dbug: Microsoft.EntityFrameworkCore.Infrastructure[10401] + An 'IServiceProvider' was created for internal use by Entity Framework. +warn: Microsoft.EntityFrameworkCore.Infrastructure[10402] + More than twenty 'IServiceProvider' instances have been created for internal use by Entity Framework. Consider reviewing calls on 'DbContextOptionsBuilder' that may require new service providers to be built. +info: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[0] + User profile is available. Using '/Users/jarednance/.aspnet/DataProtection-Keys' as key repository; keys will not be encrypted at rest. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-b040dd03-33c5-451e-8f42-3c9dd4e0dfec.xml'. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-c8147b66-2deb-407c-9421-1553f0e16d67.xml'. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-f7fa4a09-6d65-426e-a653-cbd2969e5073.xml'. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {b040dd03-33c5-451e-8f42-3c9dd4e0dfec}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {c8147b66-2deb-407c-9421-1553f0e16d67}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {f7fa4a09-6d65-426e-a653-cbd2969e5073}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.DefaultKeyResolver[13] + Considering key {c8147b66-2deb-407c-9421-1553f0e16d67} with expiration date 2018-03-03 16:22:35Z as default key. +dbug: Microsoft.AspNetCore.DataProtection.TypeForwardingActivator[0] + Forwarded activator type request from Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Version=1.1.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60 to Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Culture=neutral, PublicKeyToken=adb9793829ddae60 +dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptorFactory[11] + Using managed symmetric algorithm 'System.Security.Cryptography.Aes'. +dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptorFactory[10] + Using managed keyed hash algorithm 'System.Security.Cryptography.HMACSHA256'. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingProvider[2] + Using key {c8147b66-2deb-407c-9421-1553f0e16d67} as the default key. +dbug: Microsoft.AspNetCore.DataProtection.Internal.DataProtectionStartupFilter[0] + Key ring with default key {c8147b66-2deb-407c-9421-1553f0e16d67} was loaded during application startup. +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[], CommandType='Text', CommandTimeout='30'] + + SELECT CASE WHEN COUNT(*) = 0 THEN FALSE ELSE TRUE END + FROM information_schema.tables + WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema') +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (2ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + + SELECT CASE WHEN COUNT(*) = 0 THEN FALSE ELSE TRUE END + FROM information_schema.tables + WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema') +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[3] + Hosting starting +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[4] + Hosting started +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[0] + Loaded hosting startup assembly JsonApiDotNetCoreExample +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 GET http://localhost/api/v1/people/888?include=owner.name +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 GET http://localhost/api/v1/people/888?include=owner.name +dbug: Microsoft.AspNetCore.Routing.Tree.TreeRouter[1] + Request successfully matched the route with name '(null)' and template 'api/v1/people/{id}'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.PeopleController.PatchAsync (JsonApiDotNetCoreExample)' with id 'b46d9cb1-c51a-434d-9ecd-e4dd6d0d699f' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.PeopleController.DeleteAsync (JsonApiDotNetCoreExample)' with id '2deec43b-6907-4519-a36a-21a2dbd0b0f6' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action JsonApiDotNetCoreExample.Controllers.PeopleController.GetAsync (JsonApiDotNetCoreExample) +fail: JsonApiDotNetCore.Middleware.JsonApiExceptionFilter[0] + An unhandled exception occurred during the request +JsonApiDotNetCore.Internal.JsonApiException: Deeply nested relationships are not supported + at JsonApiDotNetCore.Services.QueryParser.ParseIncludedRelationships(String value) in /Users/jarednance/dev/json-api-dotnet-core/src/JsonApiDotNetCore/Services/QueryParser.cs:line 176 + at JsonApiDotNetCore.Services.QueryParser.Parse(IQueryCollection query) in /Users/jarednance/dev/json-api-dotnet-core/src/JsonApiDotNetCore/Services/QueryParser.cs:line 57 + at JsonApiDotNetCore.Services.JsonApiContext.ApplyContext[T](Object controller) in /Users/jarednance/dev/json-api-dotnet-core/src/JsonApiDotNetCore/Services/JsonApiContext.cs:line 70 + at JsonApiDotNetCore.Controllers.BaseJsonApiController`2..ctor(IJsonApiContext jsonApiContext, IResourceService`2 resourceService) in /Users/jarednance/dev/json-api-dotnet-core/src/JsonApiDotNetCore/Controllers/BaseJsonApiController.cs:line 56 + at JsonApiDotNetCore.Controllers.JsonApiController`2..ctor(IJsonApiContext jsonApiContext, IResourceService`2 resourceService, ILoggerFactory loggerFactory) in /Users/jarednance/dev/json-api-dotnet-core/src/JsonApiDotNetCore/Controllers/JsonApiController.cs:line 40 + at JsonApiDotNetCore.Controllers.JsonApiController`1..ctor(IJsonApiContext jsonApiContext, IResourceService`2 resourceService, ILoggerFactory loggerFactory) in /Users/jarednance/dev/json-api-dotnet-core/src/JsonApiDotNetCore/Controllers/JsonApiController.cs:line 17 + at JsonApiDotNetCoreExample.Controllers.PeopleController..ctor(IJsonApiContext jsonApiContext, IResourceService`1 resourceService, ILoggerFactory loggerFactory) in /Users/jarednance/dev/json-api-dotnet-core/src/Examples/JsonApiDotNetCoreExample/Controllers/PeopleController.cs:line 14 + at lambda_method(Closure , IServiceProvider , Object[] ) + at Microsoft.AspNetCore.Mvc.Controllers.ControllerFactoryProvider.<>c__DisplayClass5_0.g__CreateController|0(ControllerContext controllerContext) + at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) + at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.d__14.MoveNext() +--- End of stack trace from previous location where exception was thrown --- + at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) + at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.d__23.MoveNext() +fail: JsonApiDotNetCore.Middleware.JsonApiExceptionFilter[0] + An unhandled exception occurred during the request +JsonApiDotNetCore.Internal.JsonApiException: Deeply nested relationships are not supported + at JsonApiDotNetCore.Services.QueryParser.ParseIncludedRelationships(String value) in /Users/jarednance/dev/json-api-dotnet-core/src/JsonApiDotNetCore/Services/QueryParser.cs:line 176 + at JsonApiDotNetCore.Services.QueryParser.Parse(IQueryCollection query) in /Users/jarednance/dev/json-api-dotnet-core/src/JsonApiDotNetCore/Services/QueryParser.cs:line 57 + at JsonApiDotNetCore.Services.JsonApiContext.ApplyContext[T](Object controller) in /Users/jarednance/dev/json-api-dotnet-core/src/JsonApiDotNetCore/Services/JsonApiContext.cs:line 70 + at JsonApiDotNetCore.Controllers.BaseJsonApiController`2..ctor(IJsonApiContext jsonApiContext, IResourceService`2 resourceService) in /Users/jarednance/dev/json-api-dotnet-core/src/JsonApiDotNetCore/Controllers/BaseJsonApiController.cs:line 56 + at JsonApiDotNetCore.Controllers.JsonApiController`2..ctor(IJsonApiContext jsonApiContext, IResourceService`2 resourceService, ILoggerFactory loggerFactory) in /Users/jarednance/dev/json-api-dotnet-core/src/JsonApiDotNetCore/Controllers/JsonApiController.cs:line 40 + at JsonApiDotNetCore.Controllers.JsonApiController`1..ctor(IJsonApiContext jsonApiContext, IResourceService`2 resourceService, ILoggerFactory loggerFactory) in /Users/jarednance/dev/json-api-dotnet-core/src/JsonApiDotNetCore/Controllers/JsonApiController.cs:line 17 + at JsonApiDotNetCoreExample.Controllers.PeopleController..ctor(IJsonApiContext jsonApiContext, IResourceService`1 resourceService, ILoggerFactory loggerFactory) in /Users/jarednance/dev/json-api-dotnet-core/src/Examples/JsonApiDotNetCoreExample/Controllers/PeopleController.cs:line 14 + at lambda_method(Closure , IServiceProvider , Object[] ) + at Microsoft.AspNetCore.Mvc.Controllers.ControllerFactoryProvider.<>c__DisplayClass5_0.g__CreateController|0(ControllerContext controllerContext) + at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) + at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.d__14.MoveNext() +--- End of stack trace from previous location where exception was thrown --- + at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) + at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.d__23.MoveNext() +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[4] + No information found on request to perform content negotiation. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[2] + Selected output formatter 'JsonApiDotNetCore.Formatters.JsonApiOutputFormatter' and content type '' to write the response. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: JsonApiDotNetCore.Formatters.JsonApiWriter[0] + Formatting response as JSONAPI +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.PeopleController.GetAsync (JsonApiDotNetCoreExample) in 5.157ms +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.PeopleController.GetAsync (JsonApiDotNetCoreExample) in 5.157ms +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 25.495ms 400 application/vnd.api+json +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 25.495ms 400 application/vnd.api+json +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20200] + Beginning transaction with isolation level 'ReadCommitted'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@p0='?', @p1='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "People" ("FirstName", "LastName") + VALUES (@p0, @p1) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p0='?', @p1='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "People" ("FirstName", "LastName") + VALUES (@p0, @p1) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p0='?', @p1='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "People" ("FirstName", "LastName") + VALUES (@p0, @p1) + RETURNING "Id"; +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@p2='?', @p3='?', @p4='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItemCollections" ("Id", "Name", "OwnerId") + VALUES (@p2, @p3, @p4); +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p2='?', @p3='?', @p4='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItemCollections" ("Id", "Name", "OwnerId") + VALUES (@p2, @p3, @p4); +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p2='?', @p3='?', @p4='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItemCollections" ("Id", "Name", "OwnerId") + VALUES (@p2, @p3, @p4); +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@p5='?', @p6='?', @p7='?', @p8='?', @p9='?', @p10='?', @p11='?', @p12='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p5, @p6, @p7, @p8, @p9, @p10, @p11, @p12) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p5='?', @p6='?', @p7='?', @p8='?', @p9='?', @p10='?', @p11='?', @p12='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p5, @p6, @p7, @p8, @p9, @p10, @p11, @p12) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p5='?', @p6='?', @p7='?', @p8='?', @p9='?', @p10='?', @p11='?', @p12='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p5, @p6, @p7, @p8, @p9, @p10, @p11, @p12) + RETURNING "Id"; +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20202] + Committing transaction. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20204] + Disposing transaction. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20200] + Beginning transaction with isolation level 'ReadCommitted'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6, @p7) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (2ms) [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6, @p7) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (2ms) [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6, @p7) + RETURNING "Id"; +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20202] + Committing transaction. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20204] + Disposing transaction. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20200] + Beginning transaction with isolation level 'ReadCommitted'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6, @p7) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6, @p7) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6, @p7) + RETURNING "Id"; +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20202] + Committing transaction. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20204] + Disposing transaction. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20200] + Beginning transaction with isolation level 'ReadCommitted'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6, @p7) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6, @p7) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6, @p7) + RETURNING "Id"; +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20202] + Committing transaction. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20204] + Disposing transaction. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20200] + Beginning transaction with isolation level 'ReadCommitted'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6, @p7) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6, @p7) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6, @p7) + RETURNING "Id"; +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20202] + Committing transaction. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20204] + Disposing transaction. +dbug: Microsoft.EntityFrameworkCore.Infrastructure[10401] + An 'IServiceProvider' was created for internal use by Entity Framework. +warn: Microsoft.EntityFrameworkCore.Infrastructure[10402] + More than twenty 'IServiceProvider' instances have been created for internal use by Entity Framework. Consider reviewing calls on 'DbContextOptionsBuilder' that may require new service providers to be built. +info: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[0] + User profile is available. Using '/Users/jarednance/.aspnet/DataProtection-Keys' as key repository; keys will not be encrypted at rest. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-b040dd03-33c5-451e-8f42-3c9dd4e0dfec.xml'. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-c8147b66-2deb-407c-9421-1553f0e16d67.xml'. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-f7fa4a09-6d65-426e-a653-cbd2969e5073.xml'. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {b040dd03-33c5-451e-8f42-3c9dd4e0dfec}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {c8147b66-2deb-407c-9421-1553f0e16d67}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {f7fa4a09-6d65-426e-a653-cbd2969e5073}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.DefaultKeyResolver[13] + Considering key {c8147b66-2deb-407c-9421-1553f0e16d67} with expiration date 2018-03-03 16:22:35Z as default key. +dbug: Microsoft.AspNetCore.DataProtection.TypeForwardingActivator[0] + Forwarded activator type request from Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Version=1.1.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60 to Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Culture=neutral, PublicKeyToken=adb9793829ddae60 +dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptorFactory[11] + Using managed symmetric algorithm 'System.Security.Cryptography.Aes'. +dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptorFactory[10] + Using managed keyed hash algorithm 'System.Security.Cryptography.HMACSHA256'. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingProvider[2] + Using key {c8147b66-2deb-407c-9421-1553f0e16d67} as the default key. +dbug: Microsoft.AspNetCore.DataProtection.Internal.DataProtectionStartupFilter[0] + Key ring with default key {c8147b66-2deb-407c-9421-1553f0e16d67} was loaded during application startup. +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[], CommandType='Text', CommandTimeout='30'] + + SELECT CASE WHEN COUNT(*) = 0 THEN FALSE ELSE TRUE END + FROM information_schema.tables + WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema') +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + + SELECT CASE WHEN COUNT(*) = 0 THEN FALSE ELSE TRUE END + FROM information_schema.tables + WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema') +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[3] + Hosting starting +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[4] + Hosting started +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[0] + Loaded hosting startup assembly JsonApiDotNetCoreExample +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 GET http://localhost/api/v1/people/892?include=todo-items,todo-collections +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 GET http://localhost/api/v1/people/892?include=todo-items,todo-collections +dbug: Microsoft.AspNetCore.Routing.Tree.TreeRouter[1] + Request successfully matched the route with name '(null)' and template 'api/v1/people/{id}'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.PeopleController.PatchAsync (JsonApiDotNetCoreExample)' with id '3f6bab1b-ca52-4fbd-a8c4-dee3c0df1851' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.PeopleController.DeleteAsync (JsonApiDotNetCoreExample)' with id '0c5a6576-2492-4aff-80c7-4f36a82e8d14' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action JsonApiDotNetCoreExample.Controllers.PeopleController.GetAsync (JsonApiDotNetCoreExample) +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.PeopleController.GetAsync (JsonApiDotNetCoreExample) with arguments (892) - ModelState is Valid +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.PeopleController.GetAsync (JsonApiDotNetCoreExample) with arguments (892) - ModelState is Valid +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Query[10101] + Compiling query model: + '(from Person e in DbSet + where bool [e].Id.Equals((object)__id_0) + select [e]) + .Include("TodoItems") + .Include("TodoItemCollections") + .FirstOrDefault()' +dbug: Microsoft.EntityFrameworkCore.Query[10105] + Including navigation: '[e].TodoItems' +dbug: Microsoft.EntityFrameworkCore.Query[10105] + Including navigation: '[e].TodoItemCollections' +dbug: Microsoft.EntityFrameworkCore.Query[10104] + Optimized query model: + '(from Person e in DbSet + where bool [e].Id.Equals((object)__id_0) + order by (Nullable)EF.Property(?[e]?, "Id") asc + select Task _IncludeAsync( + queryContext: queryContext, + entity: [e], + included: new object[]{ }, + fixup: (QueryContext queryContext | Person entity | Object[] included | CancellationToken ct) => + { + Void queryContext.QueryBuffer.StartTracking( + entity: entity, + entityType: EntityType: Person) + return Task _AwaitMany(new Func[] + { + () => Task queryContext.QueryBuffer.IncludeCollectionAsync( + includeId: 0, + navigation: Person.TodoItems, + inverseNavigation: TodoItem.Owner, + targetEntityType: EntityType: TodoItem, + clrCollectionAccessor: ClrICollectionAccessor, TodoItem>, + inverseClrPropertySetter: ClrPropertySetter, + tracking: True, + instance: entity, + valuesFactory: (Func>)() => + from TodoItem e.TodoItems in DbSet + join AnonymousObject _e in + (from Person e in DbSet + where bool [e].Id.Equals((object)__id_0) + order by (Nullable)EF.Property(?[e]?, "Id") asc + select new AnonymousObject(new object[]{ (object)EF.Property(?[e]?, "Id") })).Take(1) + on Property([e.TodoItems], "OwnerId") equals (Nullable)object [_e].GetValue(0) + order by object [_e].GetValue(0) asc + select [e.TodoItems], + cancellationToken: ct), + () => Task queryContext.QueryBuffer.IncludeCollectionAsync( + includeId: 1, + navigation: Person.TodoItemCollections, + inverseNavigation: TodoItemCollection.Owner, + targetEntityType: EntityType: TodoItemCollection, + clrCollectionAccessor: ClrICollectionAccessor, TodoItemCollection>, + inverseClrPropertySetter: ClrPropertySetter, + tracking: True, + instance: entity, + valuesFactory: (Func>)() => + from TodoItemCollection e.TodoItemCollections in DbSet + join AnonymousObject _e in + (from Person e in DbSet + where bool [e].Id.Equals((object)__id_0) + order by (Nullable)EF.Property(?[e]?, "Id") asc + select new AnonymousObject(new object[]{ (object)EF.Property(?[e]?, "Id") })).Take(1) + on Property([e.TodoItemCollections], "OwnerId") equals (Nullable)object [_e].GetValue(0) + order by object [_e].GetValue(0) asc + select [e.TodoItemCollections], + cancellationToken: ct) + }) + } + , + cancellationToken: ct).Result).FirstOrDefault()' +dbug: Microsoft.EntityFrameworkCore.Query[10107] + (QueryContext queryContext) => IAsyncEnumerable _InterceptExceptions( + source: IAsyncEnumerable _TrackEntities( + results: IAsyncEnumerable _ToSequence(Task FirstOrDefault( + source: IAsyncEnumerable _SelectAsync( + source: IAsyncEnumerable _ShapedQuery( + queryContext: queryContext, + shaperCommandContext: SelectExpression: + SELECT "e"."Id", "e"."FirstName", "e"."LastName" + FROM "People" AS "e" + WHERE "e"."Id" = @__id_0 + ORDER BY "e"."Id" + LIMIT 1, + shaper: BufferedEntityShaper), + selector: (Person e | CancellationToken ct) => Task _ExecuteAsync( + taskFactories: new Func>[]{ () => Task _ToObjectTask(Task _IncludeAsync( + queryContext: queryContext, + entity: e, + included: new object[]{ }, + fixup: (QueryContext queryContext | Person entity | Object[] included | CancellationToken ct) => + { + Void queryContext.QueryBuffer.StartTracking( + entity: entity, + entityType: EntityType: Person) + return Task _AwaitMany(new Func[] + { + () => Task queryContext.QueryBuffer.IncludeCollectionAsync( + includeId: 0, + navigation: Person.TodoItems, + inverseNavigation: TodoItem.Owner, + targetEntityType: EntityType: TodoItem, + clrCollectionAccessor: ClrICollectionAccessor, TodoItem>, + inverseClrPropertySetter: ClrPropertySetter, + tracking: True, + instance: entity, + valuesFactory: (Func>)() => IAsyncEnumerable _ShapedQuery( + queryContext: queryContext, + shaperCommandContext: SelectExpression: + SELECT "e.TodoItems"."Id", "e.TodoItems"."AchievedDate", "e.TodoItems"."AssigneeId", "e.TodoItems"."CollectionId", "e.TodoItems"."CreatedDate", "e.TodoItems"."Description", "e.TodoItems"."GuidProperty", "e.TodoItems"."Ordinal", "e.TodoItems"."OwnerId" + FROM "TodoItems" AS "e.TodoItems" + INNER JOIN ( + SELECT "e0"."Id" + FROM "People" AS "e0" + WHERE "e0"."Id" = @__id_0 + ORDER BY "e0"."Id" + LIMIT 1 + ) AS "t" ON "e.TodoItems"."OwnerId" = "t"."Id" + ORDER BY "t"."Id", + shaper: BufferedEntityShaper), + cancellationToken: ct), + () => Task queryContext.QueryBuffer.IncludeCollectionAsync( + includeId: 1, + navigation: Person.TodoItemCollections, + inverseNavigation: TodoItemCollection.Owner, + targetEntityType: EntityType: TodoItemCollection, + clrCollectionAccessor: ClrICollectionAccessor, TodoItemCollection>, + inverseClrPropertySetter: ClrPropertySetter, + tracking: True, + instance: entity, + valuesFactory: (Func>)() => IAsyncEnumerable _ShapedQuery( + queryContext: queryContext, + shaperCommandContext: SelectExpression: + SELECT "e.TodoItemCollections"."Id", "e.TodoItemCollections"."Name", "e.TodoItemCollections"."OwnerId" + FROM "TodoItemCollections" AS "e.TodoItemCollections" + INNER JOIN ( + SELECT "e1"."Id" + FROM "People" AS "e1" + WHERE "e1"."Id" = @__id_0 + ORDER BY "e1"."Id" + LIMIT 1 + ) AS "t0" ON "e.TodoItemCollections"."OwnerId" = "t0"."Id" + ORDER BY "t0"."Id", + shaper: BufferedEntityShaper), + cancellationToken: ct) + }) + } + , + cancellationToken: Unhandled parameter: ct)) }, + selector: (Object[] results) => (Person)results[0])), + cancellationToken: Unhandled parameter: queryContext.CancellationToken)), + queryContext: Unhandled parameter: queryContext, + entityTrackingInfos: { itemType: Person }, + entityAccessors: List> + { + Func, + } + ), + contextType: JsonApiDotNetCoreExample.Data.AppDbContext, + logger: DiagnosticsLogger, + queryContext: Unhandled parameter: queryContext) +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "e"."Id", "e"."FirstName", "e"."LastName" + FROM "People" AS "e" + WHERE "e"."Id" = @__id_0 + ORDER BY "e"."Id" + LIMIT 1 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (9ms) [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "e"."Id", "e"."FirstName", "e"."LastName" + FROM "People" AS "e" + WHERE "e"."Id" = @__id_0 + ORDER BY "e"."Id" + LIMIT 1 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (9ms) [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "e"."Id", "e"."FirstName", "e"."LastName" + FROM "People" AS "e" + WHERE "e"."Id" = @__id_0 + ORDER BY "e"."Id" + LIMIT 1 +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "e.TodoItems"."Id", "e.TodoItems"."AchievedDate", "e.TodoItems"."AssigneeId", "e.TodoItems"."CollectionId", "e.TodoItems"."CreatedDate", "e.TodoItems"."Description", "e.TodoItems"."GuidProperty", "e.TodoItems"."Ordinal", "e.TodoItems"."OwnerId" + FROM "TodoItems" AS "e.TodoItems" + INNER JOIN ( + SELECT "e0"."Id" + FROM "People" AS "e0" + WHERE "e0"."Id" = @__id_0 + ORDER BY "e0"."Id" + LIMIT 1 + ) AS "t" ON "e.TodoItems"."OwnerId" = "t"."Id" + ORDER BY "t"."Id" +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (2ms) [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "e.TodoItems"."Id", "e.TodoItems"."AchievedDate", "e.TodoItems"."AssigneeId", "e.TodoItems"."CollectionId", "e.TodoItems"."CreatedDate", "e.TodoItems"."Description", "e.TodoItems"."GuidProperty", "e.TodoItems"."Ordinal", "e.TodoItems"."OwnerId" + FROM "TodoItems" AS "e.TodoItems" + INNER JOIN ( + SELECT "e0"."Id" + FROM "People" AS "e0" + WHERE "e0"."Id" = @__id_0 + ORDER BY "e0"."Id" + LIMIT 1 + ) AS "t" ON "e.TodoItems"."OwnerId" = "t"."Id" + ORDER BY "t"."Id" +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (2ms) [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "e.TodoItems"."Id", "e.TodoItems"."AchievedDate", "e.TodoItems"."AssigneeId", "e.TodoItems"."CollectionId", "e.TodoItems"."CreatedDate", "e.TodoItems"."Description", "e.TodoItems"."GuidProperty", "e.TodoItems"."Ordinal", "e.TodoItems"."OwnerId" + FROM "TodoItems" AS "e.TodoItems" + INNER JOIN ( + SELECT "e0"."Id" + FROM "People" AS "e0" + WHERE "e0"."Id" = @__id_0 + ORDER BY "e0"."Id" + LIMIT 1 + ) AS "t" ON "e.TodoItems"."OwnerId" = "t"."Id" + ORDER BY "t"."Id" +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "e.TodoItemCollections"."Id", "e.TodoItemCollections"."Name", "e.TodoItemCollections"."OwnerId" + FROM "TodoItemCollections" AS "e.TodoItemCollections" + INNER JOIN ( + SELECT "e1"."Id" + FROM "People" AS "e1" + WHERE "e1"."Id" = @__id_0 + ORDER BY "e1"."Id" + LIMIT 1 + ) AS "t0" ON "e.TodoItemCollections"."OwnerId" = "t0"."Id" + ORDER BY "t0"."Id" +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "e.TodoItemCollections"."Id", "e.TodoItemCollections"."Name", "e.TodoItemCollections"."OwnerId" + FROM "TodoItemCollections" AS "e.TodoItemCollections" + INNER JOIN ( + SELECT "e1"."Id" + FROM "People" AS "e1" + WHERE "e1"."Id" = @__id_0 + ORDER BY "e1"."Id" + LIMIT 1 + ) AS "t0" ON "e.TodoItemCollections"."OwnerId" = "t0"."Id" + ORDER BY "t0"."Id" +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "e.TodoItemCollections"."Id", "e.TodoItemCollections"."Name", "e.TodoItemCollections"."OwnerId" + FROM "TodoItemCollections" AS "e.TodoItemCollections" + INNER JOIN ( + SELECT "e1"."Id" + FROM "People" AS "e1" + WHERE "e1"."Id" = @__id_0 + ORDER BY "e1"."Id" + LIMIT 1 + ) AS "t0" ON "e.TodoItemCollections"."OwnerId" = "t0"."Id" + ORDER BY "t0"."Id" +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action method JsonApiDotNetCoreExample.Controllers.PeopleController.GetAsync (JsonApiDotNetCoreExample), returned result Microsoft.AspNetCore.Mvc.OkObjectResult. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[4] + No information found on request to perform content negotiation. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[2] + Selected output formatter 'JsonApiDotNetCore.Formatters.JsonApiOutputFormatter' and content type '' to write the response. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: JsonApiDotNetCore.Formatters.JsonApiWriter[0] + Formatting response as JSONAPI +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.PeopleController.GetAsync (JsonApiDotNetCoreExample) in 129.696ms +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.PeopleController.GetAsync (JsonApiDotNetCoreExample) in 129.696ms +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 149.864ms 200 application/vnd.api+json +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 149.864ms 200 application/vnd.api+json +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[], CommandType='Text', CommandTimeout='30'] + SELECT "p"."Id", "p"."FirstName", "p"."LastName" + FROM "People" AS "p" +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + SELECT "p"."Id", "p"."FirstName", "p"."LastName" + FROM "People" AS "p" +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + SELECT "p"."Id", "p"."FirstName", "p"."LastName" + FROM "People" AS "p" +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[], CommandType='Text', CommandTimeout='30'] + SELECT "t"."Id", "t"."AchievedDate", "t"."AssigneeId", "t"."CollectionId", "t"."CreatedDate", "t"."Description", "t"."GuidProperty", "t"."Ordinal", "t"."OwnerId" + FROM "TodoItems" AS "t" +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + SELECT "t"."Id", "t"."AchievedDate", "t"."AssigneeId", "t"."CollectionId", "t"."CreatedDate", "t"."Description", "t"."GuidProperty", "t"."Ordinal", "t"."OwnerId" + FROM "TodoItems" AS "t" +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + SELECT "t"."Id", "t"."AchievedDate", "t"."AssigneeId", "t"."CollectionId", "t"."CreatedDate", "t"."Description", "t"."GuidProperty", "t"."Ordinal", "t"."OwnerId" + FROM "TodoItems" AS "t" +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20200] + Beginning transaction with isolation level 'ReadCommitted'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?', @p8='?', @p9='?', @p10='?', @p11='?', @p12='?', @p13='?', @p14='?'], CommandType='Text', CommandTimeout='30'] + DELETE FROM "People" + WHERE "Id" = @p0; + INSERT INTO "People" ("FirstName", "LastName") + VALUES (@p1, @p2) + RETURNING "Id"; + DELETE FROM "TodoItems" + WHERE "Id" = @p3; + DELETE FROM "TodoItems" + WHERE "Id" = @p4; + DELETE FROM "TodoItems" + WHERE "Id" = @p5; + DELETE FROM "TodoItems" + WHERE "Id" = @p6; + DELETE FROM "TodoItems" + WHERE "Id" = @p7; + DELETE FROM "TodoItems" + WHERE "Id" = @p8; + DELETE FROM "TodoItems" + WHERE "Id" = @p9; + DELETE FROM "TodoItems" + WHERE "Id" = @p10; + DELETE FROM "TodoItems" + WHERE "Id" = @p11; + DELETE FROM "TodoItems" + WHERE "Id" = @p12; + DELETE FROM "TodoItems" + WHERE "Id" = @p13; + DELETE FROM "TodoItems" + WHERE "Id" = @p14; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (2ms) [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?', @p8='?', @p9='?', @p10='?', @p11='?', @p12='?', @p13='?', @p14='?'], CommandType='Text', CommandTimeout='30'] + DELETE FROM "People" + WHERE "Id" = @p0; + INSERT INTO "People" ("FirstName", "LastName") + VALUES (@p1, @p2) + RETURNING "Id"; + DELETE FROM "TodoItems" + WHERE "Id" = @p3; + DELETE FROM "TodoItems" + WHERE "Id" = @p4; + DELETE FROM "TodoItems" + WHERE "Id" = @p5; + DELETE FROM "TodoItems" + WHERE "Id" = @p6; + DELETE FROM "TodoItems" + WHERE "Id" = @p7; + DELETE FROM "TodoItems" + WHERE "Id" = @p8; + DELETE FROM "TodoItems" + WHERE "Id" = @p9; + DELETE FROM "TodoItems" + WHERE "Id" = @p10; + DELETE FROM "TodoItems" + WHERE "Id" = @p11; + DELETE FROM "TodoItems" + WHERE "Id" = @p12; + DELETE FROM "TodoItems" + WHERE "Id" = @p13; + DELETE FROM "TodoItems" + WHERE "Id" = @p14; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (2ms) [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?', @p8='?', @p9='?', @p10='?', @p11='?', @p12='?', @p13='?', @p14='?'], CommandType='Text', CommandTimeout='30'] + DELETE FROM "People" + WHERE "Id" = @p0; + INSERT INTO "People" ("FirstName", "LastName") + VALUES (@p1, @p2) + RETURNING "Id"; + DELETE FROM "TodoItems" + WHERE "Id" = @p3; + DELETE FROM "TodoItems" + WHERE "Id" = @p4; + DELETE FROM "TodoItems" + WHERE "Id" = @p5; + DELETE FROM "TodoItems" + WHERE "Id" = @p6; + DELETE FROM "TodoItems" + WHERE "Id" = @p7; + DELETE FROM "TodoItems" + WHERE "Id" = @p8; + DELETE FROM "TodoItems" + WHERE "Id" = @p9; + DELETE FROM "TodoItems" + WHERE "Id" = @p10; + DELETE FROM "TodoItems" + WHERE "Id" = @p11; + DELETE FROM "TodoItems" + WHERE "Id" = @p12; + DELETE FROM "TodoItems" + WHERE "Id" = @p13; + DELETE FROM "TodoItems" + WHERE "Id" = @p14; +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@p15='?', @p16='?', @p17='?', @p18='?', @p19='?', @p20='?', @p21='?', @p22='?', @p23='?', @p24='?', @p25='?', @p26='?'], CommandType='Text', CommandTimeout='30'] + DELETE FROM "People" + WHERE "Id" = @p15; + DELETE FROM "People" + WHERE "Id" = @p16; + DELETE FROM "People" + WHERE "Id" = @p17; + DELETE FROM "People" + WHERE "Id" = @p18; + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p19, @p20, @p21, @p22, @p23, @p24, @p25, @p26) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (2ms) [Parameters=[@p15='?', @p16='?', @p17='?', @p18='?', @p19='?', @p20='?', @p21='?', @p22='?', @p23='?', @p24='?', @p25='?', @p26='?'], CommandType='Text', CommandTimeout='30'] + DELETE FROM "People" + WHERE "Id" = @p15; + DELETE FROM "People" + WHERE "Id" = @p16; + DELETE FROM "People" + WHERE "Id" = @p17; + DELETE FROM "People" + WHERE "Id" = @p18; + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p19, @p20, @p21, @p22, @p23, @p24, @p25, @p26) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (2ms) [Parameters=[@p15='?', @p16='?', @p17='?', @p18='?', @p19='?', @p20='?', @p21='?', @p22='?', @p23='?', @p24='?', @p25='?', @p26='?'], CommandType='Text', CommandTimeout='30'] + DELETE FROM "People" + WHERE "Id" = @p15; + DELETE FROM "People" + WHERE "Id" = @p16; + DELETE FROM "People" + WHERE "Id" = @p17; + DELETE FROM "People" + WHERE "Id" = @p18; + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p19, @p20, @p21, @p22, @p23, @p24, @p25, @p26) + RETURNING "Id"; +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20202] + Committing transaction. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20204] + Disposing transaction. +dbug: Microsoft.EntityFrameworkCore.Infrastructure[10401] + An 'IServiceProvider' was created for internal use by Entity Framework. +warn: Microsoft.EntityFrameworkCore.Infrastructure[10402] + More than twenty 'IServiceProvider' instances have been created for internal use by Entity Framework. Consider reviewing calls on 'DbContextOptionsBuilder' that may require new service providers to be built. +info: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[0] + User profile is available. Using '/Users/jarednance/.aspnet/DataProtection-Keys' as key repository; keys will not be encrypted at rest. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-b040dd03-33c5-451e-8f42-3c9dd4e0dfec.xml'. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-c8147b66-2deb-407c-9421-1553f0e16d67.xml'. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-f7fa4a09-6d65-426e-a653-cbd2969e5073.xml'. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {b040dd03-33c5-451e-8f42-3c9dd4e0dfec}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {c8147b66-2deb-407c-9421-1553f0e16d67}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {f7fa4a09-6d65-426e-a653-cbd2969e5073}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.DefaultKeyResolver[13] + Considering key {c8147b66-2deb-407c-9421-1553f0e16d67} with expiration date 2018-03-03 16:22:35Z as default key. +dbug: Microsoft.AspNetCore.DataProtection.TypeForwardingActivator[0] + Forwarded activator type request from Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Version=1.1.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60 to Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Culture=neutral, PublicKeyToken=adb9793829ddae60 +dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptorFactory[11] + Using managed symmetric algorithm 'System.Security.Cryptography.Aes'. +dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptorFactory[10] + Using managed keyed hash algorithm 'System.Security.Cryptography.HMACSHA256'. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingProvider[2] + Using key {c8147b66-2deb-407c-9421-1553f0e16d67} as the default key. +dbug: Microsoft.AspNetCore.DataProtection.Internal.DataProtectionStartupFilter[0] + Key ring with default key {c8147b66-2deb-407c-9421-1553f0e16d67} was loaded during application startup. +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[], CommandType='Text', CommandTimeout='30'] + + SELECT CASE WHEN COUNT(*) = 0 THEN FALSE ELSE TRUE END + FROM information_schema.tables + WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema') +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (3ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + + SELECT CASE WHEN COUNT(*) = 0 THEN FALSE ELSE TRUE END + FROM information_schema.tables + WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema') +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[3] + Hosting starting +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[4] + Hosting started +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[0] + Loaded hosting startup assembly JsonApiDotNetCoreExample +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 GET http://localhost/api/v1/todo-items/2633?include=owner&include=assignee +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 GET http://localhost/api/v1/todo-items/2633?include=owner&include=assignee +dbug: Microsoft.AspNetCore.Routing.Tree.TreeRouter[1] + Request successfully matched the route with name '(null)' and template 'api/v1/todo-items/{id}'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.TodoItemsController.PatchAsync (JsonApiDotNetCoreExample)' with id '49eb2ce9-b9a4-4b60-8f0d-9dc16928dad7' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.TodoItemsController.DeleteAsync (JsonApiDotNetCoreExample)' with id '0d5cc266-1ec4-468a-84c2-4323d7e9b49c' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) with arguments (2633) - ModelState is Valid +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Query[10101] + Compiling query model: + '(from TodoItem e in DbSet + where bool [e].Id.Equals((object)__id_0) + select [e]) + .Include("Owner") + .Include("Assignee") + .FirstOrDefault()' +dbug: Microsoft.EntityFrameworkCore.Query[10105] + Including navigation: '[e].Owner' +dbug: Microsoft.EntityFrameworkCore.Query[10105] + Including navigation: '[e].Assignee' +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) with arguments (2633) - ModelState is Valid +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Query[10104] + Optimized query model: + '(from TodoItem e in DbSet + join Person e.Assignee in DbSet + on Property([e], "AssigneeId") equals (Nullable)Property([e.Assignee], "Id") into e.Assignee_group + from Person e.Assignee in + (from Person e.Assignee_groupItem in [e.Assignee_group] + select [e.Assignee_groupItem]).DefaultIfEmpty() + join Person e.Owner in DbSet + on Property([e], "OwnerId") equals (Nullable)Property([e.Owner], "Id") into e.Owner_group + from Person e.Owner in + (from Person e.Owner_groupItem in [e.Owner_group] + select [e.Owner_groupItem]).DefaultIfEmpty() + where bool [e].Id.Equals((object)__id_0) + select TodoItem _Include( + queryContext: queryContext, + entity: [e], + included: new object[] + { + [e.Owner], + [e.Assignee] + }, + fixup: (QueryContext queryContext | TodoItem entity | Object[] included) => + { + Void queryContext.QueryBuffer.StartTracking( + entity: entity, + entityType: EntityType: TodoItem) + !(bool ReferenceEquals(included[0], null)) ? + { + Void queryContext.QueryBuffer.StartTracking( + entity: included[0], + entityType: EntityType: Person) + Void SetRelationshipSnapshotValue( + stateManager: queryContext.StateManager, + navigation: TodoItem.Owner, + entity: entity, + value: included[0]) + return Void AddToCollectionSnapshot( + stateManager: queryContext.StateManager, + navigation: Person.TodoItems, + entity: included[0], + value: entity) + } + : default(Void) + return !(bool ReferenceEquals(included[1], null)) ? + { + Void queryContext.QueryBuffer.StartTracking( + entity: included[1], + entityType: EntityType: Person) + Void SetRelationshipSnapshotValue( + stateManager: queryContext.StateManager, + navigation: TodoItem.Assignee, + entity: entity, + value: included[1]) + return Void AddToCollectionSnapshot( + stateManager: queryContext.StateManager, + navigation: Person.AssignedTodoItems, + entity: included[1], + value: entity) + } + : default(Void) + } + )).FirstOrDefault()' +dbug: Microsoft.EntityFrameworkCore.Query[10107] + (QueryContext queryContext) => IAsyncEnumerable _InterceptExceptions( + source: IAsyncEnumerable _TrackEntities( + results: IAsyncEnumerable _ToSequence(Task FirstOrDefault( + source: IAsyncEnumerable _Select( + source: IAsyncEnumerable, Person>> _ShapedQuery( + queryContext: queryContext, + shaperCommandContext: SelectExpression: + SELECT "e"."Id", "e"."AchievedDate", "e"."AssigneeId", "e"."CollectionId", "e"."CreatedDate", "e"."Description", "e"."GuidProperty", "e"."Ordinal", "e"."OwnerId", "e.Assignee"."Id", "e.Assignee"."FirstName", "e.Assignee"."LastName", "e.Owner"."Id", "e.Owner"."FirstName", "e.Owner"."LastName" + FROM "TodoItems" AS "e" + LEFT JOIN "People" AS "e.Assignee" ON "e"."AssigneeId" = "e.Assignee"."Id" + LEFT JOIN "People" AS "e.Owner" ON "e"."OwnerId" = "e.Owner"."Id" + WHERE "e"."Id" = @__id_0 + LIMIT 1, + shaper: TypedCompositeShaper, TodoItem, BufferedOffsetEntityShaper, Person, TransparentIdentifier>, TransparentIdentifier, BufferedOffsetEntityShaper, Person, TransparentIdentifier, Person>>), + selector: (TransparentIdentifier, Person> t3) => TodoItem _Include( + queryContext: queryContext, + entity: t3.Outer.Outer, + included: new object[] + { + t3.Inner, + t3.Outer.Inner + }, + fixup: (QueryContext queryContext | TodoItem entity | Object[] included) => + { + Void queryContext.QueryBuffer.StartTracking( + entity: entity, + entityType: EntityType: TodoItem) + !(bool ReferenceEquals(included[0], null)) ? + { + Void queryContext.QueryBuffer.StartTracking( + entity: included[0], + entityType: EntityType: Person) + Void SetRelationshipSnapshotValue( + stateManager: queryContext.StateManager, + navigation: TodoItem.Owner, + entity: entity, + value: included[0]) + return Void AddToCollectionSnapshot( + stateManager: queryContext.StateManager, + navigation: Person.TodoItems, + entity: included[0], + value: entity) + } + : default(Void) + return !(bool ReferenceEquals(included[1], null)) ? + { + Void queryContext.QueryBuffer.StartTracking( + entity: included[1], + entityType: EntityType: Person) + Void SetRelationshipSnapshotValue( + stateManager: queryContext.StateManager, + navigation: TodoItem.Assignee, + entity: entity, + value: included[1]) + return Void AddToCollectionSnapshot( + stateManager: queryContext.StateManager, + navigation: Person.AssignedTodoItems, + entity: included[1], + value: entity) + } + : default(Void) + } + )), + cancellationToken: Unhandled parameter: queryContext.CancellationToken)), + queryContext: Unhandled parameter: queryContext, + entityTrackingInfos: { itemType: TodoItem }, + entityAccessors: List> + { + Func, + } + ), + contextType: JsonApiDotNetCoreExample.Data.AppDbContext, + logger: DiagnosticsLogger, + queryContext: Unhandled parameter: queryContext) +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "e"."Id", "e"."AchievedDate", "e"."AssigneeId", "e"."CollectionId", "e"."CreatedDate", "e"."Description", "e"."GuidProperty", "e"."Ordinal", "e"."OwnerId", "e.Assignee"."Id", "e.Assignee"."FirstName", "e.Assignee"."LastName", "e.Owner"."Id", "e.Owner"."FirstName", "e.Owner"."LastName" + FROM "TodoItems" AS "e" + LEFT JOIN "People" AS "e.Assignee" ON "e"."AssigneeId" = "e.Assignee"."Id" + LEFT JOIN "People" AS "e.Owner" ON "e"."OwnerId" = "e.Owner"."Id" + WHERE "e"."Id" = @__id_0 + LIMIT 1 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (15ms) [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "e"."Id", "e"."AchievedDate", "e"."AssigneeId", "e"."CollectionId", "e"."CreatedDate", "e"."Description", "e"."GuidProperty", "e"."Ordinal", "e"."OwnerId", "e.Assignee"."Id", "e.Assignee"."FirstName", "e.Assignee"."LastName", "e.Owner"."Id", "e.Owner"."FirstName", "e.Owner"."LastName" + FROM "TodoItems" AS "e" + LEFT JOIN "People" AS "e.Assignee" ON "e"."AssigneeId" = "e.Assignee"."Id" + LEFT JOIN "People" AS "e.Owner" ON "e"."OwnerId" = "e.Owner"."Id" + WHERE "e"."Id" = @__id_0 + LIMIT 1 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (15ms) [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "e"."Id", "e"."AchievedDate", "e"."AssigneeId", "e"."CollectionId", "e"."CreatedDate", "e"."Description", "e"."GuidProperty", "e"."Ordinal", "e"."OwnerId", "e.Assignee"."Id", "e.Assignee"."FirstName", "e.Assignee"."LastName", "e.Owner"."Id", "e.Owner"."FirstName", "e.Owner"."LastName" + FROM "TodoItems" AS "e" + LEFT JOIN "People" AS "e.Assignee" ON "e"."AssigneeId" = "e.Assignee"."Id" + LEFT JOIN "People" AS "e.Owner" ON "e"."OwnerId" = "e.Owner"."Id" + WHERE "e"."Id" = @__id_0 + LIMIT 1 +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample), returned result Microsoft.AspNetCore.Mvc.OkObjectResult. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[4] + No information found on request to perform content negotiation. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[2] + Selected output formatter 'JsonApiDotNetCore.Formatters.JsonApiOutputFormatter' and content type '' to write the response. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: JsonApiDotNetCore.Formatters.JsonApiWriter[0] + Formatting response as JSONAPI +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) in 111.286ms +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) in 111.286ms +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 131.712ms 200 application/vnd.api+json +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 131.712ms 200 application/vnd.api+json +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[], CommandType='Text', CommandTimeout='30'] + SELECT "p"."Id", "p"."FirstName", "p"."LastName" + FROM "People" AS "p" +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + SELECT "p"."Id", "p"."FirstName", "p"."LastName" + FROM "People" AS "p" +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + SELECT "p"."Id", "p"."FirstName", "p"."LastName" + FROM "People" AS "p" +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[], CommandType='Text', CommandTimeout='30'] + SELECT "t"."Id", "t"."AchievedDate", "t"."AssigneeId", "t"."CollectionId", "t"."CreatedDate", "t"."Description", "t"."GuidProperty", "t"."Ordinal", "t"."OwnerId" + FROM "TodoItems" AS "t" +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + SELECT "t"."Id", "t"."AchievedDate", "t"."AssigneeId", "t"."CollectionId", "t"."CreatedDate", "t"."Description", "t"."GuidProperty", "t"."Ordinal", "t"."OwnerId" + FROM "TodoItems" AS "t" +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + SELECT "t"."Id", "t"."AchievedDate", "t"."AssigneeId", "t"."CollectionId", "t"."CreatedDate", "t"."Description", "t"."GuidProperty", "t"."Ordinal", "t"."OwnerId" + FROM "TodoItems" AS "t" +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20200] + Beginning transaction with isolation level 'ReadCommitted'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@p0='?', @p1='?', @p2='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "People" ("FirstName", "LastName") + VALUES (@p0, @p1) + RETURNING "Id"; + DELETE FROM "TodoItems" + WHERE "Id" = @p2; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p0='?', @p1='?', @p2='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "People" ("FirstName", "LastName") + VALUES (@p0, @p1) + RETURNING "Id"; + DELETE FROM "TodoItems" + WHERE "Id" = @p2; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p0='?', @p1='?', @p2='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "People" ("FirstName", "LastName") + VALUES (@p0, @p1) + RETURNING "Id"; + DELETE FROM "TodoItems" + WHERE "Id" = @p2; +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@p3='?', @p4='?', @p5='?', @p6='?', @p7='?', @p8='?', @p9='?', @p10='?', @p11='?'], CommandType='Text', CommandTimeout='30'] + DELETE FROM "People" + WHERE "Id" = @p3; + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p4, @p5, @p6, @p7, @p8, @p9, @p10, @p11) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p3='?', @p4='?', @p5='?', @p6='?', @p7='?', @p8='?', @p9='?', @p10='?', @p11='?'], CommandType='Text', CommandTimeout='30'] + DELETE FROM "People" + WHERE "Id" = @p3; + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p4, @p5, @p6, @p7, @p8, @p9, @p10, @p11) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p3='?', @p4='?', @p5='?', @p6='?', @p7='?', @p8='?', @p9='?', @p10='?', @p11='?'], CommandType='Text', CommandTimeout='30'] + DELETE FROM "People" + WHERE "Id" = @p3; + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p4, @p5, @p6, @p7, @p8, @p9, @p10, @p11) + RETURNING "Id"; +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20202] + Committing transaction. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20204] + Disposing transaction. +dbug: Microsoft.EntityFrameworkCore.Infrastructure[10401] + An 'IServiceProvider' was created for internal use by Entity Framework. +warn: Microsoft.EntityFrameworkCore.Infrastructure[10402] + More than twenty 'IServiceProvider' instances have been created for internal use by Entity Framework. Consider reviewing calls on 'DbContextOptionsBuilder' that may require new service providers to be built. +info: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[0] + User profile is available. Using '/Users/jarednance/.aspnet/DataProtection-Keys' as key repository; keys will not be encrypted at rest. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-b040dd03-33c5-451e-8f42-3c9dd4e0dfec.xml'. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-c8147b66-2deb-407c-9421-1553f0e16d67.xml'. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-f7fa4a09-6d65-426e-a653-cbd2969e5073.xml'. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {b040dd03-33c5-451e-8f42-3c9dd4e0dfec}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {c8147b66-2deb-407c-9421-1553f0e16d67}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {f7fa4a09-6d65-426e-a653-cbd2969e5073}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.DefaultKeyResolver[13] + Considering key {c8147b66-2deb-407c-9421-1553f0e16d67} with expiration date 2018-03-03 16:22:35Z as default key. +dbug: Microsoft.AspNetCore.DataProtection.TypeForwardingActivator[0] + Forwarded activator type request from Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Version=1.1.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60 to Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Culture=neutral, PublicKeyToken=adb9793829ddae60 +dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptorFactory[11] + Using managed symmetric algorithm 'System.Security.Cryptography.Aes'. +dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptorFactory[10] + Using managed keyed hash algorithm 'System.Security.Cryptography.HMACSHA256'. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingProvider[2] + Using key {c8147b66-2deb-407c-9421-1553f0e16d67} as the default key. +dbug: Microsoft.AspNetCore.DataProtection.Internal.DataProtectionStartupFilter[0] + Key ring with default key {c8147b66-2deb-407c-9421-1553f0e16d67} was loaded during application startup. +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[], CommandType='Text', CommandTimeout='30'] + + SELECT CASE WHEN COUNT(*) = 0 THEN FALSE ELSE TRUE END + FROM information_schema.tables + WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema') +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (3ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + + SELECT CASE WHEN COUNT(*) = 0 THEN FALSE ELSE TRUE END + FROM information_schema.tables + WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema') +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[3] + Hosting starting +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[4] + Hosting started +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[0] + Loaded hosting startup assembly JsonApiDotNetCoreExample +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 GET http://localhost/api/v1/people?include=todo-items +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 GET http://localhost/api/v1/people?include=todo-items +dbug: Microsoft.AspNetCore.Routing.Tree.TreeRouter[1] + Request successfully matched the route with name '(null)' and template 'api/v1/people'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.PeopleController.PostAsync (JsonApiDotNetCoreExample)' with id '1eaf2dd2-1dd5-46db-ba6f-88148a37f5ec' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action JsonApiDotNetCoreExample.Controllers.PeopleController.GetAsync (JsonApiDotNetCoreExample) +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.PeopleController.GetAsync (JsonApiDotNetCoreExample) with arguments ((null)) - ModelState is Valid +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.PeopleController.GetAsync (JsonApiDotNetCoreExample) with arguments ((null)) - ModelState is Valid +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Query[10101] + Compiling query model: + '(from Person _2 in DbSet + select [_2]) + .Include("TodoItems") + .Count()' +warn: Microsoft.EntityFrameworkCore.Query[10106] + The Include operation for navigation '[_2].TodoItems' is unnecessary and was ignored because the navigation is not reachable in the final query results. See https://go.microsoft.com/fwlink/?linkid=850303 for more information. +dbug: Microsoft.EntityFrameworkCore.Query[10104] + Optimized query model: + '(from Person _2 in DbSet + select [_2]).Count()' +warn: Microsoft.EntityFrameworkCore.Query[10106] + The Include operation for navigation '[_2].TodoItems' is unnecessary and was ignored because the navigation is not reachable in the final query results. See https://go.microsoft.com/fwlink/?linkid=850303 for more information. +dbug: Microsoft.EntityFrameworkCore.Query[10107] + (QueryContext queryContext) => IAsyncEnumerable _InterceptExceptions( + source: IAsyncEnumerable _ToSequence(Task GetResult( + valueBuffers: IAsyncEnumerable _Query( + queryContext: queryContext, + shaperCommandContext: SelectExpression: + SELECT COUNT(*)::INT4 + FROM "People" AS "p"), + throwOnNullResult: False, + cancellationToken: queryContext.CancellationToken)), + contextType: JsonApiDotNetCoreExample.Data.AppDbContext, + logger: DiagnosticsLogger, + queryContext: queryContext) +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[], CommandType='Text', CommandTimeout='30'] + SELECT COUNT(*)::INT4 + FROM "People" AS "p" +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (8ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + SELECT COUNT(*)::INT4 + FROM "People" AS "p" +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (8ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + SELECT COUNT(*)::INT4 + FROM "People" AS "p" +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +info: JsonApiDotNetCore.Services.EntityResourceService[0] + Applying paging query. Fetching page 0 with 5 entities +dbug: Microsoft.EntityFrameworkCore.Query[10101] + Compiling query model: + '(from Person _3 in DbSet + select [_3]) + .Include("TodoItems") + .Skip(__p_0) + .Take(__p_1)' +warn: Microsoft.EntityFrameworkCore.Query[10102] + Query: '(from Person _3 in DbSet select [_3]).Skip(__p_0).Take(__p_1)' uses a row limiting operation (Skip/Take) without OrderBy which may lead to unpredictable results. +warn: Microsoft.EntityFrameworkCore.Query[10102] + Query: '(from Person _3 in DbSet select [_3]).Skip(__p_0).Take(__p_1)' uses a row limiting operation (Skip/Take) without OrderBy which may lead to unpredictable results. +dbug: Microsoft.EntityFrameworkCore.Query[10105] + Including navigation: '[_3].TodoItems' +dbug: Microsoft.EntityFrameworkCore.Query[10104] + Optimized query model: + '(from Person _3 in DbSet + order by (Nullable)EF.Property(?[_3]?, "Id") asc + select Task _IncludeAsync( + queryContext: queryContext, + entity: [_3], + included: new object[]{ }, + fixup: (QueryContext queryContext | Person entity | Object[] included | CancellationToken ct) => + { + Void queryContext.QueryBuffer.StartTracking( + entity: entity, + entityType: EntityType: Person) + return Task queryContext.QueryBuffer.IncludeCollectionAsync( + includeId: 0, + navigation: Person.TodoItems, + inverseNavigation: TodoItem.Owner, + targetEntityType: EntityType: TodoItem, + clrCollectionAccessor: ClrICollectionAccessor, TodoItem>, + inverseClrPropertySetter: ClrPropertySetter, + tracking: True, + instance: entity, + valuesFactory: (Func>)() => + from TodoItem p.TodoItems in DbSet + join AnonymousObject __3 in + (from Person _3 in DbSet + order by (Nullable)EF.Property(?[_3]?, "Id") asc + select new AnonymousObject(new object[]{ (object)EF.Property(?[_3]?, "Id") })) + .Skip(__p_0) + .Take(__p_1) + on Property([p.TodoItems], "OwnerId") equals (Nullable)object [__3].GetValue(0) + order by object [__3].GetValue(0) asc + select [p.TodoItems], + cancellationToken: ct) + } + , + cancellationToken: ct).Result) + .Skip(__p_0) + .Take(__p_1)' +dbug: Microsoft.EntityFrameworkCore.Query[10107] + (QueryContext queryContext) => IAsyncEnumerable _InterceptExceptions( + source: IAsyncEnumerable _TrackEntities( + results: IAsyncEnumerable _SelectAsync( + source: IAsyncEnumerable _ShapedQuery( + queryContext: queryContext, + shaperCommandContext: SelectExpression: + SELECT "p"."Id", "p"."FirstName", "p"."LastName" + FROM "People" AS "p" + ORDER BY "p"."Id" + LIMIT @__p_1 OFFSET @__p_0, + shaper: BufferedEntityShaper), + selector: (Person _3 | CancellationToken ct) => Task _ExecuteAsync( + taskFactories: new Func>[]{ () => Task _ToObjectTask(Task _IncludeAsync( + queryContext: queryContext, + entity: _3, + included: new object[]{ }, + fixup: (QueryContext queryContext | Person entity | Object[] included | CancellationToken ct) => + { + Void queryContext.QueryBuffer.StartTracking( + entity: entity, + entityType: EntityType: Person) + return Task queryContext.QueryBuffer.IncludeCollectionAsync( + includeId: 0, + navigation: Person.TodoItems, + inverseNavigation: TodoItem.Owner, + targetEntityType: EntityType: TodoItem, + clrCollectionAccessor: ClrICollectionAccessor, TodoItem>, + inverseClrPropertySetter: ClrPropertySetter, + tracking: True, + instance: entity, + valuesFactory: (Func>)() => IAsyncEnumerable _ShapedQuery( + queryContext: queryContext, + shaperCommandContext: SelectExpression: + SELECT "p.TodoItems"."Id", "p.TodoItems"."AchievedDate", "p.TodoItems"."AssigneeId", "p.TodoItems"."CollectionId", "p.TodoItems"."CreatedDate", "p.TodoItems"."Description", "p.TodoItems"."GuidProperty", "p.TodoItems"."Ordinal", "p.TodoItems"."OwnerId" + FROM "TodoItems" AS "p.TodoItems" + INNER JOIN ( + SELECT "p0"."Id" + FROM "People" AS "p0" + ORDER BY "p0"."Id" + LIMIT @__p_1 OFFSET @__p_0 + ) AS "t" ON "p.TodoItems"."OwnerId" = "t"."Id" + ORDER BY "t"."Id", + shaper: BufferedEntityShaper), + cancellationToken: ct) + } + , + cancellationToken: Unhandled parameter: ct)) }, + selector: (Object[] results) => (Person)results[0])), + queryContext: Unhandled parameter: queryContext, + entityTrackingInfos: { itemType: Person }, + entityAccessors: List> + { + Func, + } + ), + contextType: JsonApiDotNetCoreExample.Data.AppDbContext, + logger: DiagnosticsLogger, + queryContext: Unhandled parameter: queryContext) +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@__p_1='?', @__p_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "p"."Id", "p"."FirstName", "p"."LastName" + FROM "People" AS "p" + ORDER BY "p"."Id" + LIMIT @__p_1 OFFSET @__p_0 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (2ms) [Parameters=[@__p_1='?', @__p_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "p"."Id", "p"."FirstName", "p"."LastName" + FROM "People" AS "p" + ORDER BY "p"."Id" + LIMIT @__p_1 OFFSET @__p_0 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (2ms) [Parameters=[@__p_1='?', @__p_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "p"."Id", "p"."FirstName", "p"."LastName" + FROM "People" AS "p" + ORDER BY "p"."Id" + LIMIT @__p_1 OFFSET @__p_0 +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@__p_1='?', @__p_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "p.TodoItems"."Id", "p.TodoItems"."AchievedDate", "p.TodoItems"."AssigneeId", "p.TodoItems"."CollectionId", "p.TodoItems"."CreatedDate", "p.TodoItems"."Description", "p.TodoItems"."GuidProperty", "p.TodoItems"."Ordinal", "p.TodoItems"."OwnerId" + FROM "TodoItems" AS "p.TodoItems" + INNER JOIN ( + SELECT "p0"."Id" + FROM "People" AS "p0" + ORDER BY "p0"."Id" + LIMIT @__p_1 OFFSET @__p_0 + ) AS "t" ON "p.TodoItems"."OwnerId" = "t"."Id" + ORDER BY "t"."Id" +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (2ms) [Parameters=[@__p_1='?', @__p_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "p.TodoItems"."Id", "p.TodoItems"."AchievedDate", "p.TodoItems"."AssigneeId", "p.TodoItems"."CollectionId", "p.TodoItems"."CreatedDate", "p.TodoItems"."Description", "p.TodoItems"."GuidProperty", "p.TodoItems"."Ordinal", "p.TodoItems"."OwnerId" + FROM "TodoItems" AS "p.TodoItems" + INNER JOIN ( + SELECT "p0"."Id" + FROM "People" AS "p0" + ORDER BY "p0"."Id" + LIMIT @__p_1 OFFSET @__p_0 + ) AS "t" ON "p.TodoItems"."OwnerId" = "t"."Id" + ORDER BY "t"."Id" +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (2ms) [Parameters=[@__p_1='?', @__p_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "p.TodoItems"."Id", "p.TodoItems"."AchievedDate", "p.TodoItems"."AssigneeId", "p.TodoItems"."CollectionId", "p.TodoItems"."CreatedDate", "p.TodoItems"."Description", "p.TodoItems"."GuidProperty", "p.TodoItems"."Ordinal", "p.TodoItems"."OwnerId" + FROM "TodoItems" AS "p.TodoItems" + INNER JOIN ( + SELECT "p0"."Id" + FROM "People" AS "p0" + ORDER BY "p0"."Id" + LIMIT @__p_1 OFFSET @__p_0 + ) AS "t" ON "p.TodoItems"."OwnerId" = "t"."Id" + ORDER BY "t"."Id" +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action method JsonApiDotNetCoreExample.Controllers.PeopleController.GetAsync (JsonApiDotNetCoreExample), returned result Microsoft.AspNetCore.Mvc.OkObjectResult. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[4] + No information found on request to perform content negotiation. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[2] + Selected output formatter 'JsonApiDotNetCore.Formatters.JsonApiOutputFormatter' and content type '' to write the response. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: JsonApiDotNetCore.Formatters.JsonApiWriter[0] + Formatting response as JSONAPI +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.PeopleController.GetAsync (JsonApiDotNetCoreExample) in 91.629ms +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.PeopleController.GetAsync (JsonApiDotNetCoreExample) in 91.629ms +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 111.506ms 200 application/vnd.api+json +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 111.506ms 200 application/vnd.api+json +dbug: Microsoft.EntityFrameworkCore.Infrastructure[10401] + An 'IServiceProvider' was created for internal use by Entity Framework. +warn: Microsoft.EntityFrameworkCore.Infrastructure[10402] + More than twenty 'IServiceProvider' instances have been created for internal use by Entity Framework. Consider reviewing calls on 'DbContextOptionsBuilder' that may require new service providers to be built. +: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[0] + User profile is available. Using '/Users/jarednance/.aspnet/DataProtection-Keys' as key repository; keys will not be encrypted at rest. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-b040dd03-33c5-451e-8f42-3c9dd4e0dfec.xml'. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-c8147b66-2deb-407c-9421-1553f0e16d67.xml'. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-f7fa4a09-6d65-426e-a653-cbd2969e5073.xml'. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {b040dd03-33c5-451e-8f42-3c9dd4e0dfec}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {c8147b66-2deb-407c-9421-1553f0e16d67}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {f7fa4a09-6d65-426e-a653-cbd2969e5073}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.DefaultKeyResolver[13] + Considering key {c8147b66-2deb-407c-9421-1553f0e16d67} with expiration date 2018-03-03 16:22:35Z as default key. +dbug: Microsoft.AspNetCore.DataProtection.TypeForwardingActivator[0] + Forwarded activator type request from Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Version=1.1.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60 to Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Culture=neutral, PublicKeyToken=adb9793829ddae60 +dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptorFactory[11] + Using managed symmetric algorithm 'System.Security.Cryptography.Aes'. +dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptorFactory[10] + Using managed keyed hash algorithm 'System.Security.Cryptography.HMACSHA256'. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingProvider[2] + Using key {c8147b66-2deb-407c-9421-1553f0e16d67} as the default key. +dbug: Microsoft.AspNetCore.DataProtection.Internal.DataProtectionStartupFilter[0] + Key ring with default key {c8147b66-2deb-407c-9421-1553f0e16d67} was loaded during application startup. +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[], CommandType='Text', CommandTimeout='30'] + + SELECT CASE WHEN COUNT(*) = 0 THEN FALSE ELSE TRUE END + FROM information_schema.tables + WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema') +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + + SELECT CASE WHEN COUNT(*) = 0 THEN FALSE ELSE TRUE END + FROM information_schema.tables + WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema') +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[3] + Hosting starting +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[4] + Hosting started +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[0] + Loaded hosting startup assembly JsonApiDotNetCoreExample +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 GET http://localhost/api/v1/people +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 GET http://localhost/api/v1/people +dbug: Microsoft.AspNetCore.Routing.Tree.TreeRouter[1] + Request successfully matched the route with name '(null)' and template 'api/v1/people'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.PeopleController.PostAsync (JsonApiDotNetCoreExample)' with id '101783b6-922d-478e-91c4-973fb0212ed5' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action JsonApiDotNetCoreExample.Controllers.PeopleController.GetAsync (JsonApiDotNetCoreExample) +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.PeopleController.GetAsync (JsonApiDotNetCoreExample) with arguments ((null)) - ModelState is Valid +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.PeopleController.GetAsync (JsonApiDotNetCoreExample) with arguments ((null)) - ModelState is Valid +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Query[10101] + Compiling query model: + '(from Person _1 in DbSet + select [_1]).Count()' +dbug: Microsoft.EntityFrameworkCore.Query[10104] + Optimized query model: + '(from Person _1 in DbSet + select [_1]).Count()' +dbug: Microsoft.EntityFrameworkCore.Query[10107] + (QueryContext queryContext) => IAsyncEnumerable _InterceptExceptions( + source: IAsyncEnumerable _ToSequence(Task GetResult( + valueBuffers: IAsyncEnumerable _Query( + queryContext: queryContext, + shaperCommandContext: SelectExpression: + SELECT COUNT(*)::INT4 + FROM "People" AS "p"), + throwOnNullResult: False, + cancellationToken: queryContext.CancellationToken)), + contextType: JsonApiDotNetCoreExample.Data.AppDbContext, + logger: DiagnosticsLogger, + queryContext: queryContext) +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[], CommandType='Text', CommandTimeout='30'] + SELECT COUNT(*)::INT4 + FROM "People" AS "p" +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (26ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + SELECT COUNT(*)::INT4 + FROM "People" AS "p" +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (26ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + SELECT COUNT(*)::INT4 + FROM "People" AS "p" +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +info: JsonApiDotNetCore.Services.EntityResourceService[0] + Applying paging query. Fetching page 0 with 5 entities +dbug: Microsoft.EntityFrameworkCore.Query[10101] + Compiling query model: + '(from Person _2 in DbSet + select [_2]) + .Skip(__p_0) + .Take(__p_1)' +warn: Microsoft.EntityFrameworkCore.Query[10102] + Query: '(from Person _2 in DbSet select [_2]).Skip(__p_0).Take(__p_1)' uses a row limiting operation (Skip/Take) without OrderBy which may lead to unpredictable results. +warn: Microsoft.EntityFrameworkCore.Query[10102] + Query: '(from Person _2 in DbSet select [_2]).Skip(__p_0).Take(__p_1)' uses a row limiting operation (Skip/Take) without OrderBy which may lead to unpredictable results. +dbug: Microsoft.EntityFrameworkCore.Query[10104] + Optimized query model: + '(from Person _2 in DbSet + select [_2]) + .Skip(__p_0) + .Take(__p_1)' +dbug: Microsoft.EntityFrameworkCore.Query[10107] + (QueryContext queryContext) => IAsyncEnumerable _InterceptExceptions( + source: IAsyncEnumerable _TrackEntities( + results: IAsyncEnumerable _ShapedQuery( + queryContext: queryContext, + shaperCommandContext: SelectExpression: + SELECT "p"."Id", "p"."FirstName", "p"."LastName" + FROM "People" AS "p" + LIMIT @__p_1 OFFSET @__p_0, + shaper: UnbufferedEntityShaper), + queryContext: queryContext, + entityTrackingInfos: { itemType: Person }, + entityAccessors: List> + { + Func, + } + ), + contextType: JsonApiDotNetCoreExample.Data.AppDbContext, + logger: DiagnosticsLogger, + queryContext: queryContext) +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@__p_1='?', @__p_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "p"."Id", "p"."FirstName", "p"."LastName" + FROM "People" AS "p" + LIMIT @__p_1 OFFSET @__p_0 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@__p_1='?', @__p_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "p"."Id", "p"."FirstName", "p"."LastName" + FROM "People" AS "p" + LIMIT @__p_1 OFFSET @__p_0 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@__p_1='?', @__p_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "p"."Id", "p"."FirstName", "p"."LastName" + FROM "People" AS "p" + LIMIT @__p_1 OFFSET @__p_0 +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action method JsonApiDotNetCoreExample.Controllers.PeopleController.GetAsync (JsonApiDotNetCoreExample), returned result Microsoft.AspNetCore.Mvc.OkObjectResult. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[4] + No information found on request to perform content negotiation. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[2] + Selected output formatter 'JsonApiDotNetCore.Formatters.JsonApiOutputFormatter' and content type '' to write the response. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: JsonApiDotNetCore.Formatters.JsonApiWriter[0] + Formatting response as JSONAPI +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.PeopleController.GetAsync (JsonApiDotNetCoreExample) in 76.867ms +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.PeopleController.GetAsync (JsonApiDotNetCoreExample) in 76.867ms +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 97.983ms 200 application/vnd.api+json +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 97.983ms 200 application/vnd.api+json +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[], CommandType='Text', CommandTimeout='30'] + SELECT "t"."Id", "t"."AchievedDate", "t"."AssigneeId", "t"."CollectionId", "t"."CreatedDate", "t"."Description", "t"."GuidProperty", "t"."Ordinal", "t"."OwnerId" + FROM "TodoItems" AS "t" +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + SELECT "t"."Id", "t"."AchievedDate", "t"."AssigneeId", "t"."CollectionId", "t"."CreatedDate", "t"."Description", "t"."GuidProperty", "t"."Ordinal", "t"."OwnerId" + FROM "TodoItems" AS "t" +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + SELECT "t"."Id", "t"."AchievedDate", "t"."AssigneeId", "t"."CollectionId", "t"."CreatedDate", "t"."Description", "t"."GuidProperty", "t"."Ordinal", "t"."OwnerId" + FROM "TodoItems" AS "t" +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20200] + Beginning transaction with isolation level 'ReadCommitted'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?'], CommandType='Text', CommandTimeout='30'] + DELETE FROM "TodoItems" + WHERE "Id" = @p0; + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p1, @p2, @p3, @p4, @p5, @p6, @p7) + RETURNING "Id", "CreatedDate"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?'], CommandType='Text', CommandTimeout='30'] + DELETE FROM "TodoItems" + WHERE "Id" = @p0; + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p1, @p2, @p3, @p4, @p5, @p6, @p7) + RETURNING "Id", "CreatedDate"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?'], CommandType='Text', CommandTimeout='30'] + DELETE FROM "TodoItems" + WHERE "Id" = @p0; + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p1, @p2, @p3, @p4, @p5, @p6, @p7) + RETURNING "Id", "CreatedDate"; +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20202] + Committing transaction. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20204] + Disposing transaction. +info: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[0] + User profile is available. Using '/Users/jarednance/.aspnet/DataProtection-Keys' as key repository; keys will not be encrypted at rest. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-b040dd03-33c5-451e-8f42-3c9dd4e0dfec.xml'. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-c8147b66-2deb-407c-9421-1553f0e16d67.xml'. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-f7fa4a09-6d65-426e-a653-cbd2969e5073.xml'. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {b040dd03-33c5-451e-8f42-3c9dd4e0dfec}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {c8147b66-2deb-407c-9421-1553f0e16d67}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {f7fa4a09-6d65-426e-a653-cbd2969e5073}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.DefaultKeyResolver[13] + Considering key {c8147b66-2deb-407c-9421-1553f0e16d67} with expiration date 2018-03-03 16:22:35Z as default key. +dbug: Microsoft.AspNetCore.DataProtection.TypeForwardingActivator[0] + Forwarded activator type request from Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Version=1.1.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60 to Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Culture=neutral, PublicKeyToken=adb9793829ddae60 +dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptorFactory[11] + Using managed symmetric algorithm 'System.Security.Cryptography.Aes'. +dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptorFactory[10] + Using managed keyed hash algorithm 'System.Security.Cryptography.HMACSHA256'. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingProvider[2] + Using key {c8147b66-2deb-407c-9421-1553f0e16d67} as the default key. +dbug: Microsoft.AspNetCore.DataProtection.Internal.DataProtectionStartupFilter[0] + Key ring with default key {c8147b66-2deb-407c-9421-1553f0e16d67} was loaded during application startup. +dbug: Microsoft.EntityFrameworkCore.Infrastructure[10401] + An 'IServiceProvider' was created for internal use by Entity Framework. +warn: Microsoft.EntityFrameworkCore.Infrastructure[10402] + More than twenty 'IServiceProvider' instances have been created for internal use by Entity Framework. Consider reviewing calls on 'DbContextOptionsBuilder' that may require new service providers to be built. +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[], CommandType='Text', CommandTimeout='30'] + + SELECT CASE WHEN COUNT(*) = 0 THEN FALSE ELSE TRUE END + FROM information_schema.tables + WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema') +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (3ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + + SELECT CASE WHEN COUNT(*) = 0 THEN FALSE ELSE TRUE END + FROM information_schema.tables + WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema') +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[3] + Hosting starting +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[4] + Hosting started +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[0] + Loaded hosting startup assembly JsonApiDotNetCoreExampleTests +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 GET http://localhost/api/v1/todo-items +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 GET http://localhost/api/v1/todo-items +dbug: Microsoft.AspNetCore.Routing.Tree.TreeRouter[1] + Request successfully matched the route with name '(null)' and template 'api/v1/todo-items'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.TodoItemsController.PostAsync (JsonApiDotNetCoreExample)' with id '66278d25-d1b4-4a31-8edc-371fd1e02b91' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) with arguments ((null)) - ModelState is Valid +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) with arguments ((null)) - ModelState is Valid +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Query[10101] + Compiling query model: + '(from TodoItem _1 in DbSet + select [_1]).Count()' +dbug: Microsoft.EntityFrameworkCore.Query[10104] + Optimized query model: + '(from TodoItem _1 in DbSet + select [_1]).Count()' +dbug: Microsoft.EntityFrameworkCore.Query[10107] + (QueryContext queryContext) => IAsyncEnumerable _InterceptExceptions( + source: IAsyncEnumerable _ToSequence(Task GetResult( + valueBuffers: IAsyncEnumerable _Query( + queryContext: queryContext, + shaperCommandContext: SelectExpression: + SELECT COUNT(*)::INT4 + FROM "TodoItems" AS "t"), + throwOnNullResult: False, + cancellationToken: queryContext.CancellationToken)), + contextType: JsonApiDotNetCoreExample.Data.AppDbContext, + logger: DiagnosticsLogger, + queryContext: queryContext) +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[], CommandType='Text', CommandTimeout='30'] + SELECT COUNT(*)::INT4 + FROM "TodoItems" AS "t" +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (9ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + SELECT COUNT(*)::INT4 + FROM "TodoItems" AS "t" +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (9ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + SELECT COUNT(*)::INT4 + FROM "TodoItems" AS "t" +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +info: JsonApiDotNetCore.Services.EntityResourceService[0] + Applying paging query. Fetching page 0 with 5 entities +dbug: Microsoft.EntityFrameworkCore.Query[10101] + Compiling query model: + '(from TodoItem _2 in DbSet + select [_2]) + .Skip(__p_0) + .Take(__p_1)' +warn: Microsoft.EntityFrameworkCore.Query[10102] + Query: '(from TodoItem _2 in DbSet select [_2]).Skip(__p_0).Take(__p_1)' uses a row limiting operation (Skip/Take) without OrderBy which may lead to unpredictable results. +warn: Microsoft.EntityFrameworkCore.Query[10102] + Query: '(from TodoItem _2 in DbSet select [_2]).Skip(__p_0).Take(__p_1)' uses a row limiting operation (Skip/Take) without OrderBy which may lead to unpredictable results. +dbug: Microsoft.EntityFrameworkCore.Query[10104] + Optimized query model: + '(from TodoItem _2 in DbSet + select [_2]) + .Skip(__p_0) + .Take(__p_1)' +dbug: Microsoft.EntityFrameworkCore.Query[10107] + (QueryContext queryContext) => IAsyncEnumerable _InterceptExceptions( + source: IAsyncEnumerable _TrackEntities( + results: IAsyncEnumerable _ShapedQuery( + queryContext: queryContext, + shaperCommandContext: SelectExpression: + SELECT "t"."Id", "t"."AchievedDate", "t"."AssigneeId", "t"."CollectionId", "t"."CreatedDate", "t"."Description", "t"."GuidProperty", "t"."Ordinal", "t"."OwnerId" + FROM "TodoItems" AS "t" + LIMIT @__p_1 OFFSET @__p_0, + shaper: UnbufferedEntityShaper), + queryContext: queryContext, + entityTrackingInfos: { itemType: TodoItem }, + entityAccessors: List> + { + Func, + } + ), + contextType: JsonApiDotNetCoreExample.Data.AppDbContext, + logger: DiagnosticsLogger, + queryContext: queryContext) +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@__p_1='?', @__p_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "t"."Id", "t"."AchievedDate", "t"."AssigneeId", "t"."CollectionId", "t"."CreatedDate", "t"."Description", "t"."GuidProperty", "t"."Ordinal", "t"."OwnerId" + FROM "TodoItems" AS "t" + LIMIT @__p_1 OFFSET @__p_0 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@__p_1='?', @__p_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "t"."Id", "t"."AchievedDate", "t"."AssigneeId", "t"."CollectionId", "t"."CreatedDate", "t"."Description", "t"."GuidProperty", "t"."Ordinal", "t"."OwnerId" + FROM "TodoItems" AS "t" + LIMIT @__p_1 OFFSET @__p_0 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@__p_1='?', @__p_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "t"."Id", "t"."AchievedDate", "t"."AssigneeId", "t"."CollectionId", "t"."CreatedDate", "t"."Description", "t"."GuidProperty", "t"."Ordinal", "t"."OwnerId" + FROM "TodoItems" AS "t" + LIMIT @__p_1 OFFSET @__p_0 +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample), returned result Microsoft.AspNetCore.Mvc.OkObjectResult. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[4] + No information found on request to perform content negotiation. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[2] + Selected output formatter 'JsonApiDotNetCore.Formatters.JsonApiOutputFormatter' and content type '' to write the response. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: JsonApiDotNetCore.Formatters.JsonApiWriter[0] + Formatting response as JSONAPI +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) in 51.071ms +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) in 51.071ms +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 73.957ms 200 application/vnd.api+json +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 73.957ms 200 application/vnd.api+json +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[], CommandType='Text', CommandTimeout='30'] + SELECT "t"."Id", "t"."AchievedDate", "t"."AssigneeId", "t"."CollectionId", "t"."CreatedDate", "t"."Description", "t"."GuidProperty", "t"."Ordinal", "t"."OwnerId" + FROM "TodoItems" AS "t" +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + SELECT "t"."Id", "t"."AchievedDate", "t"."AssigneeId", "t"."CollectionId", "t"."CreatedDate", "t"."Description", "t"."GuidProperty", "t"."Ordinal", "t"."OwnerId" + FROM "TodoItems" AS "t" +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + SELECT "t"."Id", "t"."AchievedDate", "t"."AssigneeId", "t"."CollectionId", "t"."CreatedDate", "t"."Description", "t"."GuidProperty", "t"."Ordinal", "t"."OwnerId" + FROM "TodoItems" AS "t" +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20200] + Beginning transaction with isolation level 'ReadCommitted'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?', @p8='?', @p9='?', @p10='?', @p11='?', @p12='?', @p13='?', @p14='?', @p15='?', @p16='?', @p17='?', @p18='?', @p19='?', @p20='?', @p21='?', @p22='?', @p23='?', @p24='?', @p25='?', @p26='?', @p27='?', @p28='?', @p29='?', @p30='?', @p31='?', @p32='?', @p33='?', @p34='?', @p35='?', @p36='?', @p37='?', @p38='?', @p39='?', @p40='?', @p41='?', @p42='?', @p43='?', @p44='?', @p45='?', @p46='?', @p47='?', @p48='?', @p49='?', @p50='?', @p51='?', @p52='?', @p53='?', @p54='?', @p55='?', @p56='?', @p57='?', @p58='?', @p59='?', @p60='?', @p61='?', @p62='?', @p63='?', @p64='?', @p65='?', @p66='?', @p67='?', @p68='?', @p69='?', @p70='?', @p71='?', @p72='?', @p73='?', @p74='?', @p75='?', @p76='?', @p77='?', @p78='?', @p79='?', @p80='?', @p81='?', @p82='?', @p83='?', @p84='?', @p85='?', @p86='?', @p87='?', @p88='?'], CommandType='Text', CommandTimeout='30'] + DELETE FROM "TodoItems" + WHERE "Id" = @p0; + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p1, @p2, @p3, @p4, @p5, @p6, @p7, @p8) + RETURNING "Id"; + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p9, @p10, @p11, @p12, @p13, @p14, @p15, @p16) + RETURNING "Id"; + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p17, @p18, @p19, @p20, @p21, @p22, @p23, @p24) + RETURNING "Id"; + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p25, @p26, @p27, @p28, @p29, @p30, @p31, @p32) + RETURNING "Id"; + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p33, @p34, @p35, @p36, @p37, @p38, @p39, @p40) + RETURNING "Id"; + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p41, @p42, @p43, @p44, @p45, @p46, @p47, @p48) + RETURNING "Id"; + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p49, @p50, @p51, @p52, @p53, @p54, @p55, @p56) + RETURNING "Id"; + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p57, @p58, @p59, @p60, @p61, @p62, @p63, @p64) + RETURNING "Id"; + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p65, @p66, @p67, @p68, @p69, @p70, @p71, @p72) + RETURNING "Id"; + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p73, @p74, @p75, @p76, @p77, @p78, @p79, @p80) + RETURNING "Id"; + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p81, @p82, @p83, @p84, @p85, @p86, @p87, @p88) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (3ms) [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?', @p8='?', @p9='?', @p10='?', @p11='?', @p12='?', @p13='?', @p14='?', @p15='?', @p16='?', @p17='?', @p18='?', @p19='?', @p20='?', @p21='?', @p22='?', @p23='?', @p24='?', @p25='?', @p26='?', @p27='?', @p28='?', @p29='?', @p30='?', @p31='?', @p32='?', @p33='?', @p34='?', @p35='?', @p36='?', @p37='?', @p38='?', @p39='?', @p40='?', @p41='?', @p42='?', @p43='?', @p44='?', @p45='?', @p46='?', @p47='?', @p48='?', @p49='?', @p50='?', @p51='?', @p52='?', @p53='?', @p54='?', @p55='?', @p56='?', @p57='?', @p58='?', @p59='?', @p60='?', @p61='?', @p62='?', @p63='?', @p64='?', @p65='?', @p66='?', @p67='?', @p68='?', @p69='?', @p70='?', @p71='?', @p72='?', @p73='?', @p74='?', @p75='?', @p76='?', @p77='?', @p78='?', @p79='?', @p80='?', @p81='?', @p82='?', @p83='?', @p84='?', @p85='?', @p86='?', @p87='?', @p88='?'], CommandType='Text', CommandTimeout='30'] + DELETE FROM "TodoItems" + WHERE "Id" = @p0; + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p1, @p2, @p3, @p4, @p5, @p6, @p7, @p8) + RETURNING "Id"; + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p9, @p10, @p11, @p12, @p13, @p14, @p15, @p16) + RETURNING "Id"; + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p17, @p18, @p19, @p20, @p21, @p22, @p23, @p24) + RETURNING "Id"; + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p25, @p26, @p27, @p28, @p29, @p30, @p31, @p32) + RETURNING "Id"; + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p33, @p34, @p35, @p36, @p37, @p38, @p39, @p40) + RETURNING "Id"; + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p41, @p42, @p43, @p44, @p45, @p46, @p47, @p48) + RETURNING "Id"; + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p49, @p50, @p51, @p52, @p53, @p54, @p55, @p56) + RETURNING "Id"; + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p57, @p58, @p59, @p60, @p61, @p62, @p63, @p64) + RETURNING "Id"; + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p65, @p66, @p67, @p68, @p69, @p70, @p71, @p72) + RETURNING "Id"; + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p73, @p74, @p75, @p76, @p77, @p78, @p79, @p80) + RETURNING "Id"; + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p81, @p82, @p83, @p84, @p85, @p86, @p87, @p88) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (3ms) [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?', @p8='?', @p9='?', @p10='?', @p11='?', @p12='?', @p13='?', @p14='?', @p15='?', @p16='?', @p17='?', @p18='?', @p19='?', @p20='?', @p21='?', @p22='?', @p23='?', @p24='?', @p25='?', @p26='?', @p27='?', @p28='?', @p29='?', @p30='?', @p31='?', @p32='?', @p33='?', @p34='?', @p35='?', @p36='?', @p37='?', @p38='?', @p39='?', @p40='?', @p41='?', @p42='?', @p43='?', @p44='?', @p45='?', @p46='?', @p47='?', @p48='?', @p49='?', @p50='?', @p51='?', @p52='?', @p53='?', @p54='?', @p55='?', @p56='?', @p57='?', @p58='?', @p59='?', @p60='?', @p61='?', @p62='?', @p63='?', @p64='?', @p65='?', @p66='?', @p67='?', @p68='?', @p69='?', @p70='?', @p71='?', @p72='?', @p73='?', @p74='?', @p75='?', @p76='?', @p77='?', @p78='?', @p79='?', @p80='?', @p81='?', @p82='?', @p83='?', @p84='?', @p85='?', @p86='?', @p87='?', @p88='?'], CommandType='Text', CommandTimeout='30'] + DELETE FROM "TodoItems" + WHERE "Id" = @p0; + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p1, @p2, @p3, @p4, @p5, @p6, @p7, @p8) + RETURNING "Id"; + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p9, @p10, @p11, @p12, @p13, @p14, @p15, @p16) + RETURNING "Id"; + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p17, @p18, @p19, @p20, @p21, @p22, @p23, @p24) + RETURNING "Id"; + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p25, @p26, @p27, @p28, @p29, @p30, @p31, @p32) + RETURNING "Id"; + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p33, @p34, @p35, @p36, @p37, @p38, @p39, @p40) + RETURNING "Id"; + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p41, @p42, @p43, @p44, @p45, @p46, @p47, @p48) + RETURNING "Id"; + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p49, @p50, @p51, @p52, @p53, @p54, @p55, @p56) + RETURNING "Id"; + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p57, @p58, @p59, @p60, @p61, @p62, @p63, @p64) + RETURNING "Id"; + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p65, @p66, @p67, @p68, @p69, @p70, @p71, @p72) + RETURNING "Id"; + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p73, @p74, @p75, @p76, @p77, @p78, @p79, @p80) + RETURNING "Id"; + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p81, @p82, @p83, @p84, @p85, @p86, @p87, @p88) + RETURNING "Id"; +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20202] + Committing transaction. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20204] + Disposing transaction. +dbug: Microsoft.EntityFrameworkCore.Infrastructure[10401] + An 'IServiceProvider' was created for internal use by Entity Framework. +warn: Microsoft.EntityFrameworkCore.Infrastructure[10402] + More than twenty 'IServiceProvider' instances have been created for internal use by Entity Framework. Consider reviewing calls on 'DbContextOptionsBuilder' that may require new service providers to be built. +info: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[0] + User profile is available. Using '/Users/jarednance/.aspnet/DataProtection-Keys' as key repository; keys will not be encrypted at rest. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-b040dd03-33c5-451e-8f42-3c9dd4e0dfec.xml'. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-c8147b66-2deb-407c-9421-1553f0e16d67.xml'. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-f7fa4a09-6d65-426e-a653-cbd2969e5073.xml'. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {b040dd03-33c5-451e-8f42-3c9dd4e0dfec}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {c8147b66-2deb-407c-9421-1553f0e16d67}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {f7fa4a09-6d65-426e-a653-cbd2969e5073}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.DefaultKeyResolver[13] + Considering key {c8147b66-2deb-407c-9421-1553f0e16d67} with expiration date 2018-03-03 16:22:35Z as default key. +dbug: Microsoft.AspNetCore.DataProtection.TypeForwardingActivator[0] + Forwarded activator type request from Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Version=1.1.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60 to Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Culture=neutral, PublicKeyToken=adb9793829ddae60 +dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptorFactory[11] + Using managed symmetric algorithm 'System.Security.Cryptography.Aes'. +dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptorFactory[10] + Using managed keyed hash algorithm 'System.Security.Cryptography.HMACSHA256'. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingProvider[2] + Using key {c8147b66-2deb-407c-9421-1553f0e16d67} as the default key. +dbug: Microsoft.AspNetCore.DataProtection.Internal.DataProtectionStartupFilter[0] + Key ring with default key {c8147b66-2deb-407c-9421-1553f0e16d67} was loaded during application startup. +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[], CommandType='Text', CommandTimeout='30'] + + SELECT CASE WHEN COUNT(*) = 0 THEN FALSE ELSE TRUE END + FROM information_schema.tables + WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema') +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (3ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + + SELECT CASE WHEN COUNT(*) = 0 THEN FALSE ELSE TRUE END + FROM information_schema.tables + WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema') +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[3] + Hosting starting +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[4] + Hosting started +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[0] + Loaded hosting startup assembly JsonApiDotNetCoreExample +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 GET http://localhost/api/v1/todo-items?page[number]=2 +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 GET http://localhost/api/v1/todo-items?page[number]=2 +dbug: Microsoft.AspNetCore.Routing.Tree.TreeRouter[1] + Request successfully matched the route with name '(null)' and template 'api/v1/todo-items'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.TodoItemsController.PostAsync (JsonApiDotNetCoreExample)' with id '29149bf5-e575-4822-ae33-beb5fce2ffc6' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) with arguments ((null)) - ModelState is Valid +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) with arguments ((null)) - ModelState is Valid +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Query[10101] + Compiling query model: + '(from TodoItem _1 in DbSet + select [_1]).Count()' +dbug: Microsoft.EntityFrameworkCore.Query[10104] + Optimized query model: + '(from TodoItem _1 in DbSet + select [_1]).Count()' +dbug: Microsoft.EntityFrameworkCore.Query[10107] + (QueryContext queryContext) => IAsyncEnumerable _InterceptExceptions( + source: IAsyncEnumerable _ToSequence(Task GetResult( + valueBuffers: IAsyncEnumerable _Query( + queryContext: queryContext, + shaperCommandContext: SelectExpression: + SELECT COUNT(*)::INT4 + FROM "TodoItems" AS "t"), + throwOnNullResult: False, + cancellationToken: queryContext.CancellationToken)), + contextType: JsonApiDotNetCoreExample.Data.AppDbContext, + logger: DiagnosticsLogger, + queryContext: queryContext) +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[], CommandType='Text', CommandTimeout='30'] + SELECT COUNT(*)::INT4 + FROM "TodoItems" AS "t" +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (8ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + SELECT COUNT(*)::INT4 + FROM "TodoItems" AS "t" +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (8ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + SELECT COUNT(*)::INT4 + FROM "TodoItems" AS "t" +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +info: JsonApiDotNetCore.Services.EntityResourceService[0] + Applying paging query. Fetching page 2 with 5 entities +dbug: Microsoft.EntityFrameworkCore.Query[10101] + Compiling query model: + '(from TodoItem _2 in DbSet + select [_2]) + .Skip(__p_0) + .Take(__p_1)' +warn: Microsoft.EntityFrameworkCore.Query[10102] + Query: '(from TodoItem _2 in DbSet select [_2]).Skip(__p_0).Take(__p_1)' uses a row limiting operation (Skip/Take) without OrderBy which may lead to unpredictable results. +warn: Microsoft.EntityFrameworkCore.Query[10102] + Query: '(from TodoItem _2 in DbSet select [_2]).Skip(__p_0).Take(__p_1)' uses a row limiting operation (Skip/Take) without OrderBy which may lead to unpredictable results. +dbug: Microsoft.EntityFrameworkCore.Query[10104] + Optimized query model: + '(from TodoItem _2 in DbSet + select [_2]) + .Skip(__p_0) + .Take(__p_1)' +dbug: Microsoft.EntityFrameworkCore.Query[10107] + (QueryContext queryContext) => IAsyncEnumerable _InterceptExceptions( + source: IAsyncEnumerable _TrackEntities( + results: IAsyncEnumerable _ShapedQuery( + queryContext: queryContext, + shaperCommandContext: SelectExpression: + SELECT "t"."Id", "t"."AchievedDate", "t"."AssigneeId", "t"."CollectionId", "t"."CreatedDate", "t"."Description", "t"."GuidProperty", "t"."Ordinal", "t"."OwnerId" + FROM "TodoItems" AS "t" + LIMIT @__p_1 OFFSET @__p_0, + shaper: UnbufferedEntityShaper), + queryContext: queryContext, + entityTrackingInfos: { itemType: TodoItem }, + entityAccessors: List> + { + Func, + } + ), + contextType: JsonApiDotNetCoreExample.Data.AppDbContext, + logger: DiagnosticsLogger, + queryContext: queryContext) +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@__p_1='?', @__p_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "t"."Id", "t"."AchievedDate", "t"."AssigneeId", "t"."CollectionId", "t"."CreatedDate", "t"."Description", "t"."GuidProperty", "t"."Ordinal", "t"."OwnerId" + FROM "TodoItems" AS "t" + LIMIT @__p_1 OFFSET @__p_0 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@__p_1='?', @__p_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "t"."Id", "t"."AchievedDate", "t"."AssigneeId", "t"."CollectionId", "t"."CreatedDate", "t"."Description", "t"."GuidProperty", "t"."Ordinal", "t"."OwnerId" + FROM "TodoItems" AS "t" + LIMIT @__p_1 OFFSET @__p_0 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@__p_1='?', @__p_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "t"."Id", "t"."AchievedDate", "t"."AssigneeId", "t"."CollectionId", "t"."CreatedDate", "t"."Description", "t"."GuidProperty", "t"."Ordinal", "t"."OwnerId" + FROM "TodoItems" AS "t" + LIMIT @__p_1 OFFSET @__p_0 +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample), returned result Microsoft.AspNetCore.Mvc.OkObjectResult. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[4] + No information found on request to perform content negotiation. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[2] + Selected output formatter 'JsonApiDotNetCore.Formatters.JsonApiOutputFormatter' and content type '' to write the response. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: JsonApiDotNetCore.Formatters.JsonApiWriter[0] + Formatting response as JSONAPI +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) in 51.095ms +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 70.672ms 200 application/vnd.api+json +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) in 51.095ms +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 70.672ms 200 application/vnd.api+json +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Query[10101] + Compiling query model: + '(from Person _1 in DbSet + select [_1]).Last()' +dbug: Microsoft.EntityFrameworkCore.Query[10104] + Optimized query model: + '(from Person _1 in DbSet + select [_1]).Last()' +warn: Microsoft.EntityFrameworkCore.Query[20500] + The LINQ expression 'Last()' could not be translated and will be evaluated locally. +warn: Microsoft.EntityFrameworkCore.Query[20500] + The LINQ expression 'Last()' could not be translated and will be evaluated locally. +dbug: Microsoft.EntityFrameworkCore.Query[10107] + (QueryContext queryContext) => IEnumerable _InterceptExceptions( + source: IEnumerable _TrackEntities( + results: IEnumerable _ToSequence(Person Last(IEnumerable _ShapedQuery( + queryContext: queryContext, + shaperCommandContext: SelectExpression: + SELECT "p"."Id", "p"."FirstName", "p"."LastName" + FROM "People" AS "p", + shaper: UnbufferedEntityShaper))), + queryContext: queryContext, + entityTrackingInfos: { itemType: Person }, + entityAccessors: List> + { + Func, + } + ), + contextType: JsonApiDotNetCoreExample.Data.AppDbContext, + logger: DiagnosticsLogger, + queryContext: queryContext) +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[], CommandType='Text', CommandTimeout='30'] + SELECT "p"."Id", "p"."FirstName", "p"."LastName" + FROM "People" AS "p" +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + SELECT "p"."Id", "p"."FirstName", "p"."LastName" + FROM "People" AS "p" +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + SELECT "p"."Id", "p"."FirstName", "p"."LastName" + FROM "People" AS "p" +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Infrastructure[10401] + An 'IServiceProvider' was created for internal use by Entity Framework. +warn: Microsoft.EntityFrameworkCore.Infrastructure[10402] + More than twenty 'IServiceProvider' instances have been created for internal use by Entity Framework. Consider reviewing calls on 'DbContextOptionsBuilder' that may require new service providers to be built. +info: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[0] + User profile is available. Using '/Users/jarednance/.aspnet/DataProtection-Keys' as key repository; keys will not be encrypted at rest. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-b040dd03-33c5-451e-8f42-3c9dd4e0dfec.xml'. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-c8147b66-2deb-407c-9421-1553f0e16d67.xml'. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-f7fa4a09-6d65-426e-a653-cbd2969e5073.xml'. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {b040dd03-33c5-451e-8f42-3c9dd4e0dfec}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {c8147b66-2deb-407c-9421-1553f0e16d67}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {f7fa4a09-6d65-426e-a653-cbd2969e5073}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.DefaultKeyResolver[13] + Considering key {c8147b66-2deb-407c-9421-1553f0e16d67} with expiration date 2018-03-03 16:22:35Z as default key. +dbug: Microsoft.AspNetCore.DataProtection.TypeForwardingActivator[0] + Forwarded activator type request from Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Version=1.1.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60 to Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Culture=neutral, PublicKeyToken=adb9793829ddae60 +dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptorFactory[11] + Using managed symmetric algorithm 'System.Security.Cryptography.Aes'. +dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptorFactory[10] + Using managed keyed hash algorithm 'System.Security.Cryptography.HMACSHA256'. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingProvider[2] + Using key {c8147b66-2deb-407c-9421-1553f0e16d67} as the default key. +dbug: Microsoft.AspNetCore.DataProtection.Internal.DataProtectionStartupFilter[0] + Key ring with default key {c8147b66-2deb-407c-9421-1553f0e16d67} was loaded during application startup. +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[], CommandType='Text', CommandTimeout='30'] + + SELECT CASE WHEN COUNT(*) = 0 THEN FALSE ELSE TRUE END + FROM information_schema.tables + WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema') +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (3ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + + SELECT CASE WHEN COUNT(*) = 0 THEN FALSE ELSE TRUE END + FROM information_schema.tables + WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema') +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[3] + Hosting starting +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[4] + Hosting started +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[0] + Loaded hosting startup assembly JsonApiDotNetCoreExample +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 GET http://localhost/api/v1/people/894 +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 GET http://localhost/api/v1/people/894 +dbug: Microsoft.AspNetCore.Routing.Tree.TreeRouter[1] + Request successfully matched the route with name '(null)' and template 'api/v1/people/{id}'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.PeopleController.PatchAsync (JsonApiDotNetCoreExample)' with id '1d8d8ad3-300b-4985-9917-0527d2f32c84' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.PeopleController.DeleteAsync (JsonApiDotNetCoreExample)' with id '110246c9-516c-4d15-b9ac-04e6d266b51b' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action JsonApiDotNetCoreExample.Controllers.PeopleController.GetAsync (JsonApiDotNetCoreExample) +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.PeopleController.GetAsync (JsonApiDotNetCoreExample) with arguments (894) - ModelState is Valid +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.PeopleController.GetAsync (JsonApiDotNetCoreExample) with arguments (894) - ModelState is Valid +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Query[10101] + Compiling query model: + '(from Person e in DbSet + where bool [e].Id.Equals((object)__id_0) + select [e]).SingleOrDefault()' +dbug: Microsoft.EntityFrameworkCore.Query[10104] + Optimized query model: + '(from Person e in DbSet + where bool [e].Id.Equals((object)__id_0) + select [e]).SingleOrDefault()' +dbug: Microsoft.EntityFrameworkCore.Query[10107] + (QueryContext queryContext) => IAsyncEnumerable _InterceptExceptions( + source: IAsyncEnumerable _TrackEntities( + results: IAsyncEnumerable _ToSequence(Task SingleOrDefault( + source: IAsyncEnumerable _ShapedQuery( + queryContext: queryContext, + shaperCommandContext: SelectExpression: + SELECT "e"."Id", "e"."FirstName", "e"."LastName" + FROM "People" AS "e" + WHERE "e"."Id" = @__id_0 + LIMIT 2, + shaper: UnbufferedEntityShaper), + cancellationToken: queryContext.CancellationToken)), + queryContext: queryContext, + entityTrackingInfos: { itemType: Person }, + entityAccessors: List> + { + Func, + } + ), + contextType: JsonApiDotNetCoreExample.Data.AppDbContext, + logger: DiagnosticsLogger, + queryContext: queryContext) +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "e"."Id", "e"."FirstName", "e"."LastName" + FROM "People" AS "e" + WHERE "e"."Id" = @__id_0 + LIMIT 2 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (10ms) [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "e"."Id", "e"."FirstName", "e"."LastName" + FROM "People" AS "e" + WHERE "e"."Id" = @__id_0 + LIMIT 2 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (10ms) [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "e"."Id", "e"."FirstName", "e"."LastName" + FROM "People" AS "e" + WHERE "e"."Id" = @__id_0 + LIMIT 2 +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action method JsonApiDotNetCoreExample.Controllers.PeopleController.GetAsync (JsonApiDotNetCoreExample), returned result Microsoft.AspNetCore.Mvc.OkObjectResult. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[4] + No information found on request to perform content negotiation. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[2] + Selected output formatter 'JsonApiDotNetCore.Formatters.JsonApiOutputFormatter' and content type '' to write the response. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: JsonApiDotNetCore.Formatters.JsonApiWriter[0] + Formatting response as JSONAPI +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.PeopleController.GetAsync (JsonApiDotNetCoreExample) in 51.526ms +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 72.584ms 200 application/vnd.api+json +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.PeopleController.GetAsync (JsonApiDotNetCoreExample) in 51.526ms +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 72.584ms 200 application/vnd.api+json +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20200] + Beginning transaction with isolation level 'ReadCommitted'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6, @p7) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (2ms) [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6, @p7) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (2ms) [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6, @p7) + RETURNING "Id"; +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20202] + Committing transaction. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20204] + Disposing transaction. +dbug: Microsoft.EntityFrameworkCore.Infrastructure[10401] + An 'IServiceProvider' was created for internal use by Entity Framework. +warn: Microsoft.EntityFrameworkCore.Infrastructure[10402] + More than twenty 'IServiceProvider' instances have been created for internal use by Entity Framework. Consider reviewing calls on 'DbContextOptionsBuilder' that may require new service providers to be built. +info: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[0] + User profile is available. Using '/Users/jarednance/.aspnet/DataProtection-Keys' as key repository; keys will not be encrypted at rest. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-b040dd03-33c5-451e-8f42-3c9dd4e0dfec.xml'. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-c8147b66-2deb-407c-9421-1553f0e16d67.xml'. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-f7fa4a09-6d65-426e-a653-cbd2969e5073.xml'. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {b040dd03-33c5-451e-8f42-3c9dd4e0dfec}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {c8147b66-2deb-407c-9421-1553f0e16d67}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {f7fa4a09-6d65-426e-a653-cbd2969e5073}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.DefaultKeyResolver[13] + Considering key {c8147b66-2deb-407c-9421-1553f0e16d67} with expiration date 2018-03-03 16:22:35Z as default key. +dbug: Microsoft.AspNetCore.DataProtection.TypeForwardingActivator[0] + Forwarded activator type request from Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Version=1.1.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60 to Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Culture=neutral, PublicKeyToken=adb9793829ddae60 +dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptorFactory[11] + Using managed symmetric algorithm 'System.Security.Cryptography.Aes'. +dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptorFactory[10] + Using managed keyed hash algorithm 'System.Security.Cryptography.HMACSHA256'. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingProvider[2] + Using key {c8147b66-2deb-407c-9421-1553f0e16d67} as the default key. +dbug: Microsoft.AspNetCore.DataProtection.Internal.DataProtectionStartupFilter[0] + Key ring with default key {c8147b66-2deb-407c-9421-1553f0e16d67} was loaded during application startup. +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[], CommandType='Text', CommandTimeout='30'] + + SELECT CASE WHEN COUNT(*) = 0 THEN FALSE ELSE TRUE END + FROM information_schema.tables + WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema') +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + + SELECT CASE WHEN COUNT(*) = 0 THEN FALSE ELSE TRUE END + FROM information_schema.tables + WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema') +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[3] + Hosting starting +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[4] + Hosting started +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[0] + Loaded hosting startup assembly JsonApiDotNetCoreExample +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 GET http://localhost/api/v1/todo-items/2647 +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 GET http://localhost/api/v1/todo-items/2647 +dbug: Microsoft.AspNetCore.Routing.Tree.TreeRouter[1] + Request successfully matched the route with name '(null)' and template 'api/v1/todo-items/{id}'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.TodoItemsController.PatchAsync (JsonApiDotNetCoreExample)' with id '5aeb7733-aac0-4b6a-a5b0-622a10aef310' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.TodoItemsController.DeleteAsync (JsonApiDotNetCoreExample)' with id '3b020693-8812-48be-bf1b-028a704a3f50' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) with arguments (2647) - ModelState is Valid +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Query[10101] + Compiling query model: + '(from TodoItem e in DbSet + where bool [e].Id.Equals((object)__id_0) + select [e]).SingleOrDefault()' +dbug: Microsoft.EntityFrameworkCore.Query[10104] + Optimized query model: + '(from TodoItem e in DbSet + where bool [e].Id.Equals((object)__id_0) + select [e]).SingleOrDefault()' +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) with arguments (2647) - ModelState is Valid +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Query[10107] + (QueryContext queryContext) => IAsyncEnumerable _InterceptExceptions( + source: IAsyncEnumerable _TrackEntities( + results: IAsyncEnumerable _ToSequence(Task SingleOrDefault( + source: IAsyncEnumerable _ShapedQuery( + queryContext: queryContext, + shaperCommandContext: SelectExpression: + SELECT "e"."Id", "e"."AchievedDate", "e"."AssigneeId", "e"."CollectionId", "e"."CreatedDate", "e"."Description", "e"."GuidProperty", "e"."Ordinal", "e"."OwnerId" + FROM "TodoItems" AS "e" + WHERE "e"."Id" = @__id_0 + LIMIT 2, + shaper: UnbufferedEntityShaper), + cancellationToken: queryContext.CancellationToken)), + queryContext: queryContext, + entityTrackingInfos: { itemType: TodoItem }, + entityAccessors: List> + { + Func, + } + ), + contextType: JsonApiDotNetCoreExample.Data.AppDbContext, + logger: DiagnosticsLogger, + queryContext: queryContext) +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "e"."Id", "e"."AchievedDate", "e"."AssigneeId", "e"."CollectionId", "e"."CreatedDate", "e"."Description", "e"."GuidProperty", "e"."Ordinal", "e"."OwnerId" + FROM "TodoItems" AS "e" + WHERE "e"."Id" = @__id_0 + LIMIT 2 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "e"."Id", "e"."AchievedDate", "e"."AssigneeId", "e"."CollectionId", "e"."CreatedDate", "e"."Description", "e"."GuidProperty", "e"."Ordinal", "e"."OwnerId" + FROM "TodoItems" AS "e" + WHERE "e"."Id" = @__id_0 + LIMIT 2 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "e"."Id", "e"."AchievedDate", "e"."AssigneeId", "e"."CollectionId", "e"."CreatedDate", "e"."Description", "e"."GuidProperty", "e"."Ordinal", "e"."OwnerId" + FROM "TodoItems" AS "e" + WHERE "e"."Id" = @__id_0 + LIMIT 2 +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample), returned result Microsoft.AspNetCore.Mvc.OkObjectResult. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[4] + No information found on request to perform content negotiation. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[2] + Selected output formatter 'JsonApiDotNetCore.Formatters.JsonApiOutputFormatter' and content type '' to write the response. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: JsonApiDotNetCore.Formatters.JsonApiWriter[0] + Formatting response as JSONAPI +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) in 43.935ms +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) in 43.935ms +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 66.007ms 200 application/vnd.api+json +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 66.007ms 200 application/vnd.api+json +dbug: Microsoft.EntityFrameworkCore.Infrastructure[10401] + An 'IServiceProvider' was created for internal use by Entity Framework. +warn: Microsoft.EntityFrameworkCore.Infrastructure[10402] + More than twenty 'IServiceProvider' instances have been created for internal use by Entity Framework. Consider reviewing calls on 'DbContextOptionsBuilder' that may require new service providers to be built. +info: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[0] + User profile is available. Using '/Users/jarednance/.aspnet/DataProtection-Keys' as key repository; keys will not be encrypted at rest. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-b040dd03-33c5-451e-8f42-3c9dd4e0dfec.xml'. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-c8147b66-2deb-407c-9421-1553f0e16d67.xml'. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-f7fa4a09-6d65-426e-a653-cbd2969e5073.xml'. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {b040dd03-33c5-451e-8f42-3c9dd4e0dfec}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {c8147b66-2deb-407c-9421-1553f0e16d67}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {f7fa4a09-6d65-426e-a653-cbd2969e5073}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.DefaultKeyResolver[13] + Considering key {c8147b66-2deb-407c-9421-1553f0e16d67} with expiration date 2018-03-03 16:22:35Z as default key. +dbug: Microsoft.AspNetCore.DataProtection.TypeForwardingActivator[0] + Forwarded activator type request from Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Version=1.1.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60 to Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Culture=neutral, PublicKeyToken=adb9793829ddae60 +dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptorFactory[11] + Using managed symmetric algorithm 'System.Security.Cryptography.Aes'. +dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptorFactory[10] + Using managed keyed hash algorithm 'System.Security.Cryptography.HMACSHA256'. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingProvider[2] + Using key {c8147b66-2deb-407c-9421-1553f0e16d67} as the default key. +dbug: Microsoft.AspNetCore.DataProtection.Internal.DataProtectionStartupFilter[0] + Key ring with default key {c8147b66-2deb-407c-9421-1553f0e16d67} was loaded during application startup. +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[], CommandType='Text', CommandTimeout='30'] + + SELECT CASE WHEN COUNT(*) = 0 THEN FALSE ELSE TRUE END + FROM information_schema.tables + WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema') +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (3ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + + SELECT CASE WHEN COUNT(*) = 0 THEN FALSE ELSE TRUE END + FROM information_schema.tables + WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema') +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[3] + Hosting starting +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[4] + Hosting started +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[0] + Loaded hosting startup assembly JsonApiDotNetCoreExample +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 GET http://localhost/api/v1/people +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 GET http://localhost/api/v1/people +dbug: Microsoft.AspNetCore.Routing.Tree.TreeRouter[1] + Request successfully matched the route with name '(null)' and template 'api/v1/people'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.PeopleController.PostAsync (JsonApiDotNetCoreExample)' with id '53236a0e-5a42-4405-8697-b363307b0742' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action JsonApiDotNetCoreExample.Controllers.PeopleController.GetAsync (JsonApiDotNetCoreExample) +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.PeopleController.GetAsync (JsonApiDotNetCoreExample) with arguments ((null)) - ModelState is Valid +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.PeopleController.GetAsync (JsonApiDotNetCoreExample) with arguments ((null)) - ModelState is Valid +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Query[10101] + Compiling query model: + '(from Person _1 in DbSet + select [_1]).Count()' +dbug: Microsoft.EntityFrameworkCore.Query[10104] + Optimized query model: + '(from Person _1 in DbSet + select [_1]).Count()' +dbug: Microsoft.EntityFrameworkCore.Query[10107] + (QueryContext queryContext) => IAsyncEnumerable _InterceptExceptions( + source: IAsyncEnumerable _ToSequence(Task GetResult( + valueBuffers: IAsyncEnumerable _Query( + queryContext: queryContext, + shaperCommandContext: SelectExpression: + SELECT COUNT(*)::INT4 + FROM "People" AS "p"), + throwOnNullResult: False, + cancellationToken: queryContext.CancellationToken)), + contextType: JsonApiDotNetCoreExample.Data.AppDbContext, + logger: DiagnosticsLogger, + queryContext: queryContext) +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[], CommandType='Text', CommandTimeout='30'] + SELECT COUNT(*)::INT4 + FROM "People" AS "p" +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + SELECT COUNT(*)::INT4 + FROM "People" AS "p" +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + SELECT COUNT(*)::INT4 + FROM "People" AS "p" +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +info: JsonApiDotNetCore.Services.EntityResourceService[0] + Applying paging query. Fetching page 0 with 5 entities +dbug: Microsoft.EntityFrameworkCore.Query[10101] + Compiling query model: + '(from Person _2 in DbSet + select [_2]) + .Skip(__p_0) + .Take(__p_1)' +warn: Microsoft.EntityFrameworkCore.Query[10102] + Query: '(from Person _2 in DbSet select [_2]).Skip(__p_0).Take(__p_1)' uses a row limiting operation (Skip/Take) without OrderBy which may lead to unpredictable results. +warn: Microsoft.EntityFrameworkCore.Query[10102] + Query: '(from Person _2 in DbSet select [_2]).Skip(__p_0).Take(__p_1)' uses a row limiting operation (Skip/Take) without OrderBy which may lead to unpredictable results. +dbug: Microsoft.EntityFrameworkCore.Query[10104] + Optimized query model: + '(from Person _2 in DbSet + select [_2]) + .Skip(__p_0) + .Take(__p_1)' +dbug: Microsoft.EntityFrameworkCore.Query[10107] + (QueryContext queryContext) => IAsyncEnumerable _InterceptExceptions( + source: IAsyncEnumerable _TrackEntities( + results: IAsyncEnumerable _ShapedQuery( + queryContext: queryContext, + shaperCommandContext: SelectExpression: + SELECT "p"."Id", "p"."FirstName", "p"."LastName" + FROM "People" AS "p" + LIMIT @__p_1 OFFSET @__p_0, + shaper: UnbufferedEntityShaper), + queryContext: queryContext, + entityTrackingInfos: { itemType: Person }, + entityAccessors: List> + { + Func, + } + ), + contextType: JsonApiDotNetCoreExample.Data.AppDbContext, + logger: DiagnosticsLogger, + queryContext: queryContext) +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@__p_1='?', @__p_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "p"."Id", "p"."FirstName", "p"."LastName" + FROM "People" AS "p" + LIMIT @__p_1 OFFSET @__p_0 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@__p_1='?', @__p_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "p"."Id", "p"."FirstName", "p"."LastName" + FROM "People" AS "p" + LIMIT @__p_1 OFFSET @__p_0 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@__p_1='?', @__p_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "p"."Id", "p"."FirstName", "p"."LastName" + FROM "People" AS "p" + LIMIT @__p_1 OFFSET @__p_0 +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action method JsonApiDotNetCoreExample.Controllers.PeopleController.GetAsync (JsonApiDotNetCoreExample), returned result Microsoft.AspNetCore.Mvc.OkObjectResult. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[4] + No information found on request to perform content negotiation. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[2] + Selected output formatter 'JsonApiDotNetCore.Formatters.JsonApiOutputFormatter' and content type '' to write the response. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: JsonApiDotNetCore.Formatters.JsonApiWriter[0] + Formatting response as JSONAPI +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.PeopleController.GetAsync (JsonApiDotNetCoreExample) in 53.752ms +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.PeopleController.GetAsync (JsonApiDotNetCoreExample) in 53.752ms +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 75.703ms 200 application/vnd.api+json +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 75.703ms 200 application/vnd.api+json +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20200] + Beginning transaction with isolation level 'ReadCommitted'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6, @p7) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6, @p7) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6, @p7) + RETURNING "Id"; +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20202] + Committing transaction. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20204] + Disposing transaction. +dbug: Microsoft.EntityFrameworkCore.Infrastructure[10401] + An 'IServiceProvider' was created for internal use by Entity Framework. +warn: Microsoft.EntityFrameworkCore.Infrastructure[10402] + More than twenty 'IServiceProvider' instances have been created for internal use by Entity Framework. Consider reviewing calls on 'DbContextOptionsBuilder' that may require new service providers to be built. +info: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[0] + User profile is available. Using '/Users/jarednance/.aspnet/DataProtection-Keys' as key repository; keys will not be encrypted at rest. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-b040dd03-33c5-451e-8f42-3c9dd4e0dfec.xml'. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-c8147b66-2deb-407c-9421-1553f0e16d67.xml'. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-f7fa4a09-6d65-426e-a653-cbd2969e5073.xml'. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {b040dd03-33c5-451e-8f42-3c9dd4e0dfec}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {c8147b66-2deb-407c-9421-1553f0e16d67}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {f7fa4a09-6d65-426e-a653-cbd2969e5073}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.DefaultKeyResolver[13] + Considering key {c8147b66-2deb-407c-9421-1553f0e16d67} with expiration date 2018-03-03 16:22:35Z as default key. +dbug: Microsoft.AspNetCore.DataProtection.TypeForwardingActivator[0] + Forwarded activator type request from Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Version=1.1.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60 to Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Culture=neutral, PublicKeyToken=adb9793829ddae60 +dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptorFactory[11] + Using managed symmetric algorithm 'System.Security.Cryptography.Aes'. +dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptorFactory[10] + Using managed keyed hash algorithm 'System.Security.Cryptography.HMACSHA256'. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingProvider[2] + Using key {c8147b66-2deb-407c-9421-1553f0e16d67} as the default key. +dbug: Microsoft.AspNetCore.DataProtection.Internal.DataProtectionStartupFilter[0] + Key ring with default key {c8147b66-2deb-407c-9421-1553f0e16d67} was loaded during application startup. +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[], CommandType='Text', CommandTimeout='30'] + + SELECT CASE WHEN COUNT(*) = 0 THEN FALSE ELSE TRUE END + FROM information_schema.tables + WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema') +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (5ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + + SELECT CASE WHEN COUNT(*) = 0 THEN FALSE ELSE TRUE END + FROM information_schema.tables + WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema') +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[3] + Hosting starting +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[4] + Hosting started +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[0] + Loaded hosting startup assembly JsonApiDotNetCoreExample +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 GET http://localhost/api/v1/todo-items/2648 +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 GET http://localhost/api/v1/todo-items/2648 +dbug: Microsoft.AspNetCore.Routing.Tree.TreeRouter[1] + Request successfully matched the route with name '(null)' and template 'api/v1/todo-items/{id}'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.TodoItemsController.PatchAsync (JsonApiDotNetCoreExample)' with id 'bc9f4094-da3f-4b54-a4b5-746a2be25e55' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.TodoItemsController.DeleteAsync (JsonApiDotNetCoreExample)' with id '61e99f52-a4c3-40bd-92cc-955e50e086d9' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) with arguments (2648) - ModelState is Valid +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) with arguments (2648) - ModelState is Valid +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Query[10101] + Compiling query model: + '(from TodoItem e in DbSet + where bool [e].Id.Equals((object)__id_0) + select [e]).SingleOrDefault()' +dbug: Microsoft.EntityFrameworkCore.Query[10104] + Optimized query model: + '(from TodoItem e in DbSet + where bool [e].Id.Equals((object)__id_0) + select [e]).SingleOrDefault()' +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Query[10107] + (QueryContext queryContext) => IAsyncEnumerable _InterceptExceptions( + source: IAsyncEnumerable _TrackEntities( + results: IAsyncEnumerable _ToSequence(Task SingleOrDefault( + source: IAsyncEnumerable _ShapedQuery( + queryContext: queryContext, + shaperCommandContext: SelectExpression: + SELECT "e"."Id", "e"."AchievedDate", "e"."AssigneeId", "e"."CollectionId", "e"."CreatedDate", "e"."Description", "e"."GuidProperty", "e"."Ordinal", "e"."OwnerId" + FROM "TodoItems" AS "e" + WHERE "e"."Id" = @__id_0 + LIMIT 2, + shaper: UnbufferedEntityShaper), + cancellationToken: queryContext.CancellationToken)), + queryContext: queryContext, + entityTrackingInfos: { itemType: TodoItem }, + entityAccessors: List> + { + Func, + } + ), + contextType: JsonApiDotNetCoreExample.Data.AppDbContext, + logger: DiagnosticsLogger, + queryContext: queryContext) +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "e"."Id", "e"."AchievedDate", "e"."AssigneeId", "e"."CollectionId", "e"."CreatedDate", "e"."Description", "e"."GuidProperty", "e"."Ordinal", "e"."OwnerId" + FROM "TodoItems" AS "e" + WHERE "e"."Id" = @__id_0 + LIMIT 2 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "e"."Id", "e"."AchievedDate", "e"."AssigneeId", "e"."CollectionId", "e"."CreatedDate", "e"."Description", "e"."GuidProperty", "e"."Ordinal", "e"."OwnerId" + FROM "TodoItems" AS "e" + WHERE "e"."Id" = @__id_0 + LIMIT 2 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "e"."Id", "e"."AchievedDate", "e"."AssigneeId", "e"."CollectionId", "e"."CreatedDate", "e"."Description", "e"."GuidProperty", "e"."Ordinal", "e"."OwnerId" + FROM "TodoItems" AS "e" + WHERE "e"."Id" = @__id_0 + LIMIT 2 +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample), returned result Microsoft.AspNetCore.Mvc.OkObjectResult. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[4] + No information found on request to perform content negotiation. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[2] + Selected output formatter 'JsonApiDotNetCore.Formatters.JsonApiOutputFormatter' and content type '' to write the response. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: JsonApiDotNetCore.Formatters.JsonApiWriter[0] + Formatting response as JSONAPI +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) in 43.28ms +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) in 43.28ms +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 67.828ms 200 application/vnd.api+json +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 67.828ms 200 application/vnd.api+json +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20200] + Beginning transaction with isolation level 'ReadCommitted'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@p0='?', @p1='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "People" ("FirstName", "LastName") + VALUES (@p0, @p1) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (2ms) [Parameters=[@p0='?', @p1='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "People" ("FirstName", "LastName") + VALUES (@p0, @p1) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (2ms) [Parameters=[@p0='?', @p1='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "People" ("FirstName", "LastName") + VALUES (@p0, @p1) + RETURNING "Id"; +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?', @p8='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p2, @p3, @p4, @p5, @p6, @p7, @p8) + RETURNING "Id", "CreatedDate"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?', @p8='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p2, @p3, @p4, @p5, @p6, @p7, @p8) + RETURNING "Id", "CreatedDate"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?', @p8='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p2, @p3, @p4, @p5, @p6, @p7, @p8) + RETURNING "Id", "CreatedDate"; +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20202] + Committing transaction. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20204] + Disposing transaction. +dbug: Microsoft.EntityFrameworkCore.Infrastructure[10401] + An 'IServiceProvider' was created for internal use by Entity Framework. +warn: Microsoft.EntityFrameworkCore.Infrastructure[10402] + More than twenty 'IServiceProvider' instances have been created for internal use by Entity Framework. Consider reviewing calls on 'DbContextOptionsBuilder' that may require new service providers to be built. +info: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[0] + User profile is available. Using '/Users/jarednance/.aspnet/DataProtection-Keys' as key repository; keys will not be encrypted at rest. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-b040dd03-33c5-451e-8f42-3c9dd4e0dfec.xml'. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-c8147b66-2deb-407c-9421-1553f0e16d67.xml'. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-f7fa4a09-6d65-426e-a653-cbd2969e5073.xml'. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {b040dd03-33c5-451e-8f42-3c9dd4e0dfec}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {c8147b66-2deb-407c-9421-1553f0e16d67}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {f7fa4a09-6d65-426e-a653-cbd2969e5073}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.DefaultKeyResolver[13] + Considering key {c8147b66-2deb-407c-9421-1553f0e16d67} with expiration date 2018-03-03 16:22:35Z as default key. +dbug: Microsoft.AspNetCore.DataProtection.TypeForwardingActivator[0] + Forwarded activator type request from Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Version=1.1.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60 to Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Culture=neutral, PublicKeyToken=adb9793829ddae60 +dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptorFactory[11] + Using managed symmetric algorithm 'System.Security.Cryptography.Aes'. +dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptorFactory[10] + Using managed keyed hash algorithm 'System.Security.Cryptography.HMACSHA256'. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingProvider[2] + Using key {c8147b66-2deb-407c-9421-1553f0e16d67} as the default key. +dbug: Microsoft.AspNetCore.DataProtection.Internal.DataProtectionStartupFilter[0] + Key ring with default key {c8147b66-2deb-407c-9421-1553f0e16d67} was loaded during application startup. +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[], CommandType='Text', CommandTimeout='30'] + + SELECT CASE WHEN COUNT(*) = 0 THEN FALSE ELSE TRUE END + FROM information_schema.tables + WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema') +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (3ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + + SELECT CASE WHEN COUNT(*) = 0 THEN FALSE ELSE TRUE END + FROM information_schema.tables + WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema') +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[3] + Hosting starting +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[4] + Hosting started +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[0] + Loaded hosting startup assembly JsonApiDotNetCoreExample +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 GET http://localhost/custom/route/todo-items/2649 +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 GET http://localhost/custom/route/todo-items/2649 +dbug: Microsoft.AspNetCore.Routing.Tree.TreeRouter[1] + Request successfully matched the route with name '(null)' and template 'custom/route/todo-items/{id}'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.TodoItemsCustomController.PatchAsync (JsonApiDotNetCoreExample)' with id '81b735cc-1698-4dd5-a086-6eda734699c0' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.TodoItemsCustomController.DeleteAsync (JsonApiDotNetCoreExample)' with id '2d84b987-9823-450c-982d-b63abe1024f7' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action JsonApiDotNetCoreExample.Controllers.TodoItemsCustomController.GetAsync (JsonApiDotNetCoreExample) +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.TodoItemsCustomController.GetAsync (JsonApiDotNetCoreExample) with arguments (2649) - ModelState is Valid +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.TodoItemsCustomController.GetAsync (JsonApiDotNetCoreExample) with arguments (2649) - ModelState is Valid +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Query[10101] + Compiling query model: + '(from TodoItem e in DbSet + where bool [e].Id.Equals((object)__id_0) + select [e]).SingleOrDefault()' +dbug: Microsoft.EntityFrameworkCore.Query[10104] + Optimized query model: + '(from TodoItem e in DbSet + where bool [e].Id.Equals((object)__id_0) + select [e]).SingleOrDefault()' +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Query[10107] + (QueryContext queryContext) => IAsyncEnumerable _InterceptExceptions( + source: IAsyncEnumerable _TrackEntities( + results: IAsyncEnumerable _ToSequence(Task SingleOrDefault( + source: IAsyncEnumerable _ShapedQuery( + queryContext: queryContext, + shaperCommandContext: SelectExpression: + SELECT "e"."Id", "e"."AchievedDate", "e"."AssigneeId", "e"."CollectionId", "e"."CreatedDate", "e"."Description", "e"."GuidProperty", "e"."Ordinal", "e"."OwnerId" + FROM "TodoItems" AS "e" + WHERE "e"."Id" = @__id_0 + LIMIT 2, + shaper: UnbufferedEntityShaper), + cancellationToken: queryContext.CancellationToken)), + queryContext: queryContext, + entityTrackingInfos: { itemType: TodoItem }, + entityAccessors: List> + { + Func, + } + ), + contextType: JsonApiDotNetCoreExample.Data.AppDbContext, + logger: DiagnosticsLogger, + queryContext: queryContext) +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "e"."Id", "e"."AchievedDate", "e"."AssigneeId", "e"."CollectionId", "e"."CreatedDate", "e"."Description", "e"."GuidProperty", "e"."Ordinal", "e"."OwnerId" + FROM "TodoItems" AS "e" + WHERE "e"."Id" = @__id_0 + LIMIT 2 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (2ms) [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "e"."Id", "e"."AchievedDate", "e"."AssigneeId", "e"."CollectionId", "e"."CreatedDate", "e"."Description", "e"."GuidProperty", "e"."Ordinal", "e"."OwnerId" + FROM "TodoItems" AS "e" + WHERE "e"."Id" = @__id_0 + LIMIT 2 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (2ms) [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "e"."Id", "e"."AchievedDate", "e"."AssigneeId", "e"."CollectionId", "e"."CreatedDate", "e"."Description", "e"."GuidProperty", "e"."Ordinal", "e"."OwnerId" + FROM "TodoItems" AS "e" + WHERE "e"."Id" = @__id_0 + LIMIT 2 +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action method JsonApiDotNetCoreExample.Controllers.TodoItemsCustomController.GetAsync (JsonApiDotNetCoreExample), returned result Microsoft.AspNetCore.Mvc.OkObjectResult. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[4] + No information found on request to perform content negotiation. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[2] + Selected output formatter 'JsonApiDotNetCore.Formatters.JsonApiOutputFormatter' and content type '' to write the response. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: JsonApiDotNetCore.Formatters.JsonApiWriter[0] + Formatting response as JSONAPI +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.TodoItemsCustomController.GetAsync (JsonApiDotNetCoreExample) in 39.12ms +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.TodoItemsCustomController.GetAsync (JsonApiDotNetCoreExample) in 39.12ms +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 60.789ms 200 application/vnd.api+json +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 60.789ms 200 application/vnd.api+json +dbug: Microsoft.EntityFrameworkCore.Infrastructure[10401] + An 'IServiceProvider' was created for internal use by Entity Framework. +warn: Microsoft.EntityFrameworkCore.Infrastructure[10402] + More than twenty 'IServiceProvider' instances have been created for internal use by Entity Framework. Consider reviewing calls on 'DbContextOptionsBuilder' that may require new service providers to be built. +info: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[0] + User profile is available. Using '/Users/jarednance/.aspnet/DataProtection-Keys' as key repository; keys will not be encrypted at rest. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-b040dd03-33c5-451e-8f42-3c9dd4e0dfec.xml'. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-c8147b66-2deb-407c-9421-1553f0e16d67.xml'. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-f7fa4a09-6d65-426e-a653-cbd2969e5073.xml'. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {b040dd03-33c5-451e-8f42-3c9dd4e0dfec}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {c8147b66-2deb-407c-9421-1553f0e16d67}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {f7fa4a09-6d65-426e-a653-cbd2969e5073}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.DefaultKeyResolver[13] + Considering key {c8147b66-2deb-407c-9421-1553f0e16d67} with expiration date 2018-03-03 16:22:35Z as default key. +dbug: Microsoft.AspNetCore.DataProtection.TypeForwardingActivator[0] + Forwarded activator type request from Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Version=1.1.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60 to Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Culture=neutral, PublicKeyToken=adb9793829ddae60 +dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptorFactory[11] + Using managed symmetric algorithm 'System.Security.Cryptography.Aes'. +dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptorFactory[10] + Using managed keyed hash algorithm 'System.Security.Cryptography.HMACSHA256'. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingProvider[2] + Using key {c8147b66-2deb-407c-9421-1553f0e16d67} as the default key. +dbug: Microsoft.AspNetCore.DataProtection.Internal.DataProtectionStartupFilter[0] + Key ring with default key {c8147b66-2deb-407c-9421-1553f0e16d67} was loaded during application startup. +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[], CommandType='Text', CommandTimeout='30'] + + SELECT CASE WHEN COUNT(*) = 0 THEN FALSE ELSE TRUE END + FROM information_schema.tables + WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema') +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (2ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + + SELECT CASE WHEN COUNT(*) = 0 THEN FALSE ELSE TRUE END + FROM information_schema.tables + WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema') +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[3] + Hosting starting +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[4] + Hosting started +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[0] + Loaded hosting startup assembly JsonApiDotNetCoreExample +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 GET http://localhost/testValues +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 GET http://localhost/testValues +dbug: Microsoft.AspNetCore.Routing.Tree.TreeRouter[1] + Request successfully matched the route with name '(null)' and template 'TestValues'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action JsonApiDotNetCoreExample.Controllers.TestValuesController.Get (JsonApiDotNetCoreExample) +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.TestValuesController.Get (JsonApiDotNetCoreExample) with arguments ((null)) - ModelState is Valid +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.TestValuesController.Get (JsonApiDotNetCoreExample) with arguments ((null)) - ModelState is Valid +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action method JsonApiDotNetCoreExample.Controllers.TestValuesController.Get (JsonApiDotNetCoreExample), returned result Microsoft.AspNetCore.Mvc.OkObjectResult. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[4] + No information found on request to perform content negotiation. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[2] + Selected output formatter 'JsonApiDotNetCore.Formatters.JsonApiOutputFormatter' and content type '' to write the response. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: JsonApiDotNetCore.Formatters.JsonApiWriter[0] + Formatting response as JSONAPI +info: JsonApiDotNetCore.Serialization.JsonApiSerializer[0] + Response was not a JSONAPI entity. Serializing as plain JSON. +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.TestValuesController.Get (JsonApiDotNetCoreExample) in 1.407ms +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 32.217ms 200 application/vnd.api+json +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.TestValuesController.Get (JsonApiDotNetCoreExample) in 1.407ms +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 32.217ms 200 application/vnd.api+json +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20200] + Beginning transaction with isolation level 'ReadCommitted'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@p0='?', @p1='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "People" ("FirstName", "LastName") + VALUES (@p0, @p1) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (6ms) [Parameters=[@p0='?', @p1='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "People" ("FirstName", "LastName") + VALUES (@p0, @p1) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (6ms) [Parameters=[@p0='?', @p1='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "People" ("FirstName", "LastName") + VALUES (@p0, @p1) + RETURNING "Id"; +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?', @p8='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p2, @p3, @p4, @p5, @p6, @p7, @p8) + RETURNING "Id", "CreatedDate"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?', @p8='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p2, @p3, @p4, @p5, @p6, @p7, @p8) + RETURNING "Id", "CreatedDate"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?', @p8='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p2, @p3, @p4, @p5, @p6, @p7, @p8) + RETURNING "Id", "CreatedDate"; +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20202] + Committing transaction. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20204] + Disposing transaction. +dbug: Microsoft.EntityFrameworkCore.Infrastructure[10401] + An 'IServiceProvider' was created for internal use by Entity Framework. +warn: Microsoft.EntityFrameworkCore.Infrastructure[10402] + More than twenty 'IServiceProvider' instances have been created for internal use by Entity Framework. Consider reviewing calls on 'DbContextOptionsBuilder' that may require new service providers to be built. +info: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[0] + User profile is available. Using '/Users/jarednance/.aspnet/DataProtection-Keys' as key repository; keys will not be encrypted at rest. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-b040dd03-33c5-451e-8f42-3c9dd4e0dfec.xml'. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-c8147b66-2deb-407c-9421-1553f0e16d67.xml'. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-f7fa4a09-6d65-426e-a653-cbd2969e5073.xml'. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {b040dd03-33c5-451e-8f42-3c9dd4e0dfec}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {c8147b66-2deb-407c-9421-1553f0e16d67}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {f7fa4a09-6d65-426e-a653-cbd2969e5073}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.DefaultKeyResolver[13] + Considering key {c8147b66-2deb-407c-9421-1553f0e16d67} with expiration date 2018-03-03 16:22:35Z as default key. +dbug: Microsoft.AspNetCore.DataProtection.TypeForwardingActivator[0] + Forwarded activator type request from Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Version=1.1.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60 to Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Culture=neutral, PublicKeyToken=adb9793829ddae60 +dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptorFactory[11] + Using managed symmetric algorithm 'System.Security.Cryptography.Aes'. +dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptorFactory[10] + Using managed keyed hash algorithm 'System.Security.Cryptography.HMACSHA256'. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingProvider[2] + Using key {c8147b66-2deb-407c-9421-1553f0e16d67} as the default key. +dbug: Microsoft.AspNetCore.DataProtection.Internal.DataProtectionStartupFilter[0] + Key ring with default key {c8147b66-2deb-407c-9421-1553f0e16d67} was loaded during application startup. +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[], CommandType='Text', CommandTimeout='30'] + + SELECT CASE WHEN COUNT(*) = 0 THEN FALSE ELSE TRUE END + FROM information_schema.tables + WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema') +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + + SELECT CASE WHEN COUNT(*) = 0 THEN FALSE ELSE TRUE END + FROM information_schema.tables + WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema') +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[3] + Hosting starting +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[4] + Hosting started +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[0] + Loaded hosting startup assembly JsonApiDotNetCoreExample +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 GET http://localhost/custom/route/todo-items/2650 +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 GET http://localhost/custom/route/todo-items/2650 +dbug: Microsoft.AspNetCore.Routing.Tree.TreeRouter[1] + Request successfully matched the route with name '(null)' and template 'custom/route/todo-items/{id}'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.TodoItemsCustomController.PatchAsync (JsonApiDotNetCoreExample)' with id '49ee8a92-89ed-4f38-906c-31ab8083271c' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.TodoItemsCustomController.DeleteAsync (JsonApiDotNetCoreExample)' with id '744dcbe5-efca-479f-bb8f-d7e1c104d561' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action JsonApiDotNetCoreExample.Controllers.TodoItemsCustomController.GetAsync (JsonApiDotNetCoreExample) +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.TodoItemsCustomController.GetAsync (JsonApiDotNetCoreExample) with arguments (2650) - ModelState is Valid +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Query[10101] + Compiling query model: + '(from TodoItem e in DbSet + where bool [e].Id.Equals((object)__id_0) + select [e]).SingleOrDefault()' +dbug: Microsoft.EntityFrameworkCore.Query[10104] + Optimized query model: + '(from TodoItem e in DbSet + where bool [e].Id.Equals((object)__id_0) + select [e]).SingleOrDefault()' +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.TodoItemsCustomController.GetAsync (JsonApiDotNetCoreExample) with arguments (2650) - ModelState is Valid +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Query[10107] + (QueryContext queryContext) => IAsyncEnumerable _InterceptExceptions( + source: IAsyncEnumerable _TrackEntities( + results: IAsyncEnumerable _ToSequence(Task SingleOrDefault( + source: IAsyncEnumerable _ShapedQuery( + queryContext: queryContext, + shaperCommandContext: SelectExpression: + SELECT "e"."Id", "e"."AchievedDate", "e"."AssigneeId", "e"."CollectionId", "e"."CreatedDate", "e"."Description", "e"."GuidProperty", "e"."Ordinal", "e"."OwnerId" + FROM "TodoItems" AS "e" + WHERE "e"."Id" = @__id_0 + LIMIT 2, + shaper: UnbufferedEntityShaper), + cancellationToken: queryContext.CancellationToken)), + queryContext: queryContext, + entityTrackingInfos: { itemType: TodoItem }, + entityAccessors: List> + { + Func, + } + ), + contextType: JsonApiDotNetCoreExample.Data.AppDbContext, + logger: DiagnosticsLogger, + queryContext: queryContext) +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "e"."Id", "e"."AchievedDate", "e"."AssigneeId", "e"."CollectionId", "e"."CreatedDate", "e"."Description", "e"."GuidProperty", "e"."Ordinal", "e"."OwnerId" + FROM "TodoItems" AS "e" + WHERE "e"."Id" = @__id_0 + LIMIT 2 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "e"."Id", "e"."AchievedDate", "e"."AssigneeId", "e"."CollectionId", "e"."CreatedDate", "e"."Description", "e"."GuidProperty", "e"."Ordinal", "e"."OwnerId" + FROM "TodoItems" AS "e" + WHERE "e"."Id" = @__id_0 + LIMIT 2 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "e"."Id", "e"."AchievedDate", "e"."AssigneeId", "e"."CollectionId", "e"."CreatedDate", "e"."Description", "e"."GuidProperty", "e"."Ordinal", "e"."OwnerId" + FROM "TodoItems" AS "e" + WHERE "e"."Id" = @__id_0 + LIMIT 2 +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action method JsonApiDotNetCoreExample.Controllers.TodoItemsCustomController.GetAsync (JsonApiDotNetCoreExample), returned result Microsoft.AspNetCore.Mvc.OkObjectResult. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[4] + No information found on request to perform content negotiation. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[2] + Selected output formatter 'JsonApiDotNetCore.Formatters.JsonApiOutputFormatter' and content type '' to write the response. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: JsonApiDotNetCore.Formatters.JsonApiWriter[0] + Formatting response as JSONAPI +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.TodoItemsCustomController.GetAsync (JsonApiDotNetCoreExample) in 43.411ms +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.TodoItemsCustomController.GetAsync (JsonApiDotNetCoreExample) in 43.411ms +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 65.45ms 200 application/vnd.api+json +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 65.45ms 200 application/vnd.api+json +dbug: Microsoft.EntityFrameworkCore.Infrastructure[10401] + An 'IServiceProvider' was created for internal use by Entity Framework. +warn: Microsoft.EntityFrameworkCore.Infrastructure[10402] + More than twenty 'IServiceProvider' instances have been created for internal use by Entity Framework. Consider reviewing calls on 'DbContextOptionsBuilder' that may require new service providers to be built. +info: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[0] + User profile is available. Using '/Users/jarednance/.aspnet/DataProtection-Keys' as key repository; keys will not be encrypted at rest. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-b040dd03-33c5-451e-8f42-3c9dd4e0dfec.xml'. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-c8147b66-2deb-407c-9421-1553f0e16d67.xml'. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-f7fa4a09-6d65-426e-a653-cbd2969e5073.xml'. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {b040dd03-33c5-451e-8f42-3c9dd4e0dfec}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {c8147b66-2deb-407c-9421-1553f0e16d67}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {f7fa4a09-6d65-426e-a653-cbd2969e5073}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.DefaultKeyResolver[13] + Considering key {c8147b66-2deb-407c-9421-1553f0e16d67} with expiration date 2018-03-03 16:22:35Z as default key. +dbug: Microsoft.AspNetCore.DataProtection.TypeForwardingActivator[0] + Forwarded activator type request from Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Version=1.1.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60 to Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Culture=neutral, PublicKeyToken=adb9793829ddae60 +dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptorFactory[11] + Using managed symmetric algorithm 'System.Security.Cryptography.Aes'. +dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptorFactory[10] + Using managed keyed hash algorithm 'System.Security.Cryptography.HMACSHA256'. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingProvider[2] + Using key {c8147b66-2deb-407c-9421-1553f0e16d67} as the default key. +dbug: Microsoft.AspNetCore.DataProtection.Internal.DataProtectionStartupFilter[0] + Key ring with default key {c8147b66-2deb-407c-9421-1553f0e16d67} was loaded during application startup. +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[], CommandType='Text', CommandTimeout='30'] + + SELECT CASE WHEN COUNT(*) = 0 THEN FALSE ELSE TRUE END + FROM information_schema.tables + WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema') +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (3ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + + SELECT CASE WHEN COUNT(*) = 0 THEN FALSE ELSE TRUE END + FROM information_schema.tables + WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema') +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[3] + Hosting starting +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[4] + Hosting started +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[0] + Loaded hosting startup assembly JsonApiDotNetCoreExample +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 GET http://localhost/custom/route/todo-items +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 GET http://localhost/custom/route/todo-items +dbug: Microsoft.AspNetCore.Routing.Tree.TreeRouter[1] + Request successfully matched the route with name '(null)' and template 'custom/route/todo-items'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.TodoItemsCustomController.PostAsync (JsonApiDotNetCoreExample)' with id '38524268-32e2-49e7-872f-c4f51a0ad8cc' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action JsonApiDotNetCoreExample.Controllers.TodoItemsCustomController.GetAsync (JsonApiDotNetCoreExample) +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.TodoItemsCustomController.GetAsync (JsonApiDotNetCoreExample) with arguments ((null)) - ModelState is Valid +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.TodoItemsCustomController.GetAsync (JsonApiDotNetCoreExample) with arguments ((null)) - ModelState is Valid +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Query[10101] + Compiling query model: + '(from TodoItem _1 in DbSet + select [_1]).Count()' +dbug: Microsoft.EntityFrameworkCore.Query[10104] + Optimized query model: + '(from TodoItem _1 in DbSet + select [_1]).Count()' +dbug: Microsoft.EntityFrameworkCore.Query[10107] + (QueryContext queryContext) => IAsyncEnumerable _InterceptExceptions( + source: IAsyncEnumerable _ToSequence(Task GetResult( + valueBuffers: IAsyncEnumerable _Query( + queryContext: queryContext, + shaperCommandContext: SelectExpression: + SELECT COUNT(*)::INT4 + FROM "TodoItems" AS "t"), + throwOnNullResult: False, + cancellationToken: queryContext.CancellationToken)), + contextType: JsonApiDotNetCoreExample.Data.AppDbContext, + logger: DiagnosticsLogger, + queryContext: queryContext) +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[], CommandType='Text', CommandTimeout='30'] + SELECT COUNT(*)::INT4 + FROM "TodoItems" AS "t" +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (10ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + SELECT COUNT(*)::INT4 + FROM "TodoItems" AS "t" +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (10ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + SELECT COUNT(*)::INT4 + FROM "TodoItems" AS "t" +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +info: JsonApiDotNetCore.Services.EntityResourceService[0] + Applying paging query. Fetching page 0 with 5 entities +dbug: Microsoft.EntityFrameworkCore.Query[10101] + Compiling query model: + '(from TodoItem _2 in DbSet + select [_2]) + .Skip(__p_0) + .Take(__p_1)' +warn: Microsoft.EntityFrameworkCore.Query[10102] + Query: '(from TodoItem _2 in DbSet select [_2]).Skip(__p_0).Take(__p_1)' uses a row limiting operation (Skip/Take) without OrderBy which may lead to unpredictable results. +warn: Microsoft.EntityFrameworkCore.Query[10102] + Query: '(from TodoItem _2 in DbSet select [_2]).Skip(__p_0).Take(__p_1)' uses a row limiting operation (Skip/Take) without OrderBy which may lead to unpredictable results. +dbug: Microsoft.EntityFrameworkCore.Query[10104] + Optimized query model: + '(from TodoItem _2 in DbSet + select [_2]) + .Skip(__p_0) + .Take(__p_1)' +dbug: Microsoft.EntityFrameworkCore.Query[10107] + (QueryContext queryContext) => IAsyncEnumerable _InterceptExceptions( + source: IAsyncEnumerable _TrackEntities( + results: IAsyncEnumerable _ShapedQuery( + queryContext: queryContext, + shaperCommandContext: SelectExpression: + SELECT "t"."Id", "t"."AchievedDate", "t"."AssigneeId", "t"."CollectionId", "t"."CreatedDate", "t"."Description", "t"."GuidProperty", "t"."Ordinal", "t"."OwnerId" + FROM "TodoItems" AS "t" + LIMIT @__p_1 OFFSET @__p_0, + shaper: UnbufferedEntityShaper), + queryContext: queryContext, + entityTrackingInfos: { itemType: TodoItem }, + entityAccessors: List> + { + Func, + } + ), + contextType: JsonApiDotNetCoreExample.Data.AppDbContext, + logger: DiagnosticsLogger, + queryContext: queryContext) +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@__p_1='?', @__p_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "t"."Id", "t"."AchievedDate", "t"."AssigneeId", "t"."CollectionId", "t"."CreatedDate", "t"."Description", "t"."GuidProperty", "t"."Ordinal", "t"."OwnerId" + FROM "TodoItems" AS "t" + LIMIT @__p_1 OFFSET @__p_0 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@__p_1='?', @__p_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "t"."Id", "t"."AchievedDate", "t"."AssigneeId", "t"."CollectionId", "t"."CreatedDate", "t"."Description", "t"."GuidProperty", "t"."Ordinal", "t"."OwnerId" + FROM "TodoItems" AS "t" + LIMIT @__p_1 OFFSET @__p_0 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@__p_1='?', @__p_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "t"."Id", "t"."AchievedDate", "t"."AssigneeId", "t"."CollectionId", "t"."CreatedDate", "t"."Description", "t"."GuidProperty", "t"."Ordinal", "t"."OwnerId" + FROM "TodoItems" AS "t" + LIMIT @__p_1 OFFSET @__p_0 +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action method JsonApiDotNetCoreExample.Controllers.TodoItemsCustomController.GetAsync (JsonApiDotNetCoreExample), returned result Microsoft.AspNetCore.Mvc.OkObjectResult. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[4] + No information found on request to perform content negotiation. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[2] + Selected output formatter 'JsonApiDotNetCore.Formatters.JsonApiOutputFormatter' and content type '' to write the response. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: JsonApiDotNetCore.Formatters.JsonApiWriter[0] + Formatting response as JSONAPI +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.TodoItemsCustomController.GetAsync (JsonApiDotNetCoreExample) in 54.945ms +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.TodoItemsCustomController.GetAsync (JsonApiDotNetCoreExample) in 54.945ms +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 69.838ms 200 application/vnd.api+json +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 69.838ms 200 application/vnd.api+json +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20200] + Beginning transaction with isolation level 'ReadCommitted'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6, @p7) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6, @p7) + RETURNING "Id"; +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6, @p7) + RETURNING "Id"; +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20202] + Committing transaction. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20204] + Disposing transaction. +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 GET http://localhost/api/v1/todo-items/2651?omitNullValuedAttributes=true +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 GET http://localhost/api/v1/todo-items/2651?omitNullValuedAttributes=true +dbug: Microsoft.AspNetCore.Routing.Tree.TreeRouter[1] + Request successfully matched the route with name '(null)' and template 'api/v1/todo-items/{id}'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.TodoItemsController.PatchAsync (JsonApiDotNetCoreExample)' with id '1ee61db8-daf4-41f3-90d2-1cf3db87d448' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.TodoItemsController.DeleteAsync (JsonApiDotNetCoreExample)' with id '75ab2821-99d0-4a3f-9dbb-3747ee7b296e' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) with arguments (2651) - ModelState is Valid +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) with arguments (2651) - ModelState is Valid +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "e"."Id", "e"."AchievedDate", "e"."AssigneeId", "e"."CollectionId", "e"."CreatedDate", "e"."Description", "e"."GuidProperty", "e"."Ordinal", "e"."OwnerId" + FROM "TodoItems" AS "e" + WHERE "e"."Id" = @__id_0 + LIMIT 2 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "e"."Id", "e"."AchievedDate", "e"."AssigneeId", "e"."CollectionId", "e"."CreatedDate", "e"."Description", "e"."GuidProperty", "e"."Ordinal", "e"."OwnerId" + FROM "TodoItems" AS "e" + WHERE "e"."Id" = @__id_0 + LIMIT 2 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "e"."Id", "e"."AchievedDate", "e"."AssigneeId", "e"."CollectionId", "e"."CreatedDate", "e"."Description", "e"."GuidProperty", "e"."Ordinal", "e"."OwnerId" + FROM "TodoItems" AS "e" + WHERE "e"."Id" = @__id_0 + LIMIT 2 +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample), returned result Microsoft.AspNetCore.Mvc.OkObjectResult. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[4] + No information found on request to perform content negotiation. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[2] + Selected output formatter 'JsonApiDotNetCore.Formatters.JsonApiOutputFormatter' and content type '' to write the response. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: JsonApiDotNetCore.Formatters.JsonApiWriter[0] + Formatting response as JSONAPI +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) in 2.765ms +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) in 2.765ms +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 3.533ms 200 application/vnd.api+json +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 3.533ms 200 application/vnd.api+json +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20200] + Beginning transaction with isolation level 'ReadCommitted'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6, @p7) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6, @p7) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6, @p7) + RETURNING "Id"; +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20202] + Committing transaction. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20204] + Disposing transaction. +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 GET http://localhost/api/v1/todo-items/2652?omitNullValuedAttributes=false +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 GET http://localhost/api/v1/todo-items/2652?omitNullValuedAttributes=false +dbug: Microsoft.AspNetCore.Routing.Tree.TreeRouter[1] + Request successfully matched the route with name '(null)' and template 'api/v1/todo-items/{id}'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.TodoItemsController.PatchAsync (JsonApiDotNetCoreExample)' with id '1ee61db8-daf4-41f3-90d2-1cf3db87d448' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.TodoItemsController.DeleteAsync (JsonApiDotNetCoreExample)' with id '75ab2821-99d0-4a3f-9dbb-3747ee7b296e' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) with arguments (2652) - ModelState is Valid +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) with arguments (2652) - ModelState is Valid +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "e"."Id", "e"."AchievedDate", "e"."AssigneeId", "e"."CollectionId", "e"."CreatedDate", "e"."Description", "e"."GuidProperty", "e"."Ordinal", "e"."OwnerId" + FROM "TodoItems" AS "e" + WHERE "e"."Id" = @__id_0 + LIMIT 2 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "e"."Id", "e"."AchievedDate", "e"."AssigneeId", "e"."CollectionId", "e"."CreatedDate", "e"."Description", "e"."GuidProperty", "e"."Ordinal", "e"."OwnerId" + FROM "TodoItems" AS "e" + WHERE "e"."Id" = @__id_0 + LIMIT 2 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "e"."Id", "e"."AchievedDate", "e"."AssigneeId", "e"."CollectionId", "e"."CreatedDate", "e"."Description", "e"."GuidProperty", "e"."Ordinal", "e"."OwnerId" + FROM "TodoItems" AS "e" + WHERE "e"."Id" = @__id_0 + LIMIT 2 +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample), returned result Microsoft.AspNetCore.Mvc.OkObjectResult. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[4] + No information found on request to perform content negotiation. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[2] + Selected output formatter 'JsonApiDotNetCore.Formatters.JsonApiOutputFormatter' and content type '' to write the response. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: JsonApiDotNetCore.Formatters.JsonApiWriter[0] + Formatting response as JSONAPI +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) in 3.109ms +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) in 3.109ms +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 3.54ms 200 application/vnd.api+json +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 3.54ms 200 application/vnd.api+json +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20200] + Beginning transaction with isolation level 'ReadCommitted'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6, @p7) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6, @p7) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6, @p7) + RETURNING "Id"; +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20202] + Committing transaction. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20204] + Disposing transaction. +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 GET http://localhost/api/v1/todo-items/2653 +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 GET http://localhost/api/v1/todo-items/2653 +dbug: Microsoft.AspNetCore.Routing.Tree.TreeRouter[1] + Request successfully matched the route with name '(null)' and template 'api/v1/todo-items/{id}'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.TodoItemsController.PatchAsync (JsonApiDotNetCoreExample)' with id '1ee61db8-daf4-41f3-90d2-1cf3db87d448' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.TodoItemsController.DeleteAsync (JsonApiDotNetCoreExample)' with id '75ab2821-99d0-4a3f-9dbb-3747ee7b296e' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) with arguments (2653) - ModelState is Valid +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) with arguments (2653) - ModelState is Valid +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "e"."Id", "e"."AchievedDate", "e"."AssigneeId", "e"."CollectionId", "e"."CreatedDate", "e"."Description", "e"."GuidProperty", "e"."Ordinal", "e"."OwnerId" + FROM "TodoItems" AS "e" + WHERE "e"."Id" = @__id_0 + LIMIT 2 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "e"."Id", "e"."AchievedDate", "e"."AssigneeId", "e"."CollectionId", "e"."CreatedDate", "e"."Description", "e"."GuidProperty", "e"."Ordinal", "e"."OwnerId" + FROM "TodoItems" AS "e" + WHERE "e"."Id" = @__id_0 + LIMIT 2 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "e"."Id", "e"."AchievedDate", "e"."AssigneeId", "e"."CollectionId", "e"."CreatedDate", "e"."Description", "e"."GuidProperty", "e"."Ordinal", "e"."OwnerId" + FROM "TodoItems" AS "e" + WHERE "e"."Id" = @__id_0 + LIMIT 2 +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample), returned result Microsoft.AspNetCore.Mvc.OkObjectResult. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[4] + No information found on request to perform content negotiation. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[2] + Selected output formatter 'JsonApiDotNetCore.Formatters.JsonApiOutputFormatter' and content type '' to write the response. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: JsonApiDotNetCore.Formatters.JsonApiWriter[0] + Formatting response as JSONAPI +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) in 2.247ms +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) in 2.247ms +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 2.645ms 200 application/vnd.api+json +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 2.645ms 200 application/vnd.api+json +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20200] + Beginning transaction with isolation level 'ReadCommitted'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6, @p7) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6, @p7) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6, @p7) + RETURNING "Id"; +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20202] + Committing transaction. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20204] + Disposing transaction. +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 GET http://localhost/api/v1/todo-items/2654 +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 GET http://localhost/api/v1/todo-items/2654 +dbug: Microsoft.AspNetCore.Routing.Tree.TreeRouter[1] + Request successfully matched the route with name '(null)' and template 'api/v1/todo-items/{id}'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.TodoItemsController.PatchAsync (JsonApiDotNetCoreExample)' with id '1ee61db8-daf4-41f3-90d2-1cf3db87d448' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.TodoItemsController.DeleteAsync (JsonApiDotNetCoreExample)' with id '75ab2821-99d0-4a3f-9dbb-3747ee7b296e' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) with arguments (2654) - ModelState is Valid +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) with arguments (2654) - ModelState is Valid +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "e"."Id", "e"."AchievedDate", "e"."AssigneeId", "e"."CollectionId", "e"."CreatedDate", "e"."Description", "e"."GuidProperty", "e"."Ordinal", "e"."OwnerId" + FROM "TodoItems" AS "e" + WHERE "e"."Id" = @__id_0 + LIMIT 2 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "e"."Id", "e"."AchievedDate", "e"."AssigneeId", "e"."CollectionId", "e"."CreatedDate", "e"."Description", "e"."GuidProperty", "e"."Ordinal", "e"."OwnerId" + FROM "TodoItems" AS "e" + WHERE "e"."Id" = @__id_0 + LIMIT 2 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "e"."Id", "e"."AchievedDate", "e"."AssigneeId", "e"."CollectionId", "e"."CreatedDate", "e"."Description", "e"."GuidProperty", "e"."Ordinal", "e"."OwnerId" + FROM "TodoItems" AS "e" + WHERE "e"."Id" = @__id_0 + LIMIT 2 +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample), returned result Microsoft.AspNetCore.Mvc.OkObjectResult. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[4] + No information found on request to perform content negotiation. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[2] + Selected output formatter 'JsonApiDotNetCore.Formatters.JsonApiOutputFormatter' and content type '' to write the response. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: JsonApiDotNetCore.Formatters.JsonApiWriter[0] + Formatting response as JSONAPI +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) in 3.771ms +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) in 3.771ms +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 4.491ms 200 application/vnd.api+json +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 4.491ms 200 application/vnd.api+json +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20200] + Beginning transaction with isolation level 'ReadCommitted'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6, @p7) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6, @p7) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6, @p7) + RETURNING "Id"; +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20202] + Committing transaction. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20204] + Disposing transaction. +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 GET http://localhost/api/v1/todo-items/2655?omitNullValuedAttributes= +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 GET http://localhost/api/v1/todo-items/2655?omitNullValuedAttributes= +dbug: Microsoft.AspNetCore.Routing.Tree.TreeRouter[1] + Request successfully matched the route with name '(null)' and template 'api/v1/todo-items/{id}'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.TodoItemsController.PatchAsync (JsonApiDotNetCoreExample)' with id '1ee61db8-daf4-41f3-90d2-1cf3db87d448' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.TodoItemsController.DeleteAsync (JsonApiDotNetCoreExample)' with id '75ab2821-99d0-4a3f-9dbb-3747ee7b296e' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) with arguments (2655) - ModelState is Valid +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) with arguments (2655) - ModelState is Valid +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "e"."Id", "e"."AchievedDate", "e"."AssigneeId", "e"."CollectionId", "e"."CreatedDate", "e"."Description", "e"."GuidProperty", "e"."Ordinal", "e"."OwnerId" + FROM "TodoItems" AS "e" + WHERE "e"."Id" = @__id_0 + LIMIT 2 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "e"."Id", "e"."AchievedDate", "e"."AssigneeId", "e"."CollectionId", "e"."CreatedDate", "e"."Description", "e"."GuidProperty", "e"."Ordinal", "e"."OwnerId" + FROM "TodoItems" AS "e" + WHERE "e"."Id" = @__id_0 + LIMIT 2 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "e"."Id", "e"."AchievedDate", "e"."AssigneeId", "e"."CollectionId", "e"."CreatedDate", "e"."Description", "e"."GuidProperty", "e"."Ordinal", "e"."OwnerId" + FROM "TodoItems" AS "e" + WHERE "e"."Id" = @__id_0 + LIMIT 2 +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample), returned result Microsoft.AspNetCore.Mvc.OkObjectResult. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[4] + No information found on request to perform content negotiation. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[2] + Selected output formatter 'JsonApiDotNetCore.Formatters.JsonApiOutputFormatter' and content type '' to write the response. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: JsonApiDotNetCore.Formatters.JsonApiWriter[0] + Formatting response as JSONAPI +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) in 2.271ms +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) in 2.271ms +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 2.444ms 200 application/vnd.api+json +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 2.444ms 200 application/vnd.api+json +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20200] + Beginning transaction with isolation level 'ReadCommitted'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6, @p7) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (4ms) [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6, @p7) + RETURNING "Id"; +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (4ms) [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6, @p7) + RETURNING "Id"; +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20202] + Committing transaction. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20204] + Disposing transaction. +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 GET http://localhost/api/v1/todo-items/2656?omitNullValuedAttributes=false +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 GET http://localhost/api/v1/todo-items/2656?omitNullValuedAttributes=false +dbug: Microsoft.AspNetCore.Routing.Tree.TreeRouter[1] + Request successfully matched the route with name '(null)' and template 'api/v1/todo-items/{id}'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.TodoItemsController.PatchAsync (JsonApiDotNetCoreExample)' with id '1ee61db8-daf4-41f3-90d2-1cf3db87d448' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.TodoItemsController.DeleteAsync (JsonApiDotNetCoreExample)' with id '75ab2821-99d0-4a3f-9dbb-3747ee7b296e' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) with arguments (2656) - ModelState is Valid +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) with arguments (2656) - ModelState is Valid +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "e"."Id", "e"."AchievedDate", "e"."AssigneeId", "e"."CollectionId", "e"."CreatedDate", "e"."Description", "e"."GuidProperty", "e"."Ordinal", "e"."OwnerId" + FROM "TodoItems" AS "e" + WHERE "e"."Id" = @__id_0 + LIMIT 2 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "e"."Id", "e"."AchievedDate", "e"."AssigneeId", "e"."CollectionId", "e"."CreatedDate", "e"."Description", "e"."GuidProperty", "e"."Ordinal", "e"."OwnerId" + FROM "TodoItems" AS "e" + WHERE "e"."Id" = @__id_0 + LIMIT 2 +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample), returned result Microsoft.AspNetCore.Mvc.OkObjectResult. +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "e"."Id", "e"."AchievedDate", "e"."AssigneeId", "e"."CollectionId", "e"."CreatedDate", "e"."Description", "e"."GuidProperty", "e"."Ordinal", "e"."OwnerId" + FROM "TodoItems" AS "e" + WHERE "e"."Id" = @__id_0 + LIMIT 2 +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[4] + No information found on request to perform content negotiation. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[2] + Selected output formatter 'JsonApiDotNetCore.Formatters.JsonApiOutputFormatter' and content type '' to write the response. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: JsonApiDotNetCore.Formatters.JsonApiWriter[0] + Formatting response as JSONAPI +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) in 7.526ms +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) in 7.526ms +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 7.947ms 200 application/vnd.api+json +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 7.947ms 200 application/vnd.api+json +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20200] + Beginning transaction with isolation level 'ReadCommitted'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6, @p7) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6, @p7) + RETURNING "Id"; +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6, @p7) + RETURNING "Id"; +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20202] + Committing transaction. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20204] + Disposing transaction. +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 GET http://localhost/api/v1/todo-items/2657?omitNullValuedAttributes=true +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 GET http://localhost/api/v1/todo-items/2657?omitNullValuedAttributes=true +dbug: Microsoft.AspNetCore.Routing.Tree.TreeRouter[1] + Request successfully matched the route with name '(null)' and template 'api/v1/todo-items/{id}'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.TodoItemsController.PatchAsync (JsonApiDotNetCoreExample)' with id '1ee61db8-daf4-41f3-90d2-1cf3db87d448' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.TodoItemsController.DeleteAsync (JsonApiDotNetCoreExample)' with id '75ab2821-99d0-4a3f-9dbb-3747ee7b296e' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) with arguments (2657) - ModelState is Valid +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) with arguments (2657) - ModelState is Valid +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "e"."Id", "e"."AchievedDate", "e"."AssigneeId", "e"."CollectionId", "e"."CreatedDate", "e"."Description", "e"."GuidProperty", "e"."Ordinal", "e"."OwnerId" + FROM "TodoItems" AS "e" + WHERE "e"."Id" = @__id_0 + LIMIT 2 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "e"."Id", "e"."AchievedDate", "e"."AssigneeId", "e"."CollectionId", "e"."CreatedDate", "e"."Description", "e"."GuidProperty", "e"."Ordinal", "e"."OwnerId" + FROM "TodoItems" AS "e" + WHERE "e"."Id" = @__id_0 + LIMIT 2 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "e"."Id", "e"."AchievedDate", "e"."AssigneeId", "e"."CollectionId", "e"."CreatedDate", "e"."Description", "e"."GuidProperty", "e"."Ordinal", "e"."OwnerId" + FROM "TodoItems" AS "e" + WHERE "e"."Id" = @__id_0 + LIMIT 2 +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample), returned result Microsoft.AspNetCore.Mvc.OkObjectResult. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[4] + No information found on request to perform content negotiation. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[2] + Selected output formatter 'JsonApiDotNetCore.Formatters.JsonApiOutputFormatter' and content type '' to write the response. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: JsonApiDotNetCore.Formatters.JsonApiWriter[0] + Formatting response as JSONAPI +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) in 2.605ms +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) in 2.605ms +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 2.794ms 200 application/vnd.api+json +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 2.794ms 200 application/vnd.api+json +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20200] + Beginning transaction with isolation level 'ReadCommitted'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6, @p7) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6, @p7) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6, @p7) + RETURNING "Id"; +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20202] + Committing transaction. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20204] + Disposing transaction. +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 GET http://localhost/api/v1/todo-items/2658?omitNullValuedAttributes=true +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 GET http://localhost/api/v1/todo-items/2658?omitNullValuedAttributes=true +dbug: Microsoft.AspNetCore.Routing.Tree.TreeRouter[1] + Request successfully matched the route with name '(null)' and template 'api/v1/todo-items/{id}'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.TodoItemsController.PatchAsync (JsonApiDotNetCoreExample)' with id '1ee61db8-daf4-41f3-90d2-1cf3db87d448' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.TodoItemsController.DeleteAsync (JsonApiDotNetCoreExample)' with id '75ab2821-99d0-4a3f-9dbb-3747ee7b296e' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) with arguments (2658) - ModelState is Valid +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) with arguments (2658) - ModelState is Valid +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "e"."Id", "e"."AchievedDate", "e"."AssigneeId", "e"."CollectionId", "e"."CreatedDate", "e"."Description", "e"."GuidProperty", "e"."Ordinal", "e"."OwnerId" + FROM "TodoItems" AS "e" + WHERE "e"."Id" = @__id_0 + LIMIT 2 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "e"."Id", "e"."AchievedDate", "e"."AssigneeId", "e"."CollectionId", "e"."CreatedDate", "e"."Description", "e"."GuidProperty", "e"."Ordinal", "e"."OwnerId" + FROM "TodoItems" AS "e" + WHERE "e"."Id" = @__id_0 + LIMIT 2 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "e"."Id", "e"."AchievedDate", "e"."AssigneeId", "e"."CollectionId", "e"."CreatedDate", "e"."Description", "e"."GuidProperty", "e"."Ordinal", "e"."OwnerId" + FROM "TodoItems" AS "e" + WHERE "e"."Id" = @__id_0 + LIMIT 2 +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample), returned result Microsoft.AspNetCore.Mvc.OkObjectResult. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[4] + No information found on request to perform content negotiation. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[2] + Selected output formatter 'JsonApiDotNetCore.Formatters.JsonApiOutputFormatter' and content type '' to write the response. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: JsonApiDotNetCore.Formatters.JsonApiWriter[0] + Formatting response as JSONAPI +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) in 2.479ms +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) in 2.479ms +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 2.849ms 200 application/vnd.api+json +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 2.849ms 200 application/vnd.api+json +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20200] + Beginning transaction with isolation level 'ReadCommitted'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6, @p7) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6, @p7) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6, @p7) + RETURNING "Id"; +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20202] + Committing transaction. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20204] + Disposing transaction. +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 GET http://localhost/api/v1/todo-items/2659?omitNullValuedAttributes=foo +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 GET http://localhost/api/v1/todo-items/2659?omitNullValuedAttributes=foo +dbug: Microsoft.AspNetCore.Routing.Tree.TreeRouter[1] + Request successfully matched the route with name '(null)' and template 'api/v1/todo-items/{id}'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.TodoItemsController.PatchAsync (JsonApiDotNetCoreExample)' with id '1ee61db8-daf4-41f3-90d2-1cf3db87d448' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.TodoItemsController.DeleteAsync (JsonApiDotNetCoreExample)' with id '75ab2821-99d0-4a3f-9dbb-3747ee7b296e' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) with arguments (2659) - ModelState is Valid +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) with arguments (2659) - ModelState is Valid +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "e"."Id", "e"."AchievedDate", "e"."AssigneeId", "e"."CollectionId", "e"."CreatedDate", "e"."Description", "e"."GuidProperty", "e"."Ordinal", "e"."OwnerId" + FROM "TodoItems" AS "e" + WHERE "e"."Id" = @__id_0 + LIMIT 2 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "e"."Id", "e"."AchievedDate", "e"."AssigneeId", "e"."CollectionId", "e"."CreatedDate", "e"."Description", "e"."GuidProperty", "e"."Ordinal", "e"."OwnerId" + FROM "TodoItems" AS "e" + WHERE "e"."Id" = @__id_0 + LIMIT 2 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "e"."Id", "e"."AchievedDate", "e"."AssigneeId", "e"."CollectionId", "e"."CreatedDate", "e"."Description", "e"."GuidProperty", "e"."Ordinal", "e"."OwnerId" + FROM "TodoItems" AS "e" + WHERE "e"."Id" = @__id_0 + LIMIT 2 +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample), returned result Microsoft.AspNetCore.Mvc.OkObjectResult. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[4] + No information found on request to perform content negotiation. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[2] + Selected output formatter 'JsonApiDotNetCore.Formatters.JsonApiOutputFormatter' and content type '' to write the response. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: JsonApiDotNetCore.Formatters.JsonApiWriter[0] + Formatting response as JSONAPI +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) in 2.266ms +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) in 2.266ms +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 2.441ms 200 application/vnd.api+json +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 2.441ms 200 application/vnd.api+json +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20200] + Beginning transaction with isolation level 'ReadCommitted'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6, @p7) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6, @p7) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6, @p7) + RETURNING "Id"; +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20202] + Committing transaction. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20204] + Disposing transaction. +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 GET http://localhost/api/v1/todo-items/2660?omitNullValuedAttributes=foo +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 GET http://localhost/api/v1/todo-items/2660?omitNullValuedAttributes=foo +dbug: Microsoft.AspNetCore.Routing.Tree.TreeRouter[1] + Request successfully matched the route with name '(null)' and template 'api/v1/todo-items/{id}'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.TodoItemsController.PatchAsync (JsonApiDotNetCoreExample)' with id '1ee61db8-daf4-41f3-90d2-1cf3db87d448' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.TodoItemsController.DeleteAsync (JsonApiDotNetCoreExample)' with id '75ab2821-99d0-4a3f-9dbb-3747ee7b296e' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) with arguments (2660) - ModelState is Valid +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) with arguments (2660) - ModelState is Valid +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "e"."Id", "e"."AchievedDate", "e"."AssigneeId", "e"."CollectionId", "e"."CreatedDate", "e"."Description", "e"."GuidProperty", "e"."Ordinal", "e"."OwnerId" + FROM "TodoItems" AS "e" + WHERE "e"."Id" = @__id_0 + LIMIT 2 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "e"."Id", "e"."AchievedDate", "e"."AssigneeId", "e"."CollectionId", "e"."CreatedDate", "e"."Description", "e"."GuidProperty", "e"."Ordinal", "e"."OwnerId" + FROM "TodoItems" AS "e" + WHERE "e"."Id" = @__id_0 + LIMIT 2 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "e"."Id", "e"."AchievedDate", "e"."AssigneeId", "e"."CollectionId", "e"."CreatedDate", "e"."Description", "e"."GuidProperty", "e"."Ordinal", "e"."OwnerId" + FROM "TodoItems" AS "e" + WHERE "e"."Id" = @__id_0 + LIMIT 2 +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample), returned result Microsoft.AspNetCore.Mvc.OkObjectResult. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[4] + No information found on request to perform content negotiation. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[2] + Selected output formatter 'JsonApiDotNetCore.Formatters.JsonApiOutputFormatter' and content type '' to write the response. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: JsonApiDotNetCore.Formatters.JsonApiWriter[0] + Formatting response as JSONAPI +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) in 2.248ms +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) in 2.248ms +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 3.239ms 200 application/vnd.api+json +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 3.239ms 200 application/vnd.api+json +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20200] + Beginning transaction with isolation level 'ReadCommitted'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6, @p7) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6, @p7) + RETURNING "Id"; +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6, @p7) + RETURNING "Id"; +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20202] + Committing transaction. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20204] + Disposing transaction. +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 GET http://localhost/api/v1/todo-items/2661?omitNullValuedAttributes=foo +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 GET http://localhost/api/v1/todo-items/2661?omitNullValuedAttributes=foo +dbug: Microsoft.AspNetCore.Routing.Tree.TreeRouter[1] + Request successfully matched the route with name '(null)' and template 'api/v1/todo-items/{id}'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.TodoItemsController.PatchAsync (JsonApiDotNetCoreExample)' with id '1ee61db8-daf4-41f3-90d2-1cf3db87d448' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.TodoItemsController.DeleteAsync (JsonApiDotNetCoreExample)' with id '75ab2821-99d0-4a3f-9dbb-3747ee7b296e' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) with arguments (2661) - ModelState is Valid +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) with arguments (2661) - ModelState is Valid +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "e"."Id", "e"."AchievedDate", "e"."AssigneeId", "e"."CollectionId", "e"."CreatedDate", "e"."Description", "e"."GuidProperty", "e"."Ordinal", "e"."OwnerId" + FROM "TodoItems" AS "e" + WHERE "e"."Id" = @__id_0 + LIMIT 2 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "e"."Id", "e"."AchievedDate", "e"."AssigneeId", "e"."CollectionId", "e"."CreatedDate", "e"."Description", "e"."GuidProperty", "e"."Ordinal", "e"."OwnerId" + FROM "TodoItems" AS "e" + WHERE "e"."Id" = @__id_0 + LIMIT 2 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "e"."Id", "e"."AchievedDate", "e"."AssigneeId", "e"."CollectionId", "e"."CreatedDate", "e"."Description", "e"."GuidProperty", "e"."Ordinal", "e"."OwnerId" + FROM "TodoItems" AS "e" + WHERE "e"."Id" = @__id_0 + LIMIT 2 +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample), returned result Microsoft.AspNetCore.Mvc.OkObjectResult. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[4] + No information found on request to perform content negotiation. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[2] + Selected output formatter 'JsonApiDotNetCore.Formatters.JsonApiOutputFormatter' and content type '' to write the response. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: JsonApiDotNetCore.Formatters.JsonApiWriter[0] + Formatting response as JSONAPI +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) in 2.492ms +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 2.683ms 200 application/vnd.api+json +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) in 2.492ms +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 2.683ms 200 application/vnd.api+json +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20200] + Beginning transaction with isolation level 'ReadCommitted'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6, @p7) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6, @p7) + RETURNING "Id"; +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6, @p7) + RETURNING "Id"; +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20202] + Committing transaction. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20204] + Disposing transaction. +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 GET http://localhost/api/v1/todo-items/2662?omitNullValuedAttributes=false +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 GET http://localhost/api/v1/todo-items/2662?omitNullValuedAttributes=false +dbug: Microsoft.AspNetCore.Routing.Tree.TreeRouter[1] + Request successfully matched the route with name '(null)' and template 'api/v1/todo-items/{id}'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.TodoItemsController.PatchAsync (JsonApiDotNetCoreExample)' with id '1ee61db8-daf4-41f3-90d2-1cf3db87d448' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.TodoItemsController.DeleteAsync (JsonApiDotNetCoreExample)' with id '75ab2821-99d0-4a3f-9dbb-3747ee7b296e' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) with arguments (2662) - ModelState is Valid +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) with arguments (2662) - ModelState is Valid +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "e"."Id", "e"."AchievedDate", "e"."AssigneeId", "e"."CollectionId", "e"."CreatedDate", "e"."Description", "e"."GuidProperty", "e"."Ordinal", "e"."OwnerId" + FROM "TodoItems" AS "e" + WHERE "e"."Id" = @__id_0 + LIMIT 2 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "e"."Id", "e"."AchievedDate", "e"."AssigneeId", "e"."CollectionId", "e"."CreatedDate", "e"."Description", "e"."GuidProperty", "e"."Ordinal", "e"."OwnerId" + FROM "TodoItems" AS "e" + WHERE "e"."Id" = @__id_0 + LIMIT 2 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "e"."Id", "e"."AchievedDate", "e"."AssigneeId", "e"."CollectionId", "e"."CreatedDate", "e"."Description", "e"."GuidProperty", "e"."Ordinal", "e"."OwnerId" + FROM "TodoItems" AS "e" + WHERE "e"."Id" = @__id_0 + LIMIT 2 +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample), returned result Microsoft.AspNetCore.Mvc.OkObjectResult. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[4] + No information found on request to perform content negotiation. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[2] + Selected output formatter 'JsonApiDotNetCore.Formatters.JsonApiOutputFormatter' and content type '' to write the response. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: JsonApiDotNetCore.Formatters.JsonApiWriter[0] + Formatting response as JSONAPI +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) in 2.181ms +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) in 2.181ms +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 2.539ms 200 application/vnd.api+json +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 2.539ms 200 application/vnd.api+json +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20200] + Beginning transaction with isolation level 'ReadCommitted'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6, @p7) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6, @p7) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6, @p7) + RETURNING "Id"; +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20202] + Committing transaction. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20204] + Disposing transaction. +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 GET http://localhost/api/v1/todo-items/2663?omitNullValuedAttributes=true +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 GET http://localhost/api/v1/todo-items/2663?omitNullValuedAttributes=true +dbug: Microsoft.AspNetCore.Routing.Tree.TreeRouter[1] + Request successfully matched the route with name '(null)' and template 'api/v1/todo-items/{id}'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.TodoItemsController.PatchAsync (JsonApiDotNetCoreExample)' with id '1ee61db8-daf4-41f3-90d2-1cf3db87d448' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.TodoItemsController.DeleteAsync (JsonApiDotNetCoreExample)' with id '75ab2821-99d0-4a3f-9dbb-3747ee7b296e' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) with arguments (2663) - ModelState is Valid +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) with arguments (2663) - ModelState is Valid +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "e"."Id", "e"."AchievedDate", "e"."AssigneeId", "e"."CollectionId", "e"."CreatedDate", "e"."Description", "e"."GuidProperty", "e"."Ordinal", "e"."OwnerId" + FROM "TodoItems" AS "e" + WHERE "e"."Id" = @__id_0 + LIMIT 2 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "e"."Id", "e"."AchievedDate", "e"."AssigneeId", "e"."CollectionId", "e"."CreatedDate", "e"."Description", "e"."GuidProperty", "e"."Ordinal", "e"."OwnerId" + FROM "TodoItems" AS "e" + WHERE "e"."Id" = @__id_0 + LIMIT 2 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "e"."Id", "e"."AchievedDate", "e"."AssigneeId", "e"."CollectionId", "e"."CreatedDate", "e"."Description", "e"."GuidProperty", "e"."Ordinal", "e"."OwnerId" + FROM "TodoItems" AS "e" + WHERE "e"."Id" = @__id_0 + LIMIT 2 +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample), returned result Microsoft.AspNetCore.Mvc.OkObjectResult. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[4] + No information found on request to perform content negotiation. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[2] + Selected output formatter 'JsonApiDotNetCore.Formatters.JsonApiOutputFormatter' and content type '' to write the response. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: JsonApiDotNetCore.Formatters.JsonApiWriter[0] + Formatting response as JSONAPI +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) in 2.411ms +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) in 2.411ms +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 2.782ms 200 application/vnd.api+json +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 2.782ms 200 application/vnd.api+json +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20200] + Beginning transaction with isolation level 'ReadCommitted'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6, @p7) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (5ms) [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6, @p7) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (5ms) [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6, @p7) + RETURNING "Id"; +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20202] + Committing transaction. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20204] + Disposing transaction. +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 GET http://localhost/api/v1/todo-items/2664?omitNullValuedAttributes=false +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 GET http://localhost/api/v1/todo-items/2664?omitNullValuedAttributes=false +dbug: Microsoft.AspNetCore.Routing.Tree.TreeRouter[1] + Request successfully matched the route with name '(null)' and template 'api/v1/todo-items/{id}'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.TodoItemsController.PatchAsync (JsonApiDotNetCoreExample)' with id '1ee61db8-daf4-41f3-90d2-1cf3db87d448' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.TodoItemsController.DeleteAsync (JsonApiDotNetCoreExample)' with id '75ab2821-99d0-4a3f-9dbb-3747ee7b296e' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) with arguments (2664) - ModelState is Valid +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) with arguments (2664) - ModelState is Valid +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "e"."Id", "e"."AchievedDate", "e"."AssigneeId", "e"."CollectionId", "e"."CreatedDate", "e"."Description", "e"."GuidProperty", "e"."Ordinal", "e"."OwnerId" + FROM "TodoItems" AS "e" + WHERE "e"."Id" = @__id_0 + LIMIT 2 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "e"."Id", "e"."AchievedDate", "e"."AssigneeId", "e"."CollectionId", "e"."CreatedDate", "e"."Description", "e"."GuidProperty", "e"."Ordinal", "e"."OwnerId" + FROM "TodoItems" AS "e" + WHERE "e"."Id" = @__id_0 + LIMIT 2 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "e"."Id", "e"."AchievedDate", "e"."AssigneeId", "e"."CollectionId", "e"."CreatedDate", "e"."Description", "e"."GuidProperty", "e"."Ordinal", "e"."OwnerId" + FROM "TodoItems" AS "e" + WHERE "e"."Id" = @__id_0 + LIMIT 2 +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample), returned result Microsoft.AspNetCore.Mvc.OkObjectResult. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[4] + No information found on request to perform content negotiation. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[2] + Selected output formatter 'JsonApiDotNetCore.Formatters.JsonApiOutputFormatter' and content type '' to write the response. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: JsonApiDotNetCore.Formatters.JsonApiWriter[0] + Formatting response as JSONAPI +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) in 2.755ms +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 2.951ms 200 application/vnd.api+json +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) in 2.755ms +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 2.951ms 200 application/vnd.api+json +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20200] + Beginning transaction with isolation level 'ReadCommitted'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6, @p7) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (4ms) [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6, @p7) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (4ms) [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6, @p7) + RETURNING "Id"; +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20202] + Committing transaction. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20204] + Disposing transaction. +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 GET http://localhost/api/v1/todo-items/2665?omitNullValuedAttributes=foo +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 GET http://localhost/api/v1/todo-items/2665?omitNullValuedAttributes=foo +dbug: Microsoft.AspNetCore.Routing.Tree.TreeRouter[1] + Request successfully matched the route with name '(null)' and template 'api/v1/todo-items/{id}'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.TodoItemsController.PatchAsync (JsonApiDotNetCoreExample)' with id '1ee61db8-daf4-41f3-90d2-1cf3db87d448' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.TodoItemsController.DeleteAsync (JsonApiDotNetCoreExample)' with id '75ab2821-99d0-4a3f-9dbb-3747ee7b296e' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) with arguments (2665) - ModelState is Valid +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) with arguments (2665) - ModelState is Valid +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "e"."Id", "e"."AchievedDate", "e"."AssigneeId", "e"."CollectionId", "e"."CreatedDate", "e"."Description", "e"."GuidProperty", "e"."Ordinal", "e"."OwnerId" + FROM "TodoItems" AS "e" + WHERE "e"."Id" = @__id_0 + LIMIT 2 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "e"."Id", "e"."AchievedDate", "e"."AssigneeId", "e"."CollectionId", "e"."CreatedDate", "e"."Description", "e"."GuidProperty", "e"."Ordinal", "e"."OwnerId" + FROM "TodoItems" AS "e" + WHERE "e"."Id" = @__id_0 + LIMIT 2 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "e"."Id", "e"."AchievedDate", "e"."AssigneeId", "e"."CollectionId", "e"."CreatedDate", "e"."Description", "e"."GuidProperty", "e"."Ordinal", "e"."OwnerId" + FROM "TodoItems" AS "e" + WHERE "e"."Id" = @__id_0 + LIMIT 2 +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample), returned result Microsoft.AspNetCore.Mvc.OkObjectResult. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[4] + No information found on request to perform content negotiation. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[2] + Selected output formatter 'JsonApiDotNetCore.Formatters.JsonApiOutputFormatter' and content type '' to write the response. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: JsonApiDotNetCore.Formatters.JsonApiWriter[0] + Formatting response as JSONAPI +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) in 2.481ms +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) in 2.481ms +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 2.66ms 200 application/vnd.api+json +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 2.66ms 200 application/vnd.api+json +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20200] + Beginning transaction with isolation level 'ReadCommitted'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6, @p7) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6, @p7) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6, @p7) + RETURNING "Id"; +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20202] + Committing transaction. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20204] + Disposing transaction. +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 GET http://localhost/api/v1/todo-items/2666?omitNullValuedAttributes= +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 GET http://localhost/api/v1/todo-items/2666?omitNullValuedAttributes= +dbug: Microsoft.AspNetCore.Routing.Tree.TreeRouter[1] + Request successfully matched the route with name '(null)' and template 'api/v1/todo-items/{id}'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.TodoItemsController.PatchAsync (JsonApiDotNetCoreExample)' with id '1ee61db8-daf4-41f3-90d2-1cf3db87d448' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.TodoItemsController.DeleteAsync (JsonApiDotNetCoreExample)' with id '75ab2821-99d0-4a3f-9dbb-3747ee7b296e' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) with arguments (2666) - ModelState is Valid +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) with arguments (2666) - ModelState is Valid +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "e"."Id", "e"."AchievedDate", "e"."AssigneeId", "e"."CollectionId", "e"."CreatedDate", "e"."Description", "e"."GuidProperty", "e"."Ordinal", "e"."OwnerId" + FROM "TodoItems" AS "e" + WHERE "e"."Id" = @__id_0 + LIMIT 2 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "e"."Id", "e"."AchievedDate", "e"."AssigneeId", "e"."CollectionId", "e"."CreatedDate", "e"."Description", "e"."GuidProperty", "e"."Ordinal", "e"."OwnerId" + FROM "TodoItems" AS "e" + WHERE "e"."Id" = @__id_0 + LIMIT 2 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "e"."Id", "e"."AchievedDate", "e"."AssigneeId", "e"."CollectionId", "e"."CreatedDate", "e"."Description", "e"."GuidProperty", "e"."Ordinal", "e"."OwnerId" + FROM "TodoItems" AS "e" + WHERE "e"."Id" = @__id_0 + LIMIT 2 +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample), returned result Microsoft.AspNetCore.Mvc.OkObjectResult. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[4] + No information found on request to perform content negotiation. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[2] + Selected output formatter 'JsonApiDotNetCore.Formatters.JsonApiOutputFormatter' and content type '' to write the response. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: JsonApiDotNetCore.Formatters.JsonApiWriter[0] + Formatting response as JSONAPI +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) in 2.802ms +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) in 2.802ms +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 3.245ms 200 application/vnd.api+json +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 3.245ms 200 application/vnd.api+json +info: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[0] + User profile is available. Using '/Users/jarednance/.aspnet/DataProtection-Keys' as key repository; keys will not be encrypted at rest. +warn: Microsoft.EntityFrameworkCore.Infrastructure[10402] + More than twenty 'IServiceProvider' instances have been created for internal use by Entity Framework. Consider reviewing calls on 'DbContextOptionsBuilder' that may require new service providers to be built. +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (4ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + + SELECT CASE WHEN COUNT(*) = 0 THEN FALSE ELSE TRUE END + FROM information_schema.tables + WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema') +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (3ms) [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?', @p8='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "People" ("FirstName", "LastName") + VALUES (@p0, @p1) + RETURNING "Id"; + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p2, @p3, @p4, @p5, @p6, @p7, @p8) + RETURNING "Id", "CreatedDate"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (3ms) [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?', @p8='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "People" ("FirstName", "LastName") + VALUES (@p0, @p1) + RETURNING "Id"; + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p2, @p3, @p4, @p5, @p6, @p7, @p8) + RETURNING "Id", "CreatedDate"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p9='?', @p10='?', @p11='?', @p12='?', @p13='?', @p14='?', @p15='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p9, @p10, @p11, @p12, @p13, @p14, @p15) + RETURNING "Id", "CreatedDate"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p9='?', @p10='?', @p11='?', @p12='?', @p13='?', @p14='?', @p15='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p9, @p10, @p11, @p12, @p13, @p14, @p15) + RETURNING "Id", "CreatedDate"; +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 GET http://localhost/api/v1/todo-items?include=owner +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 GET http://localhost/api/v1/todo-items?include=owner +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) with arguments ((null)) - ModelState is Valid +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) with arguments ((null)) - ModelState is Valid +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +warn: Microsoft.EntityFrameworkCore.Query[10106] + The Include operation for navigation '[todoItem].Owner' is unnecessary and was ignored because the navigation is not reachable in the final query results. See https://go.microsoft.com/fwlink/?linkid=850303 for more information. +warn: Microsoft.EntityFrameworkCore.Query[10106] + The Include operation for navigation '[todoItem].Owner' is unnecessary and was ignored because the navigation is not reachable in the final query results. See https://go.microsoft.com/fwlink/?linkid=850303 for more information. +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@___authService_CurrentUserId_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT COUNT(*)::INT4 + FROM "TodoItems" AS "todoItem" + WHERE "todoItem"."OwnerId" = @___authService_CurrentUserId_0 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@___authService_CurrentUserId_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT COUNT(*)::INT4 + FROM "TodoItems" AS "todoItem" + WHERE "todoItem"."OwnerId" = @___authService_CurrentUserId_0 +info: JsonApiDotNetCore.Services.EntityResourceService[0] + Applying paging query. Fetching page 0 with 5 entities +warn: Microsoft.EntityFrameworkCore.Query[10102] + Query: '(from TodoItem todoItem in DbSet where [todoItem].OwnerId == (Nullable)___authService...' uses a row limiting operation (Skip/Take) without OrderBy which may lead to unpredictable results. +warn: Microsoft.EntityFrameworkCore.Query[10102] + Query: '(from TodoItem todoItem in DbSet where [todoItem].OwnerId == (Nullable)___authService...' uses a row limiting operation (Skip/Take) without OrderBy which may lead to unpredictable results. +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@___authService_CurrentUserId_0='?', @__p_2='?', @__p_1='?'], CommandType='Text', CommandTimeout='30'] + SELECT "todoItem"."Id", "todoItem"."AchievedDate", "todoItem"."AssigneeId", "todoItem"."CollectionId", "todoItem"."CreatedDate", "todoItem"."Description", "todoItem"."GuidProperty", "todoItem"."Ordinal", "todoItem"."OwnerId", "todoItem.Owner"."Id", "todoItem.Owner"."FirstName", "todoItem.Owner"."LastName" + FROM "TodoItems" AS "todoItem" + LEFT JOIN "People" AS "todoItem.Owner" ON "todoItem"."OwnerId" = "todoItem.Owner"."Id" + WHERE "todoItem"."OwnerId" = @___authService_CurrentUserId_0 + LIMIT @__p_2 OFFSET @__p_1 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@___authService_CurrentUserId_0='?', @__p_2='?', @__p_1='?'], CommandType='Text', CommandTimeout='30'] + SELECT "todoItem"."Id", "todoItem"."AchievedDate", "todoItem"."AssigneeId", "todoItem"."CollectionId", "todoItem"."CreatedDate", "todoItem"."Description", "todoItem"."GuidProperty", "todoItem"."Ordinal", "todoItem"."OwnerId", "todoItem.Owner"."Id", "todoItem.Owner"."FirstName", "todoItem.Owner"."LastName" + FROM "TodoItems" AS "todoItem" + LEFT JOIN "People" AS "todoItem.Owner" ON "todoItem"."OwnerId" = "todoItem.Owner"."Id" + WHERE "todoItem"."OwnerId" = @___authService_CurrentUserId_0 + LIMIT @__p_2 OFFSET @__p_1 +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: JsonApiDotNetCore.Formatters.JsonApiWriter[0] + Formatting response as JSONAPI +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) in 48.653ms +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) in 48.653ms +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 74.804ms 200 application/vnd.api+json +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 74.804ms 200 application/vnd.api+json +info: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[0] + User profile is available. Using '/Users/jarednance/.aspnet/DataProtection-Keys' as key repository; keys will not be encrypted at rest. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-b040dd03-33c5-451e-8f42-3c9dd4e0dfec.xml'. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-c8147b66-2deb-407c-9421-1553f0e16d67.xml'. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-f7fa4a09-6d65-426e-a653-cbd2969e5073.xml'. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {b040dd03-33c5-451e-8f42-3c9dd4e0dfec}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {c8147b66-2deb-407c-9421-1553f0e16d67}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {f7fa4a09-6d65-426e-a653-cbd2969e5073}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.DefaultKeyResolver[13] + Considering key {c8147b66-2deb-407c-9421-1553f0e16d67} with expiration date 2018-03-03 16:22:35Z as default key. +dbug: Microsoft.AspNetCore.DataProtection.TypeForwardingActivator[0] + Forwarded activator type request from Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Version=1.1.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60 to Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Culture=neutral, PublicKeyToken=adb9793829ddae60 +dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptorFactory[11] + Using managed symmetric algorithm 'System.Security.Cryptography.Aes'. +dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptorFactory[10] + Using managed keyed hash algorithm 'System.Security.Cryptography.HMACSHA256'. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingProvider[2] + Using key {c8147b66-2deb-407c-9421-1553f0e16d67} as the default key. +dbug: Microsoft.AspNetCore.DataProtection.Internal.DataProtectionStartupFilter[0] + Key ring with default key {c8147b66-2deb-407c-9421-1553f0e16d67} was loaded during application startup. +dbug: Microsoft.EntityFrameworkCore.Infrastructure[10401] + An 'IServiceProvider' was created for internal use by Entity Framework. +warn: Microsoft.EntityFrameworkCore.Infrastructure[10402] + More than twenty 'IServiceProvider' instances have been created for internal use by Entity Framework. Consider reviewing calls on 'DbContextOptionsBuilder' that may require new service providers to be built. +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[], CommandType='Text', CommandTimeout='30'] + + SELECT CASE WHEN COUNT(*) = 0 THEN FALSE ELSE TRUE END + FROM information_schema.tables + WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema') +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (3ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + + SELECT CASE WHEN COUNT(*) = 0 THEN FALSE ELSE TRUE END + FROM information_schema.tables + WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema') +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[3] + Hosting starting +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[4] + Hosting started +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[0] + Loaded hosting startup assembly JsonApiDotNetCoreExampleTests +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 GET http://localhost/api/v1/people +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 GET http://localhost/api/v1/people +dbug: Microsoft.AspNetCore.Routing.Tree.TreeRouter[1] + Request successfully matched the route with name '(null)' and template 'api/v1/people'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.PeopleController.PostAsync (JsonApiDotNetCoreExample)' with id '1ded46dd-748a-4bb3-b33b-d64481e8f7d0' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action JsonApiDotNetCoreExample.Controllers.PeopleController.GetAsync (JsonApiDotNetCoreExample) +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.PeopleController.GetAsync (JsonApiDotNetCoreExample) with arguments ((null)) - ModelState is Valid +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.PeopleController.GetAsync (JsonApiDotNetCoreExample) with arguments ((null)) - ModelState is Valid +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Query[10101] + Compiling query model: + '(from Person _1 in DbSet + select [_1]).Count()' +dbug: Microsoft.EntityFrameworkCore.Query[10104] + Optimized query model: + '(from Person _1 in DbSet + select [_1]).Count()' +dbug: Microsoft.EntityFrameworkCore.Query[10107] + (QueryContext queryContext) => IAsyncEnumerable _InterceptExceptions( + source: IAsyncEnumerable _ToSequence(Task GetResult( + valueBuffers: IAsyncEnumerable _Query( + queryContext: queryContext, + shaperCommandContext: SelectExpression: + SELECT COUNT(*)::INT4 + FROM "People" AS "p"), + throwOnNullResult: False, + cancellationToken: queryContext.CancellationToken)), + contextType: JsonApiDotNetCoreExample.Data.AppDbContext, + logger: DiagnosticsLogger, + queryContext: queryContext) +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[], CommandType='Text', CommandTimeout='30'] + SELECT COUNT(*)::INT4 + FROM "People" AS "p" +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (8ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + SELECT COUNT(*)::INT4 + FROM "People" AS "p" +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (8ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + SELECT COUNT(*)::INT4 + FROM "People" AS "p" +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +info: JsonApiDotNetCore.Services.EntityResourceService[0] + Applying paging query. Fetching page 0 with 5 entities +dbug: Microsoft.EntityFrameworkCore.Query[10101] + Compiling query model: + '(from Person _2 in DbSet + select [_2]) + .Skip(__p_0) + .Take(__p_1)' +warn: Microsoft.EntityFrameworkCore.Query[10102] + Query: '(from Person _2 in DbSet select [_2]).Skip(__p_0).Take(__p_1)' uses a row limiting operation (Skip/Take) without OrderBy which may lead to unpredictable results. +warn: Microsoft.EntityFrameworkCore.Query[10102] + Query: '(from Person _2 in DbSet select [_2]).Skip(__p_0).Take(__p_1)' uses a row limiting operation (Skip/Take) without OrderBy which may lead to unpredictable results. +dbug: Microsoft.EntityFrameworkCore.Query[10104] + Optimized query model: + '(from Person _2 in DbSet + select [_2]) + .Skip(__p_0) + .Take(__p_1)' +dbug: Microsoft.EntityFrameworkCore.Query[10107] + (QueryContext queryContext) => IAsyncEnumerable _InterceptExceptions( + source: IAsyncEnumerable _TrackEntities( + results: IAsyncEnumerable _ShapedQuery( + queryContext: queryContext, + shaperCommandContext: SelectExpression: + SELECT "p"."Id", "p"."FirstName", "p"."LastName" + FROM "People" AS "p" + LIMIT @__p_1 OFFSET @__p_0, + shaper: UnbufferedEntityShaper), + queryContext: queryContext, + entityTrackingInfos: { itemType: Person }, + entityAccessors: List> + { + Func, + } + ), + contextType: JsonApiDotNetCoreExample.Data.AppDbContext, + logger: DiagnosticsLogger, + queryContext: queryContext) +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@__p_1='?', @__p_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "p"."Id", "p"."FirstName", "p"."LastName" + FROM "People" AS "p" + LIMIT @__p_1 OFFSET @__p_0 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@__p_1='?', @__p_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "p"."Id", "p"."FirstName", "p"."LastName" + FROM "People" AS "p" + LIMIT @__p_1 OFFSET @__p_0 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@__p_1='?', @__p_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "p"."Id", "p"."FirstName", "p"."LastName" + FROM "People" AS "p" + LIMIT @__p_1 OFFSET @__p_0 +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action method JsonApiDotNetCoreExample.Controllers.PeopleController.GetAsync (JsonApiDotNetCoreExample), returned result Microsoft.AspNetCore.Mvc.OkObjectResult. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[4] + No information found on request to perform content negotiation. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[2] + Selected output formatter 'JsonApiDotNetCore.Formatters.JsonApiOutputFormatter' and content type '' to write the response. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: JsonApiDotNetCore.Formatters.JsonApiWriter[0] + Formatting response as JSONAPI +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.PeopleController.GetAsync (JsonApiDotNetCoreExample) in 54.361ms +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 78.817ms 200 application/vnd.api+json +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.PeopleController.GetAsync (JsonApiDotNetCoreExample) in 54.361ms +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 78.817ms 200 application/vnd.api+json +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[5] + Hosting shutdown +dbug: Microsoft.EntityFrameworkCore.Infrastructure[10401] + An 'IServiceProvider' was created for internal use by Entity Framework. +warn: Microsoft.EntityFrameworkCore.Infrastructure[10402] + More than twenty 'IServiceProvider' instances have been created for internal use by Entity Framework. Consider reviewing calls on 'DbContextOptionsBuilder' that may require new service providers to be built. +info: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[0] + User profile is available. Using '/Users/jarednance/.aspnet/DataProtection-Keys' as key repository; keys will not be encrypted at rest. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-b040dd03-33c5-451e-8f42-3c9dd4e0dfec.xml'. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-c8147b66-2deb-407c-9421-1553f0e16d67.xml'. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-f7fa4a09-6d65-426e-a653-cbd2969e5073.xml'. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {b040dd03-33c5-451e-8f42-3c9dd4e0dfec}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {c8147b66-2deb-407c-9421-1553f0e16d67}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {f7fa4a09-6d65-426e-a653-cbd2969e5073}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.DefaultKeyResolver[13] + Considering key {c8147b66-2deb-407c-9421-1553f0e16d67} with expiration date 2018-03-03 16:22:35Z as default key. +dbug: Microsoft.AspNetCore.DataProtection.TypeForwardingActivator[0] + Forwarded activator type request from Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Version=1.1.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60 to Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Culture=neutral, PublicKeyToken=adb9793829ddae60 +dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptorFactory[11] + Using managed symmetric algorithm 'System.Security.Cryptography.Aes'. +dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptorFactory[10] + Using managed keyed hash algorithm 'System.Security.Cryptography.HMACSHA256'. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingProvider[2] + Using key {c8147b66-2deb-407c-9421-1553f0e16d67} as the default key. +dbug: Microsoft.AspNetCore.DataProtection.Internal.DataProtectionStartupFilter[0] + Key ring with default key {c8147b66-2deb-407c-9421-1553f0e16d67} was loaded during application startup. +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[], CommandType='Text', CommandTimeout='30'] + + SELECT CASE WHEN COUNT(*) = 0 THEN FALSE ELSE TRUE END + FROM information_schema.tables + WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema') +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (2ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + + SELECT CASE WHEN COUNT(*) = 0 THEN FALSE ELSE TRUE END + FROM information_schema.tables + WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema') +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[3] + Hosting starting +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[4] + Hosting started +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[0] + Loaded hosting startup assembly JsonApiDotNetCoreExample +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20200] + Beginning transaction with isolation level 'ReadCommitted'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?', @p8='?', @p9='?', @p10='?', @p11='?', @p12='?', @p13='?', @p14='?', @p15='?', @p16='?', @p17='?', @p18='?', @p19='?', @p20='?', @p21='?', @p22='?', @p23='?', @p24='?', @p25='?', @p26='?', @p27='?', @p28='?', @p29='?', @p30='?', @p31='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6, @p7) + RETURNING "Id"; + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p8, @p9, @p10, @p11, @p12, @p13, @p14, @p15) + RETURNING "Id"; + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p16, @p17, @p18, @p19, @p20, @p21, @p22, @p23) + RETURNING "Id"; + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p24, @p25, @p26, @p27, @p28, @p29, @p30, @p31) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (2ms) [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?', @p8='?', @p9='?', @p10='?', @p11='?', @p12='?', @p13='?', @p14='?', @p15='?', @p16='?', @p17='?', @p18='?', @p19='?', @p20='?', @p21='?', @p22='?', @p23='?', @p24='?', @p25='?', @p26='?', @p27='?', @p28='?', @p29='?', @p30='?', @p31='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6, @p7) + RETURNING "Id"; + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p8, @p9, @p10, @p11, @p12, @p13, @p14, @p15) + RETURNING "Id"; + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p16, @p17, @p18, @p19, @p20, @p21, @p22, @p23) + RETURNING "Id"; + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p24, @p25, @p26, @p27, @p28, @p29, @p30, @p31) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (2ms) [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?', @p8='?', @p9='?', @p10='?', @p11='?', @p12='?', @p13='?', @p14='?', @p15='?', @p16='?', @p17='?', @p18='?', @p19='?', @p20='?', @p21='?', @p22='?', @p23='?', @p24='?', @p25='?', @p26='?', @p27='?', @p28='?', @p29='?', @p30='?', @p31='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6, @p7) + RETURNING "Id"; + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p8, @p9, @p10, @p11, @p12, @p13, @p14, @p15) + RETURNING "Id"; + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p16, @p17, @p18, @p19, @p20, @p21, @p22, @p23) + RETURNING "Id"; + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p24, @p25, @p26, @p27, @p28, @p29, @p30, @p31) + RETURNING "Id"; +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20202] + Committing transaction. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20204] + Disposing transaction. +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 GET http://localhost/api/v1/todo-items?page[size]=2 +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 GET http://localhost/api/v1/todo-items?page[size]=2 +dbug: Microsoft.AspNetCore.Routing.Tree.TreeRouter[1] + Request successfully matched the route with name '(null)' and template 'api/v1/todo-items'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.TodoItemsController.PostAsync (JsonApiDotNetCoreExample)' with id '52af8b31-a0b5-47dc-9061-17639045ff8f' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) with arguments ((null)) - ModelState is Valid +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) with arguments ((null)) - ModelState is Valid +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Query[10101] + Compiling query model: + '(from TodoItem _1 in DbSet + select [_1]).Count()' +dbug: Microsoft.EntityFrameworkCore.Query[10104] + Optimized query model: + '(from TodoItem _1 in DbSet + select [_1]).Count()' +dbug: Microsoft.EntityFrameworkCore.Query[10107] + (QueryContext queryContext) => IAsyncEnumerable _InterceptExceptions( + source: IAsyncEnumerable _ToSequence(Task GetResult( + valueBuffers: IAsyncEnumerable _Query( + queryContext: queryContext, + shaperCommandContext: SelectExpression: + SELECT COUNT(*)::INT4 + FROM "TodoItems" AS "t"), + throwOnNullResult: False, + cancellationToken: queryContext.CancellationToken)), + contextType: JsonApiDotNetCoreExample.Data.AppDbContext, + logger: DiagnosticsLogger, + queryContext: queryContext) +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[], CommandType='Text', CommandTimeout='30'] + SELECT COUNT(*)::INT4 + FROM "TodoItems" AS "t" +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (10ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + SELECT COUNT(*)::INT4 + FROM "TodoItems" AS "t" +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (10ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + SELECT COUNT(*)::INT4 + FROM "TodoItems" AS "t" +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +info: JsonApiDotNetCore.Services.EntityResourceService[0] + Applying paging query. Fetching page 0 with 2 entities +dbug: Microsoft.EntityFrameworkCore.Query[10101] + Compiling query model: + '(from TodoItem _2 in DbSet + select [_2]) + .Skip(__p_0) + .Take(__p_1)' +warn: Microsoft.EntityFrameworkCore.Query[10102] + Query: '(from TodoItem _2 in DbSet select [_2]).Skip(__p_0).Take(__p_1)' uses a row limiting operation (Skip/Take) without OrderBy which may lead to unpredictable results. +warn: Microsoft.EntityFrameworkCore.Query[10102] + Query: '(from TodoItem _2 in DbSet select [_2]).Skip(__p_0).Take(__p_1)' uses a row limiting operation (Skip/Take) without OrderBy which may lead to unpredictable results. +dbug: Microsoft.EntityFrameworkCore.Query[10104] + Optimized query model: + '(from TodoItem _2 in DbSet + select [_2]) + .Skip(__p_0) + .Take(__p_1)' +dbug: Microsoft.EntityFrameworkCore.Query[10107] + (QueryContext queryContext) => IAsyncEnumerable _InterceptExceptions( + source: IAsyncEnumerable _TrackEntities( + results: IAsyncEnumerable _ShapedQuery( + queryContext: queryContext, + shaperCommandContext: SelectExpression: + SELECT "t"."Id", "t"."AchievedDate", "t"."AssigneeId", "t"."CollectionId", "t"."CreatedDate", "t"."Description", "t"."GuidProperty", "t"."Ordinal", "t"."OwnerId" + FROM "TodoItems" AS "t" + LIMIT @__p_1 OFFSET @__p_0, + shaper: UnbufferedEntityShaper), + queryContext: queryContext, + entityTrackingInfos: { itemType: TodoItem }, + entityAccessors: List> + { + Func, + } + ), + contextType: JsonApiDotNetCoreExample.Data.AppDbContext, + logger: DiagnosticsLogger, + queryContext: queryContext) +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@__p_1='?', @__p_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "t"."Id", "t"."AchievedDate", "t"."AssigneeId", "t"."CollectionId", "t"."CreatedDate", "t"."Description", "t"."GuidProperty", "t"."Ordinal", "t"."OwnerId" + FROM "TodoItems" AS "t" + LIMIT @__p_1 OFFSET @__p_0 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@__p_1='?', @__p_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "t"."Id", "t"."AchievedDate", "t"."AssigneeId", "t"."CollectionId", "t"."CreatedDate", "t"."Description", "t"."GuidProperty", "t"."Ordinal", "t"."OwnerId" + FROM "TodoItems" AS "t" + LIMIT @__p_1 OFFSET @__p_0 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@__p_1='?', @__p_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "t"."Id", "t"."AchievedDate", "t"."AssigneeId", "t"."CollectionId", "t"."CreatedDate", "t"."Description", "t"."GuidProperty", "t"."Ordinal", "t"."OwnerId" + FROM "TodoItems" AS "t" + LIMIT @__p_1 OFFSET @__p_0 +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample), returned result Microsoft.AspNetCore.Mvc.OkObjectResult. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[4] + No information found on request to perform content negotiation. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[2] + Selected output formatter 'JsonApiDotNetCore.Formatters.JsonApiOutputFormatter' and content type '' to write the response. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: JsonApiDotNetCore.Formatters.JsonApiWriter[0] + Formatting response as JSONAPI +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) in 38.24ms +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) in 38.24ms +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 64.502ms 200 application/vnd.api+json +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 64.502ms 200 application/vnd.api+json +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[5] + Hosting shutdown +dbug: Microsoft.EntityFrameworkCore.Infrastructure[10401] + An 'IServiceProvider' was created for internal use by Entity Framework. +warn: Microsoft.EntityFrameworkCore.Infrastructure[10402] + More than twenty 'IServiceProvider' instances have been created for internal use by Entity Framework. Consider reviewing calls on 'DbContextOptionsBuilder' that may require new service providers to be built. +info: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[0] + User profile is available. Using '/Users/jarednance/.aspnet/DataProtection-Keys' as key repository; keys will not be encrypted at rest. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-b040dd03-33c5-451e-8f42-3c9dd4e0dfec.xml'. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-c8147b66-2deb-407c-9421-1553f0e16d67.xml'. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-f7fa4a09-6d65-426e-a653-cbd2969e5073.xml'. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {b040dd03-33c5-451e-8f42-3c9dd4e0dfec}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {c8147b66-2deb-407c-9421-1553f0e16d67}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {f7fa4a09-6d65-426e-a653-cbd2969e5073}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.DefaultKeyResolver[13] + Considering key {c8147b66-2deb-407c-9421-1553f0e16d67} with expiration date 2018-03-03 16:22:35Z as default key. +dbug: Microsoft.AspNetCore.DataProtection.TypeForwardingActivator[0] + Forwarded activator type request from Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Version=1.1.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60 to Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Culture=neutral, PublicKeyToken=adb9793829ddae60 +dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptorFactory[11] + Using managed symmetric algorithm 'System.Security.Cryptography.Aes'. +dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptorFactory[10] + Using managed keyed hash algorithm 'System.Security.Cryptography.HMACSHA256'. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingProvider[2] + Using key {c8147b66-2deb-407c-9421-1553f0e16d67} as the default key. +dbug: Microsoft.AspNetCore.DataProtection.Internal.DataProtectionStartupFilter[0] + Key ring with default key {c8147b66-2deb-407c-9421-1553f0e16d67} was loaded during application startup. +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[], CommandType='Text', CommandTimeout='30'] + + SELECT CASE WHEN COUNT(*) = 0 THEN FALSE ELSE TRUE END + FROM information_schema.tables + WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema') +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (2ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + + SELECT CASE WHEN COUNT(*) = 0 THEN FALSE ELSE TRUE END + FROM information_schema.tables + WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema') +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[3] + Hosting starting +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[4] + Hosting started +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[0] + Loaded hosting startup assembly JsonApiDotNetCoreExample +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Query[10101] + Compiling query model: + 'from TodoItem _0 in DbSet + select [_0]' +dbug: Microsoft.EntityFrameworkCore.Query[10104] + Optimized query model: + 'from TodoItem _0 in DbSet + select [_0]' +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Query[10107] + (QueryContext queryContext) => IEnumerable _InterceptExceptions( + source: IEnumerable _TrackEntities( + results: IEnumerable _ShapedQuery( + queryContext: queryContext, + shaperCommandContext: SelectExpression: + SELECT "t"."Id", "t"."AchievedDate", "t"."AssigneeId", "t"."CollectionId", "t"."CreatedDate", "t"."Description", "t"."GuidProperty", "t"."Ordinal", "t"."OwnerId" + FROM "TodoItems" AS "t", + shaper: UnbufferedEntityShaper), + queryContext: queryContext, + entityTrackingInfos: { itemType: TodoItem }, + entityAccessors: List> + { + Func, + } + ), + contextType: JsonApiDotNetCoreExample.Data.AppDbContext, + logger: DiagnosticsLogger, + queryContext: queryContext) +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[], CommandType='Text', CommandTimeout='30'] + SELECT "t"."Id", "t"."AchievedDate", "t"."AssigneeId", "t"."CollectionId", "t"."CreatedDate", "t"."Description", "t"."GuidProperty", "t"."Ordinal", "t"."OwnerId" + FROM "TodoItems" AS "t" +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + SELECT "t"."Id", "t"."AchievedDate", "t"."AssigneeId", "t"."CollectionId", "t"."CreatedDate", "t"."Description", "t"."GuidProperty", "t"."Ordinal", "t"."OwnerId" + FROM "TodoItems" AS "t" +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + SELECT "t"."Id", "t"."AchievedDate", "t"."AssigneeId", "t"."CollectionId", "t"."CreatedDate", "t"."Description", "t"."GuidProperty", "t"."Ordinal", "t"."OwnerId" + FROM "TodoItems" AS "t" +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20200] + Beginning transaction with isolation level 'ReadCommitted'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?', @p8='?', @p9='?', @p10='?', @p11='?', @p12='?', @p13='?', @p14='?', @p15='?', @p16='?', @p17='?', @p18='?', @p19='?', @p20='?', @p21='?', @p22='?', @p23='?', @p24='?', @p25='?', @p26='?', @p27='?', @p28='?', @p29='?', @p30='?', @p31='?', @p32='?', @p33='?', @p34='?', @p35='?', @p36='?', @p37='?', @p38='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "People" ("FirstName", "LastName") + VALUES (@p0, @p1) + RETURNING "Id"; + DELETE FROM "TodoItems" + WHERE "Id" = @p2; + DELETE FROM "TodoItems" + WHERE "Id" = @p3; + DELETE FROM "TodoItems" + WHERE "Id" = @p4; + DELETE FROM "TodoItems" + WHERE "Id" = @p5; + DELETE FROM "TodoItems" + WHERE "Id" = @p6; + DELETE FROM "TodoItems" + WHERE "Id" = @p7; + DELETE FROM "TodoItems" + WHERE "Id" = @p8; + DELETE FROM "TodoItems" + WHERE "Id" = @p9; + DELETE FROM "TodoItems" + WHERE "Id" = @p10; + DELETE FROM "TodoItems" + WHERE "Id" = @p11; + DELETE FROM "TodoItems" + WHERE "Id" = @p12; + DELETE FROM "TodoItems" + WHERE "Id" = @p13; + DELETE FROM "TodoItems" + WHERE "Id" = @p14; + DELETE FROM "TodoItems" + WHERE "Id" = @p15; + DELETE FROM "TodoItems" + WHERE "Id" = @p16; + DELETE FROM "TodoItems" + WHERE "Id" = @p17; + DELETE FROM "TodoItems" + WHERE "Id" = @p18; + DELETE FROM "TodoItems" + WHERE "Id" = @p19; + DELETE FROM "TodoItems" + WHERE "Id" = @p20; + DELETE FROM "TodoItems" + WHERE "Id" = @p21; + DELETE FROM "TodoItems" + WHERE "Id" = @p22; + DELETE FROM "TodoItems" + WHERE "Id" = @p23; + DELETE FROM "TodoItems" + WHERE "Id" = @p24; + DELETE FROM "TodoItems" + WHERE "Id" = @p25; + DELETE FROM "TodoItems" + WHERE "Id" = @p26; + DELETE FROM "TodoItems" + WHERE "Id" = @p27; + DELETE FROM "TodoItems" + WHERE "Id" = @p28; + DELETE FROM "TodoItems" + WHERE "Id" = @p29; + DELETE FROM "TodoItems" + WHERE "Id" = @p30; + DELETE FROM "TodoItems" + WHERE "Id" = @p31; + DELETE FROM "TodoItems" + WHERE "Id" = @p32; + DELETE FROM "TodoItems" + WHERE "Id" = @p33; + DELETE FROM "TodoItems" + WHERE "Id" = @p34; + DELETE FROM "TodoItems" + WHERE "Id" = @p35; + DELETE FROM "TodoItems" + WHERE "Id" = @p36; + DELETE FROM "TodoItems" + WHERE "Id" = @p37; + DELETE FROM "TodoItems" + WHERE "Id" = @p38; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (4ms) [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?', @p8='?', @p9='?', @p10='?', @p11='?', @p12='?', @p13='?', @p14='?', @p15='?', @p16='?', @p17='?', @p18='?', @p19='?', @p20='?', @p21='?', @p22='?', @p23='?', @p24='?', @p25='?', @p26='?', @p27='?', @p28='?', @p29='?', @p30='?', @p31='?', @p32='?', @p33='?', @p34='?', @p35='?', @p36='?', @p37='?', @p38='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "People" ("FirstName", "LastName") + VALUES (@p0, @p1) + RETURNING "Id"; + DELETE FROM "TodoItems" + WHERE "Id" = @p2; + DELETE FROM "TodoItems" + WHERE "Id" = @p3; + DELETE FROM "TodoItems" + WHERE "Id" = @p4; + DELETE FROM "TodoItems" + WHERE "Id" = @p5; + DELETE FROM "TodoItems" + WHERE "Id" = @p6; + DELETE FROM "TodoItems" + WHERE "Id" = @p7; + DELETE FROM "TodoItems" + WHERE "Id" = @p8; + DELETE FROM "TodoItems" + WHERE "Id" = @p9; + DELETE FROM "TodoItems" + WHERE "Id" = @p10; + DELETE FROM "TodoItems" + WHERE "Id" = @p11; + DELETE FROM "TodoItems" + WHERE "Id" = @p12; + DELETE FROM "TodoItems" + WHERE "Id" = @p13; + DELETE FROM "TodoItems" + WHERE "Id" = @p14; + DELETE FROM "TodoItems" + WHERE "Id" = @p15; + DELETE FROM "TodoItems" + WHERE "Id" = @p16; + DELETE FROM "TodoItems" + WHERE "Id" = @p17; + DELETE FROM "TodoItems" + WHERE "Id" = @p18; + DELETE FROM "TodoItems" + WHERE "Id" = @p19; + DELETE FROM "TodoItems" + WHERE "Id" = @p20; + DELETE FROM "TodoItems" + WHERE "Id" = @p21; + DELETE FROM "TodoItems" + WHERE "Id" = @p22; + DELETE FROM "TodoItems" + WHERE "Id" = @p23; + DELETE FROM "TodoItems" + WHERE "Id" = @p24; + DELETE FROM "TodoItems" + WHERE "Id" = @p25; + DELETE FROM "TodoItems" + WHERE "Id" = @p26; + DELETE FROM "TodoItems" + WHERE "Id" = @p27; + DELETE FROM "TodoItems" + WHERE "Id" = @p28; + DELETE FROM "TodoItems" + WHERE "Id" = @p29; + DELETE FROM "TodoItems" + WHERE "Id" = @p30; + DELETE FROM "TodoItems" + WHERE "Id" = @p31; + DELETE FROM "TodoItems" + WHERE "Id" = @p32; + DELETE FROM "TodoItems" + WHERE "Id" = @p33; + DELETE FROM "TodoItems" + WHERE "Id" = @p34; + DELETE FROM "TodoItems" + WHERE "Id" = @p35; + DELETE FROM "TodoItems" + WHERE "Id" = @p36; + DELETE FROM "TodoItems" + WHERE "Id" = @p37; + DELETE FROM "TodoItems" + WHERE "Id" = @p38; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (4ms) [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?', @p8='?', @p9='?', @p10='?', @p11='?', @p12='?', @p13='?', @p14='?', @p15='?', @p16='?', @p17='?', @p18='?', @p19='?', @p20='?', @p21='?', @p22='?', @p23='?', @p24='?', @p25='?', @p26='?', @p27='?', @p28='?', @p29='?', @p30='?', @p31='?', @p32='?', @p33='?', @p34='?', @p35='?', @p36='?', @p37='?', @p38='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "People" ("FirstName", "LastName") + VALUES (@p0, @p1) + RETURNING "Id"; + DELETE FROM "TodoItems" + WHERE "Id" = @p2; + DELETE FROM "TodoItems" + WHERE "Id" = @p3; + DELETE FROM "TodoItems" + WHERE "Id" = @p4; + DELETE FROM "TodoItems" + WHERE "Id" = @p5; + DELETE FROM "TodoItems" + WHERE "Id" = @p6; + DELETE FROM "TodoItems" + WHERE "Id" = @p7; + DELETE FROM "TodoItems" + WHERE "Id" = @p8; + DELETE FROM "TodoItems" + WHERE "Id" = @p9; + DELETE FROM "TodoItems" + WHERE "Id" = @p10; + DELETE FROM "TodoItems" + WHERE "Id" = @p11; + DELETE FROM "TodoItems" + WHERE "Id" = @p12; + DELETE FROM "TodoItems" + WHERE "Id" = @p13; + DELETE FROM "TodoItems" + WHERE "Id" = @p14; + DELETE FROM "TodoItems" + WHERE "Id" = @p15; + DELETE FROM "TodoItems" + WHERE "Id" = @p16; + DELETE FROM "TodoItems" + WHERE "Id" = @p17; + DELETE FROM "TodoItems" + WHERE "Id" = @p18; + DELETE FROM "TodoItems" + WHERE "Id" = @p19; + DELETE FROM "TodoItems" + WHERE "Id" = @p20; + DELETE FROM "TodoItems" + WHERE "Id" = @p21; + DELETE FROM "TodoItems" + WHERE "Id" = @p22; + DELETE FROM "TodoItems" + WHERE "Id" = @p23; + DELETE FROM "TodoItems" + WHERE "Id" = @p24; + DELETE FROM "TodoItems" + WHERE "Id" = @p25; + DELETE FROM "TodoItems" + WHERE "Id" = @p26; + DELETE FROM "TodoItems" + WHERE "Id" = @p27; + DELETE FROM "TodoItems" + WHERE "Id" = @p28; + DELETE FROM "TodoItems" + WHERE "Id" = @p29; + DELETE FROM "TodoItems" + WHERE "Id" = @p30; + DELETE FROM "TodoItems" + WHERE "Id" = @p31; + DELETE FROM "TodoItems" + WHERE "Id" = @p32; + DELETE FROM "TodoItems" + WHERE "Id" = @p33; + DELETE FROM "TodoItems" + WHERE "Id" = @p34; + DELETE FROM "TodoItems" + WHERE "Id" = @p35; + DELETE FROM "TodoItems" + WHERE "Id" = @p36; + DELETE FROM "TodoItems" + WHERE "Id" = @p37; + DELETE FROM "TodoItems" + WHERE "Id" = @p38; +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@p39='?', @p40='?', @p41='?', @p42='?', @p43='?', @p44='?', @p45='?', @p46='?', @p47='?', @p48='?', @p49='?', @p50='?', @p51='?', @p52='?', @p53='?', @p54='?', @p55='?', @p56='?', @p57='?', @p58='?', @p59='?', @p60='?', @p61='?', @p62='?', @p63='?', @p64='?', @p65='?', @p66='?', @p67='?', @p68='?', @p69='?', @p70='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p39, @p40, @p41, @p42, @p43, @p44, @p45, @p46) + RETURNING "Id"; + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p47, @p48, @p49, @p50, @p51, @p52, @p53, @p54) + RETURNING "Id"; + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p55, @p56, @p57, @p58, @p59, @p60, @p61, @p62) + RETURNING "Id"; + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p63, @p64, @p65, @p66, @p67, @p68, @p69, @p70) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (2ms) [Parameters=[@p39='?', @p40='?', @p41='?', @p42='?', @p43='?', @p44='?', @p45='?', @p46='?', @p47='?', @p48='?', @p49='?', @p50='?', @p51='?', @p52='?', @p53='?', @p54='?', @p55='?', @p56='?', @p57='?', @p58='?', @p59='?', @p60='?', @p61='?', @p62='?', @p63='?', @p64='?', @p65='?', @p66='?', @p67='?', @p68='?', @p69='?', @p70='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p39, @p40, @p41, @p42, @p43, @p44, @p45, @p46) + RETURNING "Id"; + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p47, @p48, @p49, @p50, @p51, @p52, @p53, @p54) + RETURNING "Id"; + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p55, @p56, @p57, @p58, @p59, @p60, @p61, @p62) + RETURNING "Id"; + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p63, @p64, @p65, @p66, @p67, @p68, @p69, @p70) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (2ms) [Parameters=[@p39='?', @p40='?', @p41='?', @p42='?', @p43='?', @p44='?', @p45='?', @p46='?', @p47='?', @p48='?', @p49='?', @p50='?', @p51='?', @p52='?', @p53='?', @p54='?', @p55='?', @p56='?', @p57='?', @p58='?', @p59='?', @p60='?', @p61='?', @p62='?', @p63='?', @p64='?', @p65='?', @p66='?', @p67='?', @p68='?', @p69='?', @p70='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p39, @p40, @p41, @p42, @p43, @p44, @p45, @p46) + RETURNING "Id"; + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p47, @p48, @p49, @p50, @p51, @p52, @p53, @p54) + RETURNING "Id"; + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p55, @p56, @p57, @p58, @p59, @p60, @p61, @p62) + RETURNING "Id"; + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p63, @p64, @p65, @p66, @p67, @p68, @p69, @p70) + RETURNING "Id"; +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20202] + Committing transaction. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20204] + Disposing transaction. +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 GET http://localhost/api/v1/todo-items?page[size]=2&page[number]=1 +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 GET http://localhost/api/v1/todo-items?page[size]=2&page[number]=1 +dbug: Microsoft.AspNetCore.Routing.Tree.TreeRouter[1] + Request successfully matched the route with name '(null)' and template 'api/v1/todo-items'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.TodoItemsController.PostAsync (JsonApiDotNetCoreExample)' with id '8b075eda-2371-4b4f-8774-1f6d937181b9' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) with arguments ((null)) - ModelState is Valid +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) with arguments ((null)) - ModelState is Valid +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Query[10101] + Compiling query model: + '(from TodoItem _1 in DbSet + select [_1]).Count()' +dbug: Microsoft.EntityFrameworkCore.Query[10104] + Optimized query model: + '(from TodoItem _1 in DbSet + select [_1]).Count()' +dbug: Microsoft.EntityFrameworkCore.Query[10107] + (QueryContext queryContext) => IAsyncEnumerable _InterceptExceptions( + source: IAsyncEnumerable _ToSequence(Task GetResult( + valueBuffers: IAsyncEnumerable _Query( + queryContext: queryContext, + shaperCommandContext: SelectExpression: + SELECT COUNT(*)::INT4 + FROM "TodoItems" AS "t"), + throwOnNullResult: False, + cancellationToken: queryContext.CancellationToken)), + contextType: JsonApiDotNetCoreExample.Data.AppDbContext, + logger: DiagnosticsLogger, + queryContext: queryContext) +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[], CommandType='Text', CommandTimeout='30'] + SELECT COUNT(*)::INT4 + FROM "TodoItems" AS "t" +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + SELECT COUNT(*)::INT4 + FROM "TodoItems" AS "t" +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + SELECT COUNT(*)::INT4 + FROM "TodoItems" AS "t" +info: JsonApiDotNetCore.Services.EntityResourceService[0] + Applying paging query. Fetching page 1 with 2 entities +dbug: Microsoft.EntityFrameworkCore.Query[10101] + Compiling query model: + '(from TodoItem _2 in DbSet + select [_2]) + .Skip(__p_0) + .Take(__p_1)' +warn: Microsoft.EntityFrameworkCore.Query[10102] + Query: '(from TodoItem _2 in DbSet select [_2]).Skip(__p_0).Take(__p_1)' uses a row limiting operation (Skip/Take) without OrderBy which may lead to unpredictable results. +warn: Microsoft.EntityFrameworkCore.Query[10102] + Query: '(from TodoItem _2 in DbSet select [_2]).Skip(__p_0).Take(__p_1)' uses a row limiting operation (Skip/Take) without OrderBy which may lead to unpredictable results. +dbug: Microsoft.EntityFrameworkCore.Query[10104] + Optimized query model: + '(from TodoItem _2 in DbSet + select [_2]) + .Skip(__p_0) + .Take(__p_1)' +dbug: Microsoft.EntityFrameworkCore.Query[10107] + (QueryContext queryContext) => IAsyncEnumerable _InterceptExceptions( + source: IAsyncEnumerable _TrackEntities( + results: IAsyncEnumerable _ShapedQuery( + queryContext: queryContext, + shaperCommandContext: SelectExpression: + SELECT "t"."Id", "t"."AchievedDate", "t"."AssigneeId", "t"."CollectionId", "t"."CreatedDate", "t"."Description", "t"."GuidProperty", "t"."Ordinal", "t"."OwnerId" + FROM "TodoItems" AS "t" + LIMIT @__p_1 OFFSET @__p_0, + shaper: UnbufferedEntityShaper), + queryContext: queryContext, + entityTrackingInfos: { itemType: TodoItem }, + entityAccessors: List> + { + Func, + } + ), + contextType: JsonApiDotNetCoreExample.Data.AppDbContext, + logger: DiagnosticsLogger, + queryContext: queryContext) +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@__p_1='?', @__p_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "t"."Id", "t"."AchievedDate", "t"."AssigneeId", "t"."CollectionId", "t"."CreatedDate", "t"."Description", "t"."GuidProperty", "t"."Ordinal", "t"."OwnerId" + FROM "TodoItems" AS "t" + LIMIT @__p_1 OFFSET @__p_0 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@__p_1='?', @__p_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "t"."Id", "t"."AchievedDate", "t"."AssigneeId", "t"."CollectionId", "t"."CreatedDate", "t"."Description", "t"."GuidProperty", "t"."Ordinal", "t"."OwnerId" + FROM "TodoItems" AS "t" + LIMIT @__p_1 OFFSET @__p_0 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@__p_1='?', @__p_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "t"."Id", "t"."AchievedDate", "t"."AssigneeId", "t"."CollectionId", "t"."CreatedDate", "t"."Description", "t"."GuidProperty", "t"."Ordinal", "t"."OwnerId" + FROM "TodoItems" AS "t" + LIMIT @__p_1 OFFSET @__p_0 +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample), returned result Microsoft.AspNetCore.Mvc.OkObjectResult. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[4] + No information found on request to perform content negotiation. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[2] + Selected output formatter 'JsonApiDotNetCore.Formatters.JsonApiOutputFormatter' and content type '' to write the response. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: JsonApiDotNetCore.Formatters.JsonApiWriter[0] + Formatting response as JSONAPI +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) in 32.06ms +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) in 32.06ms +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 56.326ms 200 application/vnd.api+json +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 56.326ms 200 application/vnd.api+json +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[5] + Hosting shutdown +dbug: Microsoft.EntityFrameworkCore.Infrastructure[10401] + An 'IServiceProvider' was created for internal use by Entity Framework. +warn: Microsoft.EntityFrameworkCore.Infrastructure[10402] + More than twenty 'IServiceProvider' instances have been created for internal use by Entity Framework. Consider reviewing calls on 'DbContextOptionsBuilder' that may require new service providers to be built. +info: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[0] + User profile is available. Using '/Users/jarednance/.aspnet/DataProtection-Keys' as key repository; keys will not be encrypted at rest. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-b040dd03-33c5-451e-8f42-3c9dd4e0dfec.xml'. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-c8147b66-2deb-407c-9421-1553f0e16d67.xml'. +dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37] + Reading data from file '/Users/jarednance/.aspnet/DataProtection-Keys/key-f7fa4a09-6d65-426e-a653-cbd2969e5073.xml'. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {b040dd03-33c5-451e-8f42-3c9dd4e0dfec}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {c8147b66-2deb-407c-9421-1553f0e16d67}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18] + Found key {f7fa4a09-6d65-426e-a653-cbd2969e5073}. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.DefaultKeyResolver[13] + Considering key {c8147b66-2deb-407c-9421-1553f0e16d67} with expiration date 2018-03-03 16:22:35Z as default key. +dbug: Microsoft.AspNetCore.DataProtection.TypeForwardingActivator[0] + Forwarded activator type request from Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Version=1.1.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60 to Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Culture=neutral, PublicKeyToken=adb9793829ddae60 +dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptorFactory[11] + Using managed symmetric algorithm 'System.Security.Cryptography.Aes'. +dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptorFactory[10] + Using managed keyed hash algorithm 'System.Security.Cryptography.HMACSHA256'. +dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingProvider[2] + Using key {c8147b66-2deb-407c-9421-1553f0e16d67} as the default key. +dbug: Microsoft.AspNetCore.DataProtection.Internal.DataProtectionStartupFilter[0] + Key ring with default key {c8147b66-2deb-407c-9421-1553f0e16d67} was loaded during application startup. +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[], CommandType='Text', CommandTimeout='30'] + + SELECT CASE WHEN COUNT(*) = 0 THEN FALSE ELSE TRUE END + FROM information_schema.tables + WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema') +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (7ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + + SELECT CASE WHEN COUNT(*) = 0 THEN FALSE ELSE TRUE END + FROM information_schema.tables + WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema') +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[3] + Hosting starting +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[4] + Hosting started +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[0] + Loaded hosting startup assembly JsonApiDotNetCoreExample +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Query[10101] + Compiling query model: + 'from TodoItem _0 in DbSet + select [_0]' +dbug: Microsoft.EntityFrameworkCore.Query[10104] + Optimized query model: + 'from TodoItem _0 in DbSet + select [_0]' +dbug: Microsoft.EntityFrameworkCore.Query[10107] + (QueryContext queryContext) => IEnumerable _InterceptExceptions( + source: IEnumerable _TrackEntities( + results: IEnumerable _ShapedQuery( + queryContext: queryContext, + shaperCommandContext: SelectExpression: + SELECT "t"."Id", "t"."AchievedDate", "t"."AssigneeId", "t"."CollectionId", "t"."CreatedDate", "t"."Description", "t"."GuidProperty", "t"."Ordinal", "t"."OwnerId" + FROM "TodoItems" AS "t", + shaper: UnbufferedEntityShaper), + queryContext: queryContext, + entityTrackingInfos: { itemType: TodoItem }, + entityAccessors: List> + { + Func, + } + ), + contextType: JsonApiDotNetCoreExample.Data.AppDbContext, + logger: DiagnosticsLogger, + queryContext: queryContext) +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[], CommandType='Text', CommandTimeout='30'] + SELECT "t"."Id", "t"."AchievedDate", "t"."AssigneeId", "t"."CollectionId", "t"."CreatedDate", "t"."Description", "t"."GuidProperty", "t"."Ordinal", "t"."OwnerId" + FROM "TodoItems" AS "t" +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (2ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + SELECT "t"."Id", "t"."AchievedDate", "t"."AssigneeId", "t"."CollectionId", "t"."CreatedDate", "t"."Description", "t"."GuidProperty", "t"."Ordinal", "t"."OwnerId" + FROM "TodoItems" AS "t" +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (2ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + SELECT "t"."Id", "t"."AchievedDate", "t"."AssigneeId", "t"."CollectionId", "t"."CreatedDate", "t"."Description", "t"."GuidProperty", "t"."Ordinal", "t"."OwnerId" + FROM "TodoItems" AS "t" +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20200] + Beginning transaction with isolation level 'ReadCommitted'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "People" ("FirstName", "LastName") + VALUES (@p0, @p1) + RETURNING "Id"; + DELETE FROM "TodoItems" + WHERE "Id" = @p2; + DELETE FROM "TodoItems" + WHERE "Id" = @p3; + DELETE FROM "TodoItems" + WHERE "Id" = @p4; + DELETE FROM "TodoItems" + WHERE "Id" = @p5; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "People" ("FirstName", "LastName") + VALUES (@p0, @p1) + RETURNING "Id"; + DELETE FROM "TodoItems" + WHERE "Id" = @p2; + DELETE FROM "TodoItems" + WHERE "Id" = @p3; + DELETE FROM "TodoItems" + WHERE "Id" = @p4; + DELETE FROM "TodoItems" + WHERE "Id" = @p5; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "People" ("FirstName", "LastName") + VALUES (@p0, @p1) + RETURNING "Id"; + DELETE FROM "TodoItems" + WHERE "Id" = @p2; + DELETE FROM "TodoItems" + WHERE "Id" = @p3; + DELETE FROM "TodoItems" + WHERE "Id" = @p4; + DELETE FROM "TodoItems" + WHERE "Id" = @p5; +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@p6='?', @p7='?', @p8='?', @p9='?', @p10='?', @p11='?', @p12='?', @p13='?', @p14='?', @p15='?', @p16='?', @p17='?', @p18='?', @p19='?', @p20='?', @p21='?', @p22='?', @p23='?', @p24='?', @p25='?', @p26='?', @p27='?', @p28='?', @p29='?', @p30='?', @p31='?', @p32='?', @p33='?', @p34='?', @p35='?', @p36='?', @p37='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p6, @p7, @p8, @p9, @p10, @p11, @p12, @p13) + RETURNING "Id"; + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p14, @p15, @p16, @p17, @p18, @p19, @p20, @p21) + RETURNING "Id"; + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p22, @p23, @p24, @p25, @p26, @p27, @p28, @p29) + RETURNING "Id"; + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p30, @p31, @p32, @p33, @p34, @p35, @p36, @p37) + RETURNING "Id"; +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p6='?', @p7='?', @p8='?', @p9='?', @p10='?', @p11='?', @p12='?', @p13='?', @p14='?', @p15='?', @p16='?', @p17='?', @p18='?', @p19='?', @p20='?', @p21='?', @p22='?', @p23='?', @p24='?', @p25='?', @p26='?', @p27='?', @p28='?', @p29='?', @p30='?', @p31='?', @p32='?', @p33='?', @p34='?', @p35='?', @p36='?', @p37='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p6, @p7, @p8, @p9, @p10, @p11, @p12, @p13) + RETURNING "Id"; + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p14, @p15, @p16, @p17, @p18, @p19, @p20, @p21) + RETURNING "Id"; + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p22, @p23, @p24, @p25, @p26, @p27, @p28, @p29) + RETURNING "Id"; + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p30, @p31, @p32, @p33, @p34, @p35, @p36, @p37) + RETURNING "Id"; +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@p6='?', @p7='?', @p8='?', @p9='?', @p10='?', @p11='?', @p12='?', @p13='?', @p14='?', @p15='?', @p16='?', @p17='?', @p18='?', @p19='?', @p20='?', @p21='?', @p22='?', @p23='?', @p24='?', @p25='?', @p26='?', @p27='?', @p28='?', @p29='?', @p30='?', @p31='?', @p32='?', @p33='?', @p34='?', @p35='?', @p36='?', @p37='?'], CommandType='Text', CommandTimeout='30'] + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p6, @p7, @p8, @p9, @p10, @p11, @p12, @p13) + RETURNING "Id"; + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p14, @p15, @p16, @p17, @p18, @p19, @p20, @p21) + RETURNING "Id"; + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p22, @p23, @p24, @p25, @p26, @p27, @p28, @p29) + RETURNING "Id"; + INSERT INTO "TodoItems" ("AchievedDate", "AssigneeId", "CollectionId", "CreatedDate", "Description", "GuidProperty", "Ordinal", "OwnerId") + VALUES (@p30, @p31, @p32, @p33, @p34, @p35, @p36, @p37) + RETURNING "Id"; +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20202] + Committing transaction. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Transaction[20204] + Disposing transaction. +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 GET http://localhost/api/v1/todo-items?page[size]=2&page[number]=-1 +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] + Request starting HTTP/1.1 GET http://localhost/api/v1/todo-items?page[size]=2&page[number]=-1 +dbug: Microsoft.AspNetCore.Routing.Tree.TreeRouter[1] + Request successfully matched the route with name '(null)' and template 'api/v1/todo-items'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ActionSelector[2] + Action 'JsonApiDotNetCoreExample.Controllers.TodoItemsController.PostAsync (JsonApiDotNetCoreExample)' with id '0185f6c8-2dbf-416d-abd0-a7a72d063bea' did not match the constraint 'Microsoft.AspNetCore.Mvc.Internal.HttpMethodActionConstraint' +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) with arguments ((null)) - ModelState is Valid +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] + Executing action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) with arguments ((null)) - ModelState is Valid +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +info: Microsoft.EntityFrameworkCore.Infrastructure[10403] + Entity Framework Core 2.0.1-rtm-125 initialized 'AppDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: None +dbug: Microsoft.EntityFrameworkCore.Query[10101] + Compiling query model: + '(from TodoItem _1 in DbSet + select [_1]).Count()' +dbug: Microsoft.EntityFrameworkCore.Query[10104] + Optimized query model: + '(from TodoItem _1 in DbSet + select [_1]).Count()' +dbug: Microsoft.EntityFrameworkCore.Query[10107] + (QueryContext queryContext) => IAsyncEnumerable _InterceptExceptions( + source: IAsyncEnumerable _ToSequence(Task GetResult( + valueBuffers: IAsyncEnumerable _Query( + queryContext: queryContext, + shaperCommandContext: SelectExpression: + SELECT COUNT(*)::INT4 + FROM "TodoItems" AS "t"), + throwOnNullResult: False, + cancellationToken: queryContext.CancellationToken)), + contextType: JsonApiDotNetCoreExample.Data.AppDbContext, + logger: DiagnosticsLogger, + queryContext: queryContext) +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[], CommandType='Text', CommandTimeout='30'] + SELECT COUNT(*)::INT4 + FROM "TodoItems" AS "t" +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (7ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + SELECT COUNT(*)::INT4 + FROM "TodoItems" AS "t" +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +info: JsonApiDotNetCore.Services.EntityResourceService[0] + Applying paging query. Fetching page -1 with 2 entities +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (7ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + SELECT COUNT(*)::INT4 + FROM "TodoItems" AS "t" +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[], CommandType='Text', CommandTimeout='30'] + SELECT COUNT(*)::INT4 + FROM "TodoItems" AS "t" +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + SELECT COUNT(*)::INT4 + FROM "TodoItems" AS "t" +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] + SELECT COUNT(*)::INT4 + FROM "TodoItems" AS "t" +dbug: Microsoft.EntityFrameworkCore.Query[10101] + Compiling query model: + '(from TodoItem _2 in DbSet + select [_2]) + .Skip(__p_0) + .Take(__p_1)' +warn: Microsoft.EntityFrameworkCore.Query[10102] + Query: '(from TodoItem _2 in DbSet select [_2]).Skip(__p_0).Take(__p_1)' uses a row limiting operation (Skip/Take) without OrderBy which may lead to unpredictable results. +warn: Microsoft.EntityFrameworkCore.Query[10102] + Query: '(from TodoItem _2 in DbSet select [_2]).Skip(__p_0).Take(__p_1)' uses a row limiting operation (Skip/Take) without OrderBy which may lead to unpredictable results. +dbug: Microsoft.EntityFrameworkCore.Query[10104] + Optimized query model: + '(from TodoItem _2 in DbSet + select [_2]) + .Skip(__p_0) + .Take(__p_1)' +dbug: Microsoft.EntityFrameworkCore.Query[10107] + (QueryContext queryContext) => IAsyncEnumerable _InterceptExceptions( + source: IAsyncEnumerable _TrackEntities( + results: IAsyncEnumerable _ShapedQuery( + queryContext: queryContext, + shaperCommandContext: SelectExpression: + SELECT "t"."Id", "t"."AchievedDate", "t"."AssigneeId", "t"."CollectionId", "t"."CreatedDate", "t"."Description", "t"."GuidProperty", "t"."Ordinal", "t"."OwnerId" + FROM "TodoItems" AS "t" + LIMIT @__p_1 OFFSET @__p_0, + shaper: UnbufferedEntityShaper), + queryContext: queryContext, + entityTrackingInfos: { itemType: TodoItem }, + entityAccessors: List> + { + Func, + } + ), + contextType: JsonApiDotNetCoreExample.Data.AppDbContext, + logger: DiagnosticsLogger, + queryContext: queryContext) +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20000] + Opening connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20001] + Opened connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Command[20100] + Executing DbCommand [Parameters=[@__p_1='?', @__p_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "t"."Id", "t"."AchievedDate", "t"."AssigneeId", "t"."CollectionId", "t"."CreatedDate", "t"."Description", "t"."GuidProperty", "t"."Ordinal", "t"."OwnerId" + FROM "TodoItems" AS "t" + LIMIT @__p_1 OFFSET @__p_0 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@__p_1='?', @__p_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "t"."Id", "t"."AchievedDate", "t"."AssigneeId", "t"."CollectionId", "t"."CreatedDate", "t"."Description", "t"."GuidProperty", "t"."Ordinal", "t"."OwnerId" + FROM "TodoItems" AS "t" + LIMIT @__p_1 OFFSET @__p_0 +info: Microsoft.EntityFrameworkCore.Database.Command[20101] + Executed DbCommand (1ms) [Parameters=[@__p_1='?', @__p_0='?'], CommandType='Text', CommandTimeout='30'] + SELECT "t"."Id", "t"."AchievedDate", "t"."AssigneeId", "t"."CollectionId", "t"."CreatedDate", "t"."Description", "t"."GuidProperty", "t"."Ordinal", "t"."OwnerId" + FROM "TodoItems" AS "t" + LIMIT @__p_1 OFFSET @__p_0 +dbug: Microsoft.EntityFrameworkCore.Database.Command[20300] + A data reader was disposed. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20002] + Closing connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.EntityFrameworkCore.Database.Connection[20003] + Closed connection to database 'JsonApiDotNetCoreExample' on server 'tcp://localhost:5432'. +dbug: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action method JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample), returned result Microsoft.AspNetCore.Mvc.OkObjectResult. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[4] + No information found on request to perform content negotiation. +dbug: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[2] + Selected output formatter 'JsonApiDotNetCore.Formatters.JsonApiOutputFormatter' and content type '' to write the response. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: Microsoft.AspNetCore.Mvc.Internal.ObjectResultExecutor[1] + Executing ObjectResult, writing value Microsoft.AspNetCore.Mvc.ControllerContext. +info: JsonApiDotNetCore.Formatters.JsonApiWriter[0] + Formatting response as JSONAPI +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) in 38.909ms +info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] + Executed action JsonApiDotNetCoreExample.Controllers.TodoItemsController.GetAsync (JsonApiDotNetCoreExample) in 38.909ms +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 63.599ms 200 application/vnd.api+json +info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] + Request finished in 63.599ms 200 application/vnd.api+json +dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[5] + Hosting shutdown +[xUnit.net 00:00:22.5994190] Finished: JsonApiDotNetCoreExampleTests + +Total tests: 111. Passed: 110. Failed: 1. Skipped: 0. +Test execution time: 23.7537 Seconds diff --git a/test/JsonApiDotNetCoreExampleTests/xunit.runner.json b/test/JsonApiDotNetCoreExampleTests/xunit.runner.json new file mode 100644 index 0000000000..8f5f10571b --- /dev/null +++ b/test/JsonApiDotNetCoreExampleTests/xunit.runner.json @@ -0,0 +1,5 @@ +{ + "parallelizeAssembly": false, + "parallelizeTestCollections": false, + "maxParallelThreads": 1 +} diff --git a/test/NoEntityFrameworkTests/Acceptance/Extensibility/NoEntityFrameworkTests.cs b/test/NoEntityFrameworkTests/Acceptance/Extensibility/NoEntityFrameworkTests.cs index 41a48f2743..e80acc5d50 100644 --- a/test/NoEntityFrameworkTests/Acceptance/Extensibility/NoEntityFrameworkTests.cs +++ b/test/NoEntityFrameworkTests/Acceptance/Extensibility/NoEntityFrameworkTests.cs @@ -10,7 +10,6 @@ using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.TestHost; using Newtonsoft.Json; -using NoEntityFrameworkExample; using Xunit; namespace NoEntityFrameworkTests.Acceptance.Extensibility @@ -23,7 +22,7 @@ public class NoEntityFrameworkTests public NoEntityFrameworkTests() { var builder = new WebHostBuilder() - .UseStartup(); + .UseStartup(); _server = new TestServer(builder); _context = _server.GetService(); _context.Database.EnsureCreated(); @@ -97,7 +96,7 @@ public async Task Can_Create_TodoItems() type = "custom-todo-items", attributes = new { - description = description, + description, ordinal = 1 } } diff --git a/test/NoEntityFrameworkTests/NoEntityFrameworkTests.csproj b/test/NoEntityFrameworkTests/NoEntityFrameworkTests.csproj index 8daa7dc9af..c0500c3bbd 100644 --- a/test/NoEntityFrameworkTests/NoEntityFrameworkTests.csproj +++ b/test/NoEntityFrameworkTests/NoEntityFrameworkTests.csproj @@ -1,5 +1,4 @@  - $(NetCoreAppVersion) true @@ -18,10 +17,11 @@ + - + diff --git a/test/NoEntityFrameworkTests/TestStartup.cs b/test/NoEntityFrameworkTests/TestStartup.cs new file mode 100644 index 0000000000..e925e69fd0 --- /dev/null +++ b/test/NoEntityFrameworkTests/TestStartup.cs @@ -0,0 +1,22 @@ +using JsonApiDotNetCore.Services; +using Microsoft.AspNetCore.Hosting; +using Microsoft.Extensions.DependencyInjection; +using NoEntityFrameworkExample; +using System; +using UnitTests; + +namespace NoEntityFrameworkTests +{ + public class TestStartup : Startup + { + public TestStartup(IHostingEnvironment env) : base(env) + { } + + public override IServiceProvider ConfigureServices(IServiceCollection services) + { + base.ConfigureServices(services); + services.AddScoped(); + return services.BuildServiceProvider(); + } + } +} diff --git a/test/NoEntityFrameworkTests/appsettings.json b/test/NoEntityFrameworkTests/appsettings.json index 7067b2bee0..84f8cf4220 100644 --- a/test/NoEntityFrameworkTests/appsettings.json +++ b/test/NoEntityFrameworkTests/appsettings.json @@ -1,14 +1,15 @@ { - "Data": { - "DefaultConnection": - "Host=localhost;Port=5432;Database=JsonApiDotNetCoreExample;User ID=postgres;Password=" - }, - "Logging": { - "IncludeScopes": false, - "LogLevel": { - "Default": "Debug", - "System": "Information", - "Microsoft": "Information" + "Data": { + "DefaultConnection": + "Host=localhost;Port=5432;Database=JsonApiDotNetCoreExample;User ID=postgres;Password=postgres" + }, + "Logging": { + "IncludeScopes": false, + "LogLevel": { + "Default": "Warning", + "System": "Warning", + "Microsoft": "Warning", + "JsonApiDotNetCore.Middleware.JsonApiExceptionFilter": "Critical" + } } - } } diff --git a/test/OperationsExampleTests/.gitignore b/test/OperationsExampleTests/.gitignore new file mode 100644 index 0000000000..0ca27f04e1 --- /dev/null +++ b/test/OperationsExampleTests/.gitignore @@ -0,0 +1,234 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. + +# User-specific files +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +build/ +bld/ +[Bb]in/ +[Oo]bj/ + +# Visual Studio 2015 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUNIT +*.VisualState.xml +TestResult.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# DNX +project.lock.json +artifacts/ + +*_i.c +*_p.c +*_i.h +*.ilk +*.meta +*.obj +*.pch +*.pdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# JustCode is a .NET coding add-in +.JustCode + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# TODO: Comment the next line if you want to checkin your web deploy settings +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# NuGet Packages +*.nupkg +# The packages folder can be ignored because of Package Restore +**/packages/* +# except build/, which is used as an MSBuild target. +!**/packages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/packages/repositories.config + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Microsoft Azure ApplicationInsights config file +ApplicationInsights.config + +# Windows Store app package directory +AppPackages/ +BundleArtifacts/ + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.pfx +*.publishsettings +node_modules/ +orleans.codegen.cs + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm + +# SQL Server files +*.mdf +*.ldf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe + +# FAKE - F# Make +.fake/ diff --git a/test/OperationsExampleTests/Add/AddTests.cs b/test/OperationsExampleTests/Add/AddTests.cs new file mode 100644 index 0000000000..47aba439d6 --- /dev/null +++ b/test/OperationsExampleTests/Add/AddTests.cs @@ -0,0 +1,164 @@ +using System.Collections.Generic; +using System.Linq; +using System.Net; +using System.Threading.Tasks; +using Bogus; +using JsonApiDotNetCore.Models.Operations; +using JsonApiDotNetCoreExample.Data; +using Microsoft.EntityFrameworkCore; +using OperationsExampleTests.Factories; +using Xunit; + +namespace OperationsExampleTests +{ + public class AddTests : Fixture + { + private readonly Faker _faker = new Faker(); + + [Fact] + public async Task Can_Create_Author() + { + // arrange + var context = GetService(); + var author = AuthorFactory.Get(); + var content = new + { + operations = new[] { + new { + op = "add", + data = new { + type = "authors", + attributes = new { + name = author.Name + } + } + } + } + }; + + // act + var (response, data) = await PatchAsync("api/bulk", content); + + // assert + Assert.NotNull(response); + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + + var id = data.Operations.Single().DataObject.Id; + var lastAuthor = await context.Authors.SingleAsync(a => a.StringId == id); + Assert.Equal(author.Name, lastAuthor.Name); + } + + [Fact] + public async Task Can_Create_Authors() + { + // arrange + var expectedCount = _faker.Random.Int(1, 10); + var context = GetService(); + var authors = AuthorFactory.Get(expectedCount); + var content = new + { + operations = new List() + }; + + for (int i = 0; i < expectedCount; i++) + { + content.operations.Add( + new + { + op = "add", + data = new + { + type = "authors", + attributes = new + { + name = authors[i].Name + } + } + } + ); + } + + // act + var (response, data) = await PatchAsync("api/bulk", content); + + // assert + Assert.NotNull(response); + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + Assert.Equal(expectedCount, data.Operations.Count); + + for (int i = 0; i < expectedCount; i++) + { + var dataObject = data.Operations[i].DataObject; + var author = context.Authors.Single(a => a.StringId == dataObject.Id); + Assert.Equal(authors[i].Name, author.Name); + } + } + + [Fact] + public async Task Can_Create_Author_With_Article() + { + // arrange + var context = GetService(); + var author = AuthorFactory.Get(); + var article = ArticleFactory.Get(); + const string authorLocalId = "author-1"; + + var content = new + { + operations = new object[] { + new { + op = "add", + data = new { + lid = authorLocalId, + type = "authors", + attributes = new { + name = author.Name + }, + } + }, + new { + op = "add", + data = new { + type = "articles", + attributes = new { + name = article.Name + }, + relationships = new { + author = new { + data = new { + type = "authors", + lid = authorLocalId + } + } + } + } + } + } + }; + + // act + var (response, data) = await PatchAsync("api/bulk", content); + + // assert + Assert.NotNull(response); + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + Assert.Equal(2, data.Operations.Count); + + var authorOperationResult = data.Operations[0]; + var id = authorOperationResult.DataObject.Id; + var lastAuthor = await context.Authors + .Include(a => a.Articles) + .SingleAsync(a => a.StringId == id); + var articleOperationResult = data.Operations[1]; + + // author validation + Assert.Equal(authorLocalId, authorOperationResult.DataObject.LocalId); + Assert.Equal(author.Name, lastAuthor.Name); + + // article validation + Assert.Single(lastAuthor.Articles); + Assert.Equal(article.Name, lastAuthor.Articles[0].Name); + Assert.Equal(articleOperationResult.DataObject.Id, lastAuthor.Articles[0].StringId); + } + } +} diff --git a/test/OperationsExampleTests/Factories/ArticleFactory.cs b/test/OperationsExampleTests/Factories/ArticleFactory.cs new file mode 100644 index 0000000000..a03bc3fbea --- /dev/null +++ b/test/OperationsExampleTests/Factories/ArticleFactory.cs @@ -0,0 +1,25 @@ +using System.Collections.Generic; +using Bogus; +using JsonApiDotNetCoreExample.Models; + +namespace OperationsExampleTests.Factories +{ + public static class ArticleFactory + { + public static Article Get() + { + var faker = new Faker
(); + faker.RuleFor(m => m.Name, f => f.Lorem.Sentence()); + return faker.Generate(); + } + + public static List
Get(int count) + { + var articles = new List
(); + for (int i = 0; i < count; i++) + articles.Add(Get()); + + return articles; + } + } +} diff --git a/test/OperationsExampleTests/Factories/AuthorFactory.cs b/test/OperationsExampleTests/Factories/AuthorFactory.cs new file mode 100644 index 0000000000..e80b100a59 --- /dev/null +++ b/test/OperationsExampleTests/Factories/AuthorFactory.cs @@ -0,0 +1,25 @@ +using System.Collections.Generic; +using Bogus; +using JsonApiDotNetCoreExample.Models; + +namespace OperationsExampleTests.Factories +{ + public static class AuthorFactory + { + public static Author Get() + { + var faker = new Faker(); + faker.RuleFor(m => m.Name, f => f.Person.UserName); + return faker.Generate(); + } + + public static List Get(int count) + { + var authors = new List(); + for (int i = 0; i < count; i++) + authors.Add(Get()); + + return authors; + } + } +} diff --git a/test/OperationsExampleTests/Fixture.cs b/test/OperationsExampleTests/Fixture.cs new file mode 100644 index 0000000000..11621d36e4 --- /dev/null +++ b/test/OperationsExampleTests/Fixture.cs @@ -0,0 +1,60 @@ +using System; +using System.Net.Http; +using System.Net.Http.Headers; +using System.Threading.Tasks; +using JsonApiDotNetCoreExample.Data; +using Microsoft.AspNetCore.Hosting; +using Microsoft.AspNetCore.TestHost; +using Newtonsoft.Json; +using Xunit; + +[assembly: CollectionBehavior(DisableTestParallelization = true)] +namespace OperationsExampleTests +{ + public class Fixture : IDisposable + { + public Fixture() + { + var builder = new WebHostBuilder().UseStartup(); + Server = new TestServer(builder); + Client = Server.CreateClient(); + } + + public TestServer Server { get; private set; } + public HttpClient Client { get; } + + public void Dispose() + { + try + { + var context = GetService(); + context.Articles.RemoveRange(context.Articles); + context.Authors.RemoveRange(context.Authors); + context.SaveChanges(); + } // it is possible the test may try to do something that is an invalid db operation + // validation should be left up to the test, so we should not bomb the run in the + // disposal of that context + catch (Exception) { } + } + + public T GetService() => (T)Server.Host.Services.GetService(typeof(T)); + + public async Task PatchAsync(string route, object data) + { + var httpMethod = new HttpMethod("PATCH"); + var request = new HttpRequestMessage(httpMethod, route); + request.Content = new StringContent(JsonConvert.SerializeObject(data)); + request.Content.Headers.ContentLength = 1; + request.Content.Headers.ContentType = new MediaTypeHeaderValue("application/vnd.api+json"); + return await Client.SendAsync(request); + } + + public async Task<(HttpResponseMessage response, T data)> PatchAsync(string route, object data) + { + var response = await PatchAsync(route, data); + var json = await response.Content.ReadAsStringAsync(); + var obj = JsonConvert.DeserializeObject(json); + return (response, obj); + } + } +} diff --git a/test/OperationsExampleTests/Get/GetByIdTests.cs b/test/OperationsExampleTests/Get/GetByIdTests.cs new file mode 100644 index 0000000000..1056082895 --- /dev/null +++ b/test/OperationsExampleTests/Get/GetByIdTests.cs @@ -0,0 +1,78 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Net; +using System.Threading.Tasks; +using Bogus; +using JsonApiDotNetCore.Internal; +using JsonApiDotNetCore.Models.Operations; +using JsonApiDotNetCoreExample.Data; +using OperationsExampleTests.Factories; +using Xunit; + +namespace OperationsExampleTests +{ + public class GetTests : Fixture, IDisposable + { + private readonly Faker _faker = new Faker(); + + [Fact] + public async Task Can_Get_Author_By_Id() + { + // arrange + var context = GetService(); + var author = AuthorFactory.Get(); + context.Authors.Add(author); + context.SaveChanges(); + + var content = new + { + operations = new[] { + new Dictionary { + { "op", "get"}, + { "ref", new { type = "authors", id = author.StringId } } + } + } + }; + + // act + var (response, data) = await PatchAsync("api/bulk", content); + + // assert + Assert.NotNull(response); + Assert.NotNull(data); + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + Assert.Single(data.Operations); + Assert.Equal(author.Id.ToString(), data.Operations.Single().DataObject.Id); + } + + [Fact] + public async Task Get_Author_By_Id_Returns_404_If_NotFound() + { + // arrange + var authorId = _faker.Random.Int(max: 0).ToString(); + + var content = new + { + operations = new[] { + new Dictionary { + { "op", "get"}, + { "ref", new { type = "authors", id = authorId } } + } + } + }; + + // act + var (response, data) = await PatchAsync("api/bulk", content); + + // assert + Assert.NotNull(response); + Assert.Equal(HttpStatusCode.NotFound, response.StatusCode); + Assert.NotNull(data); + Assert.Single(data.Errors); + Assert.True(data.Errors[0].Detail.Contains("authors"), "The error detail should contain the name of the entity that could not be found."); + Assert.True(data.Errors[0].Detail.Contains(authorId), "The error detail should contain the entity id that could not be found"); + Assert.True(data.Errors[0].Title.Contains("operation[0]"), "The error title should contain the operation identifier that failed"); + } + } +} diff --git a/test/OperationsExampleTests/Get/GetRelationshipTests.cs b/test/OperationsExampleTests/Get/GetRelationshipTests.cs new file mode 100644 index 0000000000..8599e92a1e --- /dev/null +++ b/test/OperationsExampleTests/Get/GetRelationshipTests.cs @@ -0,0 +1,52 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Net; +using System.Threading.Tasks; +using Bogus; +using JsonApiDotNetCore.Models.Operations; +using JsonApiDotNetCoreExample.Data; +using OperationsExampleTests.Factories; +using Xunit; + +namespace OperationsExampleTests +{ + public class GetRelationshipTests : Fixture, IDisposable + { + private readonly Faker _faker = new Faker(); + + [Fact] + public async Task Can_Get_Article_Author() + { + // arrange + var context = GetService(); + var author = AuthorFactory.Get(); + var article = ArticleFactory.Get(); + article.Author = author; + context.Articles.Add(article); + context.SaveChanges(); + + var content = new + { + operations = new[] { + new Dictionary { + { "op", "get"}, + { "ref", new { type = "articles", id = article.StringId, relationship = nameof(article.Author) } } + } + } + }; + + // act + var (response, data) = await PatchAsync("api/bulk", content); + + // assert + Assert.NotNull(response); + Assert.NotNull(data); + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + Assert.Single(data.Operations); + var resourceObject = data.Operations.Single().DataObject; + Assert.Equal(author.Id.ToString(), resourceObject.Id); + Assert.Equal("authors", resourceObject.Type); + } + } +} diff --git a/test/OperationsExampleTests/Get/GetTests.cs b/test/OperationsExampleTests/Get/GetTests.cs new file mode 100644 index 0000000000..78e7eeb976 --- /dev/null +++ b/test/OperationsExampleTests/Get/GetTests.cs @@ -0,0 +1,51 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Net; +using System.Threading.Tasks; +using Bogus; +using JsonApiDotNetCore.Models.Operations; +using JsonApiDotNetCoreExample.Data; +using OperationsExampleTests.Factories; +using Xunit; + +namespace OperationsExampleTests +{ + public class GetByIdTests : Fixture, IDisposable + { + private readonly Faker _faker = new Faker(); + + [Fact] + public async Task Can_Get_Authors() + { + // arrange + var expectedCount = _faker.Random.Int(1, 10); + var context = GetService(); + context.Articles.RemoveRange(context.Articles); + context.Authors.RemoveRange(context.Authors); + var authors = AuthorFactory.Get(expectedCount); + context.AddRange(authors); + context.SaveChanges(); + + var content = new + { + operations = new[] { + new Dictionary { + { "op", "get"}, + { "ref", new { type = "authors" } } + } + } + }; + + // act + var result = await PatchAsync("api/bulk", content); + + // assert + Assert.NotNull(result.response); + Assert.NotNull(result.data); + Assert.Equal(HttpStatusCode.OK, result.response.StatusCode); + Assert.Single(result.data.Operations); + Assert.Equal(expectedCount, result.data.Operations.Single().DataList.Count); + } + } +} diff --git a/test/OperationsExampleTests/OperationsExampleTests.csproj b/test/OperationsExampleTests/OperationsExampleTests.csproj new file mode 100644 index 0000000000..c2c70d6e54 --- /dev/null +++ b/test/OperationsExampleTests/OperationsExampleTests.csproj @@ -0,0 +1,24 @@ + + + $(NetCoreAppVersion) + false + OperationsExampleTests + + + + + + + + + + + + + + + + PreserveNewest + + + diff --git a/test/OperationsExampleTests/Remove/RemoveTests.cs b/test/OperationsExampleTests/Remove/RemoveTests.cs new file mode 100644 index 0000000000..b5e0cffaf3 --- /dev/null +++ b/test/OperationsExampleTests/Remove/RemoveTests.cs @@ -0,0 +1,85 @@ +using System.Collections.Generic; +using System.Linq; +using System.Net; +using System.Threading.Tasks; +using Bogus; +using JsonApiDotNetCore.Models.Operations; +using JsonApiDotNetCoreExample.Data; +using OperationsExampleTests.Factories; +using Xunit; + +namespace OperationsExampleTests +{ + public class RemoveTests : Fixture + { + private readonly Faker _faker = new Faker(); + + [Fact] + public async Task Can_Remove_Author() + { + // arrange + var context = GetService(); + var author = AuthorFactory.Get(); + context.Authors.Add(author); + context.SaveChanges(); + + var content = new + { + operations = new[] { + new Dictionary { + { "op", "remove"}, + { "ref", new { type = "authors", id = author.StringId } } + } + } + }; + + // act + var (response, data) = await PatchAsync("api/bulk", content); + + // assert + Assert.NotNull(response); + Assert.NotNull(data); + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + Assert.Empty(data.Operations); + Assert.Null(context.Authors.SingleOrDefault(a => a.Id == author.Id)); + } + + [Fact] + public async Task Can_Remove_Authors() + { + // arrange + var count = _faker.Random.Int(1, 10); + var context = GetService(); + + var authors = AuthorFactory.Get(count); + + context.Authors.AddRange(authors); + context.SaveChanges(); + + var content = new + { + operations = new List() + }; + + for (int i = 0; i < count; i++) + content.operations.Add( + new Dictionary { + { "op", "remove"}, + { "ref", new { type = "authors", id = authors[i].StringId } } + } + ); + + // act + var (response, data) = await PatchAsync("api/bulk", content); + + // assert + Assert.NotNull(response); + Assert.NotNull(data); + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + Assert.Empty(data.Operations); + + for (int i = 0; i < count; i++) + Assert.Null(context.Authors.SingleOrDefault(a => a.Id == authors[i].Id)); + } + } +} diff --git a/test/OperationsExampleTests/TestStartup.cs b/test/OperationsExampleTests/TestStartup.cs new file mode 100644 index 0000000000..449c193177 --- /dev/null +++ b/test/OperationsExampleTests/TestStartup.cs @@ -0,0 +1,25 @@ +using JsonApiDotNetCore.Data; +using JsonApiDotNetCore.Services; +using JsonApiDotNetCoreExample.Data; +using Microsoft.AspNetCore.Hosting; +using Microsoft.Extensions.DependencyInjection; +using OperationsExample; +using System; +using UnitTests; + +namespace OperationsExampleTests +{ + public class TestStartup : Startup + { + public TestStartup(IHostingEnvironment env) : base(env) + { } + + public override IServiceProvider ConfigureServices(IServiceCollection services) + { + base.ConfigureServices(services); + services.AddScoped(); + services.AddSingleton>(); + return services.BuildServiceProvider(); + } + } +} diff --git a/test/OperationsExampleTests/Transactions/TransactionFailureTests.cs b/test/OperationsExampleTests/Transactions/TransactionFailureTests.cs new file mode 100644 index 0000000000..191711651d --- /dev/null +++ b/test/OperationsExampleTests/Transactions/TransactionFailureTests.cs @@ -0,0 +1,80 @@ +using System; +using System.Linq; +using System.Net; +using System.Threading.Tasks; +using Bogus; +using JsonApiDotNetCore.Internal; +using JsonApiDotNetCoreExample.Data; +using Microsoft.EntityFrameworkCore; +using OperationsExampleTests.Factories; +using Xunit; + +namespace OperationsExampleTests +{ + public class TransactionFailureTests : Fixture + { + private readonly Faker _faker = new Faker(); + + [Fact] + public async Task Cannot_Create_Author_If_Article_Creation_Fails() + { + // arrange + var context = GetService(); + var author = AuthorFactory.Get(); + var article = ArticleFactory.Get(); + + // do this so that the name is random enough for db validations + author.Name = Guid.NewGuid().ToString("N"); + article.Name = Guid.NewGuid().ToString("N"); + + var content = new + { + operations = new object[] { + new { + op = "add", + data = new { + type = "authors", + attributes = new { + name = author.Name + }, + } + }, + new { + op = "add", + data = new { + type = "articles", + attributes = new { + name = article.Name + }, + // by not including the author, the article creation will fail + // relationships = new { + // author = new { + // data = new { + // type = "authors", + // lid = authorLocalId + // } + // } + // } + } + } + } + }; + + // act + var (response, data) = await PatchAsync("api/bulk", content); + + // assert + Assert.NotNull(response); + // for now, it is up to application implementations to perform validation and + // provide the proper HTTP response code + Assert.Equal(HttpStatusCode.InternalServerError, response.StatusCode); + Assert.Single(data.Errors); + Assert.Contains("operation[1] (add)", data.Errors[0].Title); + + var dbAuthors = await context.Authors.Where(a => a.Name == author.Name).ToListAsync(); + var dbArticles = await context.Articles.Where(a => a.Name == article.Name).ToListAsync(); + Assert.Empty(dbAuthors); + Assert.Empty(dbArticles); + } + } +} diff --git a/test/OperationsExampleTests/Update/UpdateTests.cs b/test/OperationsExampleTests/Update/UpdateTests.cs new file mode 100644 index 0000000000..c5d220b2f5 --- /dev/null +++ b/test/OperationsExampleTests/Update/UpdateTests.cs @@ -0,0 +1,112 @@ +using Bogus; +using JsonApiDotNetCore.Models.Operations; +using JsonApiDotNetCoreExample.Data; +using OperationsExampleTests.Factories; +using System.Collections.Generic; +using System.Linq; +using System.Net; +using System.Threading.Tasks; +using Xunit; + +namespace OperationsExampleTests.Update +{ + public class UpdateTests : Fixture + { + private readonly Faker _faker = new Faker(); + + [Fact] + public async Task Can_Update_Author() + { + // arrange + var context = GetService(); + var author = AuthorFactory.Get(); + var updates = AuthorFactory.Get(); + context.Authors.Add(author); + context.SaveChanges(); + + var content = new + { + operations = new[] { + new Dictionary { + { "op", "update" }, + { "ref", new { + type = "authors", + id = author.Id, + } }, + { "data", new { + type = "authors", + id = author.Id, + attributes = new + { + name = updates.Name + } + } }, + } + } + }; + + // act + var (response, data) = await PatchAsync("api/bulk", content); + + // assert + Assert.NotNull(response); + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + Assert.NotNull(data); + Assert.Single(data.Operations); + + var attrs = data.Operations.Single().DataObject.Attributes; + Assert.Equal(updates.Name, attrs["name"]); + } + + [Fact] + public async Task Can_Update_Authors() + { + // arrange + var count = _faker.Random.Int(1, 10); + var context = GetService(); + + var authors = AuthorFactory.Get(count); + var updates = AuthorFactory.Get(count); + + context.Authors.AddRange(authors); + context.SaveChanges(); + + var content = new + { + operations = new List() + }; + + for (int i = 0; i < count; i++) + content.operations.Add(new Dictionary { + { "op", "update" }, + { "ref", new { + type = "authors", + id = authors[i].Id, + } }, + { "data", new { + type = "authors", + id = authors[i].Id, + attributes = new + { + name = updates[i].Name + } + } }, + }); + + // act + var (response, data) = await PatchAsync("api/bulk", content); + + // assert + Assert.NotNull(response); + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + Assert.NotNull(data); + Assert.Equal(count, data.Operations.Count); + + for (int i = 0; i < count; i++) + { + var attrs = data.Operations[i].DataObject.Attributes; + Assert.Equal(updates[i].Name, attrs["name"]); + } + } + } +} diff --git a/test/OperationsExampleTests/appsettings.json b/test/OperationsExampleTests/appsettings.json new file mode 100644 index 0000000000..84f8cf4220 --- /dev/null +++ b/test/OperationsExampleTests/appsettings.json @@ -0,0 +1,15 @@ +{ + "Data": { + "DefaultConnection": + "Host=localhost;Port=5432;Database=JsonApiDotNetCoreExample;User ID=postgres;Password=postgres" + }, + "Logging": { + "IncludeScopes": false, + "LogLevel": { + "Default": "Warning", + "System": "Warning", + "Microsoft": "Warning", + "JsonApiDotNetCore.Middleware.JsonApiExceptionFilter": "Critical" + } + } +} diff --git a/test/UnitTests/Builders/ContextGraphBuilder_Tests.cs b/test/UnitTests/Builders/ContextGraphBuilder_Tests.cs index 8bcef5e4dd..d5207fb6ef 100644 --- a/test/UnitTests/Builders/ContextGraphBuilder_Tests.cs +++ b/test/UnitTests/Builders/ContextGraphBuilder_Tests.cs @@ -1,10 +1,8 @@ -using System; using JsonApiDotNetCore.Extensions; using JsonApiDotNetCore.Internal; using JsonApiDotNetCore.Models; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.DependencyInjection; -using Moq; using Xunit; namespace UnitTests @@ -33,10 +31,11 @@ public void Can_Build_ContextGraph_Using_Builder() // assert var contextGraph = container.GetRequiredService(); - var dbResource = contextGraph.GetContextEntity("db-resources").EntityType; - var nonDbResource = contextGraph.GetContextEntity("non-db-resources").EntityType; - Assert.Equal(typeof(DbResource), dbResource); - Assert.Equal(typeof(NonDbResource), nonDbResource); + var dbResource = contextGraph.GetContextEntity("db-resources"); + var nonDbResource = contextGraph.GetContextEntity("non-db-resources"); + Assert.Equal(typeof(DbResource), dbResource.EntityType); + Assert.Equal(typeof(NonDbResource), nonDbResource.EntityType); + Assert.Equal(typeof(ResourceDefinition), nonDbResource.ResourceType); } } } diff --git a/test/UnitTests/Builders/DocumentBuilderBehaviour_Tests.cs b/test/UnitTests/Builders/DocumentBuilderBehaviour_Tests.cs new file mode 100644 index 0000000000..3c5e2e5147 --- /dev/null +++ b/test/UnitTests/Builders/DocumentBuilderBehaviour_Tests.cs @@ -0,0 +1,70 @@ +using JsonApiDotNetCore.Builders; +using JsonApiDotNetCore.Configuration; +using JsonApiDotNetCore.Services; +using Microsoft.AspNetCore.Http; +using Moq; +using Xunit; + +namespace UnitTests.Builders +{ + public class DocumentBuilderBehaviour_Tests + { + + [Theory] + [InlineData(null, null, null, false)] + [InlineData(false, null, null, false)] + [InlineData(true, null, null, true)] + [InlineData(false, false, "true", false)] + [InlineData(false, true, "true", true)] + [InlineData(true, true, "false", false)] + [InlineData(true, false, "false", true)] + [InlineData(null, false, "false", false)] + [InlineData(null, false, "true", false)] + [InlineData(null, true, "true", true)] + [InlineData(null, true, "false", false)] + [InlineData(null, true, "foo", false)] + [InlineData(null, false, "foo", false)] + [InlineData(true, true, "foo", true)] + [InlineData(true, false, "foo", true)] + [InlineData(null, true, null, false)] + [InlineData(null, false, null, false)] + public void CheckNullBehaviorCombination(bool? omitNullValuedAttributes, bool? allowClientOverride, string clientOverride, bool omitsNulls) + { + + NullAttributeResponseBehavior nullAttributeResponseBehavior; + if (omitNullValuedAttributes.HasValue && allowClientOverride.HasValue) + { + nullAttributeResponseBehavior = new NullAttributeResponseBehavior(omitNullValuedAttributes.Value, allowClientOverride.Value); + }else if (omitNullValuedAttributes.HasValue) + { + nullAttributeResponseBehavior = new NullAttributeResponseBehavior(omitNullValuedAttributes.Value); + }else if + (allowClientOverride.HasValue) + { + nullAttributeResponseBehavior = new NullAttributeResponseBehavior(allowClientOverride: allowClientOverride.Value); + } + else + { + nullAttributeResponseBehavior = new NullAttributeResponseBehavior(); + } + + var jsonApiContextMock = new Mock(); + jsonApiContextMock.SetupGet(m => m.Options) + .Returns(new JsonApiOptions() {NullAttributeResponseBehavior = nullAttributeResponseBehavior}); + + var httpContext = new DefaultHttpContext(); + if (clientOverride != null) + { + httpContext.Request.QueryString = new QueryString($"?omitNullValuedAttributes={clientOverride}"); + } + var httpContextAccessorMock = new Mock(); + httpContextAccessorMock.SetupGet(m => m.HttpContext).Returns(httpContext); + + var sut = new DocumentBuilderOptionsProvider(jsonApiContextMock.Object, httpContextAccessorMock.Object); + var documentBuilderOptions = sut.GetDocumentBuilderOptions(); + + Assert.Equal(omitsNulls, documentBuilderOptions.OmitNullValuedAttributes); + } + + } +} diff --git a/test/UnitTests/Builders/DocumentBuilder_Tests.cs b/test/UnitTests/Builders/DocumentBuilder_Tests.cs index cd1227ef52..868ef698ee 100644 --- a/test/UnitTests/Builders/DocumentBuilder_Tests.cs +++ b/test/UnitTests/Builders/DocumentBuilder_Tests.cs @@ -1,134 +1,375 @@ -using System; -using System.Collections.Generic; -using JsonApiDotNetCore.Builders; -using JsonApiDotNetCore.Configuration; -using JsonApiDotNetCore.Internal; -using JsonApiDotNetCore.Models; -using JsonApiDotNetCore.Services; -using Moq; -using Xunit; - -namespace UnitTests -{ - public class DocumentBuilder_Tests - { - private readonly Mock _jsonApiContextMock; - private readonly PageManager _pageManager; - private readonly JsonApiOptions _options; - - public DocumentBuilder_Tests() - { - _jsonApiContextMock = new Mock(); - - _options = new JsonApiOptions(); - - _options.BuildContextGraph(builder => - { - builder.AddResource("models"); - }); - - _jsonApiContextMock - .Setup(m => m.Options) - .Returns(_options); - - _jsonApiContextMock - .Setup(m => m.ContextGraph) - .Returns(_options.ContextGraph); - - _jsonApiContextMock - .Setup(m => m.MetaBuilder) - .Returns(new MetaBuilder()); - - _pageManager = new PageManager(); - _jsonApiContextMock - .Setup(m => m.PageManager) - .Returns(_pageManager); - - _jsonApiContextMock - .Setup(m => m.BasePath) - .Returns("localhost"); - - _jsonApiContextMock - .Setup(m => m.RequestEntity) - .Returns(_options.ContextGraph.GetContextEntity(typeof(Model))); - } - - [Fact] - public void Includes_Paging_Links_By_Default() - { - // arrange - _pageManager.PageSize = 1; - _pageManager.TotalRecords = 1; - _pageManager.CurrentPage = 1; - - var documentBuilder = new DocumentBuilder(_jsonApiContextMock.Object); - var entity = new Model(); - - // act - var document = documentBuilder.Build(entity); - - // assert - Assert.NotNull(document.Links); - Assert.NotNull(document.Links.Last); - } - - [Fact] - public void Page_Links_Can_Be_Disabled_Globally() - { - // arrange - _pageManager.PageSize = 1; - _pageManager.TotalRecords = 1; - _pageManager.CurrentPage = 1; - - _options.BuildContextGraph(builder => builder.DocumentLinks = Link.None); - - _jsonApiContextMock - .Setup(m => m.ContextGraph) - .Returns(_options.ContextGraph); - - var documentBuilder = new DocumentBuilder(_jsonApiContextMock.Object); - var entity = new Model(); - - // act - var document = documentBuilder.Build(entity); - - // assert - Assert.Null(document.Links); - } - - [Fact] - public void Related_Links_Can_Be_Disabled() - { - // arrange - _pageManager.PageSize = 1; - _pageManager.TotalRecords = 1; - _pageManager.CurrentPage = 1; - - _jsonApiContextMock - .Setup(m => m.ContextGraph) - .Returns(_options.ContextGraph); - - var documentBuilder = new DocumentBuilder(_jsonApiContextMock.Object); - var entity = new Model(); - - // act - var document = documentBuilder.Build(entity); - - // assert - Assert.Null(document.Data.Relationships["related-model"].Links); - } - - private class Model : Identifiable - { - [HasOne("related-model", Link.None)] - public RelatedModel RelatedModel { get; set; } - public int RelatedModelId { get; set; } - } - - private class RelatedModel : Identifiable - { - [HasMany("models")] - public List Models { get; set; } - } - } -} +using System.Collections; +using System.Collections.Generic; +using JsonApiDotNetCore.Builders; +using JsonApiDotNetCore.Configuration; +using JsonApiDotNetCore.Internal; +using JsonApiDotNetCore.Models; +using JsonApiDotNetCore.Services; +using Microsoft.Extensions.DependencyInjection; +using Moq; +using Xunit; + +namespace UnitTests +{ + public class DocumentBuilder_Tests + { + private readonly Mock _jsonApiContextMock; + private readonly PageManager _pageManager; + private readonly JsonApiOptions _options; + private readonly Mock _requestMetaMock; + + public DocumentBuilder_Tests() + { + _jsonApiContextMock = new Mock(); + _requestMetaMock = new Mock(); + + _options = new JsonApiOptions(); + + _options.BuildContextGraph(builder => + { + builder.AddResource("models"); + builder.AddResource("related-models"); + }); + + _jsonApiContextMock + .Setup(m => m.Options) + .Returns(_options); + + _jsonApiContextMock + .Setup(m => m.ContextGraph) + .Returns(_options.ContextGraph); + + _jsonApiContextMock + .Setup(m => m.MetaBuilder) + .Returns(new MetaBuilder()); + + _pageManager = new PageManager(); + _jsonApiContextMock + .Setup(m => m.PageManager) + .Returns(_pageManager); + + _jsonApiContextMock + .Setup(m => m.BasePath) + .Returns("localhost"); + + _jsonApiContextMock + .Setup(m => m.RequestEntity) + .Returns(_options.ContextGraph.GetContextEntity(typeof(Model))); + } + + [Fact] + public void Includes_Paging_Links_By_Default() + { + // arrange + _pageManager.PageSize = 1; + _pageManager.TotalRecords = 1; + _pageManager.CurrentPage = 1; + + var documentBuilder = new DocumentBuilder(_jsonApiContextMock.Object); + var entity = new Model(); + + // act + var document = documentBuilder.Build(entity); + + // assert + Assert.NotNull(document.Links); + Assert.NotNull(document.Links.Last); + } + + [Fact] + public void Page_Links_Can_Be_Disabled_Globally() + { + // arrange + _pageManager.PageSize = 1; + _pageManager.TotalRecords = 1; + _pageManager.CurrentPage = 1; + + _options.BuildContextGraph(builder => builder.DocumentLinks = Link.None); + + _jsonApiContextMock + .Setup(m => m.ContextGraph) + .Returns(_options.ContextGraph); + + var documentBuilder = new DocumentBuilder(_jsonApiContextMock.Object); + var entity = new Model(); + + // act + var document = documentBuilder.Build(entity); + + // assert + Assert.Null(document.Links); + } + + [Fact] + public void Related_Links_Can_Be_Disabled() + { + // arrange + _pageManager.PageSize = 1; + _pageManager.TotalRecords = 1; + _pageManager.CurrentPage = 1; + + _jsonApiContextMock + .Setup(m => m.ContextGraph) + .Returns(_options.ContextGraph); + + var documentBuilder = new DocumentBuilder(_jsonApiContextMock.Object); + var entity = new Model(); + + // act + var document = documentBuilder.Build(entity); + + // assert + Assert.Null(document.Data.Relationships["related-model"].Links); + } + + [Fact] + public void Related_Data_Included_In_Relationships_By_Default() + { + // arrange + const string relatedTypeName = "related-models"; + const string relationshipName = "related-model"; + const int relatedId = 1; + _jsonApiContextMock + .Setup(m => m.ContextGraph) + .Returns(_options.ContextGraph); + + var documentBuilder = new DocumentBuilder(_jsonApiContextMock.Object); + var entity = new Model + { + RelatedModel = new RelatedModel + { + Id = relatedId + } + }; + + // act + var document = documentBuilder.Build(entity); + + // assert + var relationshipData = document.Data.Relationships[relationshipName]; + Assert.NotNull(relationshipData); + Assert.NotNull(relationshipData.SingleData); + Assert.NotNull(relationshipData.SingleData); + Assert.Equal(relatedId.ToString(), relationshipData.SingleData.Id); + Assert.Equal(relatedTypeName, relationshipData.SingleData.Type); + } + + [Fact] + public void IndependentIdentifier_Included_In_HasOne_Relationships_By_Default() + { + // arrange + const string relatedTypeName = "related-models"; + const string relationshipName = "related-model"; + const int relatedId = 1; + _jsonApiContextMock + .Setup(m => m.ContextGraph) + .Returns(_options.ContextGraph); + + var documentBuilder = new DocumentBuilder(_jsonApiContextMock.Object); + var entity = new Model + { + RelatedModelId = relatedId + }; + + // act + var document = documentBuilder.Build(entity); + + // assert + var relationshipData = document.Data.Relationships[relationshipName]; + Assert.NotNull(relationshipData); + Assert.NotNull(relationshipData.SingleData); + Assert.NotNull(relationshipData.SingleData); + Assert.Equal(relatedId.ToString(), relationshipData.SingleData.Id); + Assert.Equal(relatedTypeName, relationshipData.SingleData.Type); + } + + [Fact] + public void Build_Can_Build_Arrays() + { + var entities = new[] { new Model() }; + var documentBuilder = new DocumentBuilder(_jsonApiContextMock.Object); + + var documents = documentBuilder.Build(entities); + + Assert.Single(documents.Data); + } + + [Fact] + public void Build_Can_Build_CustomIEnumerables() + { + var entities = new Models(new[] { new Model() }); + var documentBuilder = new DocumentBuilder(_jsonApiContextMock.Object); + + var documents = documentBuilder.Build(entities); + + Assert.Single(documents.Data); + } + + [Theory] + [InlineData(null, null, true)] + [InlineData(false, null, true)] + [InlineData(true, null, false)] + [InlineData(null, "foo", true)] + [InlineData(false, "foo", true)] + [InlineData(true, "foo", true)] + public void DocumentBuilderOptions( + bool? omitNullValuedAttributes, + string attributeValue, + bool resultContainsAttribute) + { + var documentBuilderBehaviourMock = new Mock(); + if (omitNullValuedAttributes.HasValue) + { + documentBuilderBehaviourMock.Setup(m => m.GetDocumentBuilderOptions()) + .Returns(new DocumentBuilderOptions(omitNullValuedAttributes.Value)); + } + var documentBuilder = new DocumentBuilder(_jsonApiContextMock.Object, null, omitNullValuedAttributes.HasValue ? documentBuilderBehaviourMock.Object : null); + var document = documentBuilder.Build(new Model() { StringProperty = attributeValue }); + + Assert.Equal(resultContainsAttribute, document.Data.Attributes.ContainsKey("StringProperty")); + } + + private class Model : Identifiable + { + [Attr("StringProperty")] public string StringProperty { get; set; } + + [HasOne("related-model", Link.None)] + public RelatedModel RelatedModel { get; set; } + public int RelatedModelId { get; set; } + } + + private class RelatedModel : Identifiable + { + [HasMany("models")] + public List Models { get; set; } + } + + private class Models : IEnumerable + { + private readonly IEnumerable models; + + public Models(IEnumerable models) + { + this.models = models; + } + + public IEnumerator GetEnumerator() + { + return models.GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return models.GetEnumerator(); + } + } + + [Fact] + public void Build_Will_Use_Resource_If_Defined_For_Multiple_Documents() + { + var entities = new[] { new User() }; + var contextGraph = new ContextGraphBuilder() + .AddResource("user") + .Build(); + _jsonApiContextMock.Setup(m => m.ContextGraph).Returns(contextGraph); + + var scopedServiceProvider = new TestScopedServiceProvider( + new ServiceCollection() + .AddScoped, UserResource>() + .BuildServiceProvider()); + + var documentBuilder = new DocumentBuilder(_jsonApiContextMock.Object, scopedServiceProvider: scopedServiceProvider); + + var documents = documentBuilder.Build(entities); + + Assert.Single(documents.Data); + Assert.False(documents.Data[0].Attributes.ContainsKey("password")); + Assert.True(documents.Data[0].Attributes.ContainsKey("username")); + } + + [Fact] + public void Build_Will_Use_Resource_If_Defined_For_Single_Document() + { + var entity = new User(); + var contextGraph = new ContextGraphBuilder() + .AddResource("user") + .Build(); + _jsonApiContextMock.Setup(m => m.ContextGraph).Returns(contextGraph); + + var scopedServiceProvider = new TestScopedServiceProvider( + new ServiceCollection() + .AddScoped, UserResource>() + .BuildServiceProvider()); + + var documentBuilder = new DocumentBuilder(_jsonApiContextMock.Object, scopedServiceProvider: scopedServiceProvider); + + var documents = documentBuilder.Build(entity); + + Assert.False(documents.Data.Attributes.ContainsKey("password")); + Assert.True(documents.Data.Attributes.ContainsKey("username")); + } + + [Fact] + public void Build_Will_Use_Instance_Specific_Resource_If_Defined_For_Multiple_Documents() + { + var entities = new[] { new User() }; + var contextGraph = new ContextGraphBuilder() + .AddResource("user") + .Build(); + _jsonApiContextMock.Setup(m => m.ContextGraph).Returns(contextGraph); + + var scopedServiceProvider = new TestScopedServiceProvider( + new ServiceCollection() + .AddScoped, InstanceSpecificUserResource>() + .BuildServiceProvider()); + + var documentBuilder = new DocumentBuilder(_jsonApiContextMock.Object, scopedServiceProvider: scopedServiceProvider); + + var documents = documentBuilder.Build(entities); + + Assert.Single(documents.Data); + Assert.False(documents.Data[0].Attributes.ContainsKey("password")); + Assert.True(documents.Data[0].Attributes.ContainsKey("username")); + } + + [Fact] + public void Build_Will_Use_Instance_Specific_Resource_If_Defined_For_Single_Document() + { + var entity = new User(); + var contextGraph = new ContextGraphBuilder() + .AddResource("user") + .Build(); + _jsonApiContextMock.Setup(m => m.ContextGraph).Returns(contextGraph); + + var scopedServiceProvider = new TestScopedServiceProvider( + new ServiceCollection() + .AddScoped, InstanceSpecificUserResource>() + .BuildServiceProvider()); + + var documentBuilder = new DocumentBuilder(_jsonApiContextMock.Object, scopedServiceProvider: scopedServiceProvider); + + var documents = documentBuilder.Build(entity); + + Assert.False(documents.Data.Attributes.ContainsKey("password")); + Assert.True(documents.Data.Attributes.ContainsKey("username")); + } + + public class User : Identifiable + { + [Attr("username")] public string Username { get; set; } + [Attr("password")] public string Password { get; set; } + } + + public class InstanceSpecificUserResource : ResourceDefinition + { + protected override List OutputAttrs(User instance) + => Remove(user => user.Password); + } + + public class UserResource : ResourceDefinition + { + protected override List OutputAttrs() + => Remove(user => user.Password); + } + } +} diff --git a/test/UnitTests/Builders/LinkBuilder_Tests.cs b/test/UnitTests/Builders/LinkBuilder_Tests.cs new file mode 100644 index 0000000000..69b135de03 --- /dev/null +++ b/test/UnitTests/Builders/LinkBuilder_Tests.cs @@ -0,0 +1,48 @@ +using JsonApiDotNetCore.Builders; +using JsonApiDotNetCore.Configuration; +using JsonApiDotNetCore.Services; +using Microsoft.AspNetCore.Http; +using Moq; +using Xunit; + +namespace UnitTests +{ + public class LinkBuilder_Tests + { + [Theory] + [InlineData("http", "localhost", "/api/v1/articles", false, "http://localhost/api/v1")] + [InlineData("https", "localhost", "/api/v1/articles", false, "https://localhost/api/v1")] + [InlineData("http", "example.com", "/api/v1/articles", false, "http://example.com/api/v1")] + [InlineData("https", "example.com", "/api/v1/articles", false, "https://example.com/api/v1")] + [InlineData("https", "example.com", "/articles", false, "https://example.com")] + [InlineData("https", "example.com", "/articles", true, "")] + [InlineData("https", "example.com", "/api/v1/articles", true, "/api/v1")] + public void GetBasePath_Returns_Path_Before_Resource(string scheme, + string host, string path, bool isRelative, string expectedPath) + { + // arrange + const string resource = "articles"; + var jsonApiContextMock = new Mock(); + jsonApiContextMock.Setup(m => m.Options).Returns(new JsonApiOptions + { + RelativeLinks = isRelative + }); + + var requestMock = new Mock(); + requestMock.Setup(m => m.Scheme).Returns(scheme); + requestMock.Setup(m => m.Host).Returns(new HostString(host)); + requestMock.Setup(m => m.Path).Returns(new PathString(path)); + + var contextMock = new Mock(); + contextMock.Setup(m => m.Request).Returns(requestMock.Object); + + var linkBuilder = new LinkBuilder(jsonApiContextMock.Object); + + // act + var basePath = linkBuilder.GetBasePath(contextMock.Object, resource); + + // assert + Assert.Equal(expectedPath, basePath); + } + } +} diff --git a/test/JsonApiDotNetCoreExampleTests/Unit/Builders/MetaBuilderTests.cs b/test/UnitTests/Builders/MetaBuilderTests.cs similarity index 97% rename from test/JsonApiDotNetCoreExampleTests/Unit/Builders/MetaBuilderTests.cs rename to test/UnitTests/Builders/MetaBuilderTests.cs index 5cd0b765de..0b784ef5b7 100644 --- a/test/JsonApiDotNetCoreExampleTests/Unit/Builders/MetaBuilderTests.cs +++ b/test/UnitTests/Builders/MetaBuilderTests.cs @@ -1,8 +1,8 @@ -using Xunit; -using JsonApiDotNetCore.Builders; using System.Collections.Generic; +using JsonApiDotNetCore.Builders; +using Xunit; -namespace JsonApiDotNetCoreExampleTests.Unit.Builders +namespace UnitTests.Builders { public class MetaBuilderTests { diff --git a/test/UnitTests/Controllers/BaseJsonApiController_Tests.cs b/test/UnitTests/Controllers/BaseJsonApiController_Tests.cs index 9c59372846..873b3f50d2 100644 --- a/test/UnitTests/Controllers/BaseJsonApiController_Tests.cs +++ b/test/UnitTests/Controllers/BaseJsonApiController_Tests.cs @@ -1,11 +1,13 @@ -using System; using JsonApiDotNetCore.Controllers; using JsonApiDotNetCore.Models; using JsonApiDotNetCore.Services; using Moq; using Xunit; using System.Threading.Tasks; +using JsonApiDotNetCore.Configuration; using JsonApiDotNetCore.Internal; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; namespace UnitTests { @@ -143,6 +145,8 @@ public async Task PatchAsync_Calls_Service() const int id = 0; var resource = new Resource(); var serviceMock = new Mock>(); + _jsonApiContextMock.Setup(a => a.ApplyContext(It.IsAny>())).Returns(_jsonApiContextMock.Object); + _jsonApiContextMock.SetupGet(a => a.Options).Returns(new JsonApiOptions()); var controller = new BaseJsonApiController(_jsonApiContextMock.Object, update: serviceMock.Object); // act @@ -153,6 +157,47 @@ public async Task PatchAsync_Calls_Service() VerifyApplyContext(); } + [Fact] + public async Task PatchAsync_ModelStateInvalid_ValidateModelStateDisbled() + { + // arrange + const int id = 0; + var resource = new Resource(); + var serviceMock = new Mock>(); + _jsonApiContextMock.Setup(a => a.ApplyContext(It.IsAny>())).Returns(_jsonApiContextMock.Object); + _jsonApiContextMock.SetupGet(a => a.Options).Returns(new JsonApiOptions { ValidateModelState = false }); + var controller = new BaseJsonApiController(_jsonApiContextMock.Object, update: serviceMock.Object); + + // act + var response = await controller.PatchAsync(id, resource); + + // assert + serviceMock.Verify(m => m.UpdateAsync(id, It.IsAny()), Times.Once); + VerifyApplyContext(); + Assert.IsNotType(response); + } + + [Fact] + public async Task PatchAsync_ModelStateInvalid_ValidateModelStateEnabled() + { + // arrange + const int id = 0; + var resource = new Resource(); + var serviceMock = new Mock>(); + _jsonApiContextMock.Setup(a => a.ApplyContext(It.IsAny>())).Returns(_jsonApiContextMock.Object); + _jsonApiContextMock.SetupGet(a => a.Options).Returns(new JsonApiOptions{ValidateModelState = true}); + var controller = new BaseJsonApiController(_jsonApiContextMock.Object, update: serviceMock.Object); + controller.ModelState.AddModelError("Id", "Failed Validation"); + + // act + var response = await controller.PatchAsync(id, resource); + + // assert + serviceMock.Verify(m => m.UpdateAsync(id, It.IsAny()), Times.Never); + Assert.IsType(response); + Assert.IsType(((BadRequestObjectResult) response).Value); + } + [Fact] public async Task PatchAsync_Throws_405_If_No_Service() { @@ -168,6 +213,67 @@ public async Task PatchAsync_Throws_405_If_No_Service() Assert.Equal(405, exception.GetStatusCode()); } + [Fact] + public async Task PostAsync_Calls_Service() + { + // arrange + var resource = new Resource(); + var serviceMock = new Mock>(); + _jsonApiContextMock.Setup(a => a.ApplyContext(It.IsAny>())).Returns(_jsonApiContextMock.Object); + _jsonApiContextMock.SetupGet(a => a.Options).Returns(new JsonApiOptions()); + var controller = new BaseJsonApiController(_jsonApiContextMock.Object, create: serviceMock.Object); + serviceMock.Setup(m => m.CreateAsync(It.IsAny())).ReturnsAsync(resource); + controller.ControllerContext = new Microsoft.AspNetCore.Mvc.ControllerContext {HttpContext = new DefaultHttpContext()}; + + // act + await controller.PostAsync(resource); + + // assert + serviceMock.Verify(m => m.CreateAsync(It.IsAny()), Times.Once); + VerifyApplyContext(); + } + + [Fact] + public async Task PostAsync_ModelStateInvalid_ValidateModelStateDisabled() + { + // arrange + var resource = new Resource(); + var serviceMock = new Mock>(); + _jsonApiContextMock.Setup(a => a.ApplyContext(It.IsAny>())).Returns(_jsonApiContextMock.Object); + _jsonApiContextMock.SetupGet(a => a.Options).Returns(new JsonApiOptions { ValidateModelState = false }); + var controller = new BaseJsonApiController(_jsonApiContextMock.Object, create: serviceMock.Object); + serviceMock.Setup(m => m.CreateAsync(It.IsAny())).ReturnsAsync(resource); + controller.ControllerContext = new Microsoft.AspNetCore.Mvc.ControllerContext { HttpContext = new DefaultHttpContext() }; + + // act + var response = await controller.PostAsync(resource); + + // assert + serviceMock.Verify(m => m.CreateAsync(It.IsAny()), Times.Once); + VerifyApplyContext(); + Assert.IsNotType(response); + } + + [Fact] + public async Task PostAsync_ModelStateInvalid_ValidateModelStateEnabled() + { + // arrange + var resource = new Resource(); + var serviceMock = new Mock>(); + _jsonApiContextMock.Setup(a => a.ApplyContext(It.IsAny>())).Returns(_jsonApiContextMock.Object); + _jsonApiContextMock.SetupGet(a => a.Options).Returns(new JsonApiOptions { ValidateModelState = true }); + var controller = new BaseJsonApiController(_jsonApiContextMock.Object, create: serviceMock.Object); + controller.ModelState.AddModelError("Id", "Failed Validation"); + + // act + var response = await controller.PostAsync(resource); + + // assert + serviceMock.Verify(m => m.CreateAsync(It.IsAny()), Times.Never); + Assert.IsType(response); + Assert.IsType(((BadRequestObjectResult)response).Value); + } + [Fact] public async Task PatchRelationshipsAsync_Calls_Service() { diff --git a/test/UnitTests/Controllers/JsonApiControllerMixin_Tests.cs b/test/UnitTests/Controllers/JsonApiControllerMixin_Tests.cs index a18aeaf668..850c459e32 100644 --- a/test/UnitTests/Controllers/JsonApiControllerMixin_Tests.cs +++ b/test/UnitTests/Controllers/JsonApiControllerMixin_Tests.cs @@ -1,4 +1,3 @@ -using System; using System.Collections.Generic; using JsonApiDotNetCore.Controllers; using JsonApiDotNetCore.Internal; @@ -16,26 +15,26 @@ public void Errors_Correctly_Infers_Status_Code() // arrange var errors422 = new ErrorCollection { Errors = new List { - new Error("422", "bad specific"), - new Error("422", "bad other specific"), + new Error(422, "bad specific"), + new Error(422, "bad other specific"), } }; var errors400 = new ErrorCollection { Errors = new List { - new Error("200", "weird"), - new Error("400", "bad"), - new Error("422", "bad specific"), + new Error(200, "weird"), + new Error(400, "bad"), + new Error(422, "bad specific"), } }; var errors500 = new ErrorCollection { Errors = new List { - new Error("200", "weird"), - new Error("400", "bad"), - new Error("422", "bad specific"), - new Error("500", "really bad"), - new Error("502", "really bad specific"), + new Error(200, "weird"), + new Error(400, "bad"), + new Error(422, "bad specific"), + new Error(500, "really bad"), + new Error(502, "really bad specific"), } }; diff --git a/test/UnitTests/Data/DefaultEntityRepository_Tests.cs b/test/UnitTests/Data/DefaultEntityRepository_Tests.cs index e596b35317..5b50fa4cbc 100644 --- a/test/UnitTests/Data/DefaultEntityRepository_Tests.cs +++ b/test/UnitTests/Data/DefaultEntityRepository_Tests.cs @@ -1,8 +1,6 @@ using System; using System.Collections.Generic; using JsonApiDotNetCore.Controllers; -using JsonApiDotNetCore.Internal; -using Microsoft.AspNetCore.Mvc; using Xunit; using Moq; using Microsoft.EntityFrameworkCore; @@ -13,7 +11,8 @@ using Microsoft.Extensions.Logging; using JsonApiDotNetCore.Services; using System.Threading.Tasks; - +using System.Linq; + namespace UnitTests.Data { public class DefaultEntityRepository_Tests : JsonApiControllerMixin @@ -50,12 +49,15 @@ public async Task UpdateAsync_Updates_Attributes_In_AttributesToUpdate() { Id = _todoItem.Id, Description = Guid.NewGuid().ToString() - }; + }; + + var descAttr = new AttrAttribute("description", "Description"); + descAttr.PropertyInfo = typeof(TodoItem).GetProperty(nameof(TodoItem.Description)); _attrsToUpdate = new Dictionary { { - new AttrAttribute("description", "Description"), + descAttr, todoItemUpdates.Description } }; @@ -89,13 +91,87 @@ private DefaultEntityRepository GetRepository() .Setup(m => m.RelationshipsToUpdate) .Returns(_relationshipsToUpdate); - _jsonApiContextMock - .Setup(m => m.GetDbContextResolver()) - .Returns(_contextResolverMock.Object); - return new DefaultEntityRepository( _loggFactoryMock.Object, - _jsonApiContextMock.Object); + _jsonApiContextMock.Object, + _contextResolverMock.Object); + } + + [Theory] + [InlineData(0)] + [InlineData(-1)] + [InlineData(-10)] + public async Task Page_When_PageSize_Is_NonPositive_Does_Nothing(int pageSize) + { + var todoItems = DbSetMock.Create(TodoItems(2, 3, 1)).Object; + var repository = GetRepository(); + + var result = await repository.PageAsync(todoItems, pageSize, 3); + + Assert.Equal(TodoItems(2, 3, 1), result, new IdComparer()); + } + + [Fact] + public async Task Page_When_PageNumber_Is_Zero_Pretends_PageNumber_Is_One() + { + var todoItems = DbSetMock.Create(TodoItems(2, 3, 1)).Object; + var repository = GetRepository(); + + var result = await repository.PageAsync(todoItems, 1, 0); + + Assert.Equal(TodoItems(2), result, new IdComparer()); + } + + [Fact] + public async Task Page_When_PageNumber_Of_PageSize_Does_Not_Exist_Return_Empty_Queryable() + { + var todoItems = DbSetMock.Create(TodoItems(2, 3, 1)).Object; + var repository = GetRepository(); + + var result = await repository.PageAsync(todoItems, 2, 3); + + Assert.Empty(result); + } + + [Theory] + [InlineData(3, 2, new[] { 4, 5, 6 })] + [InlineData(8, 2, new[] { 9 })] + [InlineData(20, 1, new[] { 1, 2, 3, 4, 5, 6, 7, 8, 9 })] + public async Task Page_When_PageNumber_Is_Positive_Returns_PageNumberTh_Page_Of_Size_PageSize(int pageSize, int pageNumber, int[] expectedResult) + { + var todoItems = DbSetMock.Create(TodoItems(1, 2, 3, 4, 5, 6, 7, 8, 9)).Object; + var repository = GetRepository(); + + var result = await repository.PageAsync(todoItems, pageSize, pageNumber); + + Assert.Equal(TodoItems(expectedResult), result, new IdComparer()); + } + + [Theory] + [InlineData(6, -1, new[] { 4, 5, 6, 7, 8, 9 })] + [InlineData(6, -2, new[] { 1, 2, 3 })] + [InlineData(20, -1, new[] { 1, 2, 3, 4, 5, 6, 7, 8, 9 })] + public async Task Page_When_PageNumber_Is_Negative_Returns_PageNumberTh_Page_From_End(int pageSize, int pageNumber, int[] expectedIds) + { + var todoItems = DbSetMock.Create(TodoItems(1, 2, 3, 4, 5, 6, 7, 8, 9)).Object; + var repository = GetRepository(); + + var result = await repository.PageAsync(todoItems, pageSize, pageNumber); + + Assert.Equal(TodoItems(expectedIds), result, new IdComparer()); + } + + private static TodoItem[] TodoItems(params int[] ids) + { + return ids.Select(id => new TodoItem { Id = id }).ToArray(); + } + + private class IdComparer : IEqualityComparer + where T : IIdentifiable + { + public bool Equals(T x, T y) => x?.StringId == y?.StringId; + + public int GetHashCode(T obj) => obj?.StringId?.GetHashCode() ?? 0; } } } diff --git a/test/JsonApiDotNetCoreExampleTests/Unit/Extensions/IServiceCollectionExtensionsTests.cs b/test/UnitTests/Extensions/IServiceCollectionExtensionsTests.cs similarity index 77% rename from test/JsonApiDotNetCoreExampleTests/Unit/Extensions/IServiceCollectionExtensionsTests.cs rename to test/UnitTests/Extensions/IServiceCollectionExtensionsTests.cs index 95b05df096..1b00c5aaa1 100644 --- a/test/JsonApiDotNetCoreExampleTests/Unit/Extensions/IServiceCollectionExtensionsTests.cs +++ b/test/UnitTests/Extensions/IServiceCollectionExtensionsTests.cs @@ -1,21 +1,20 @@ -using Xunit; using JsonApiDotNetCore.Builders; -using Microsoft.Extensions.DependencyInjection; -using JsonApiDotNetCore.Extensions; using JsonApiDotNetCore.Configuration; -using Microsoft.EntityFrameworkCore; using JsonApiDotNetCore.Data; +using JsonApiDotNetCore.Extensions; +using JsonApiDotNetCore.Formatters; using JsonApiDotNetCore.Internal; -using Microsoft.AspNetCore.Http; +using JsonApiDotNetCore.Internal.Generics; +using JsonApiDotNetCore.Serialization; using JsonApiDotNetCore.Services; using JsonApiDotNetCoreExample.Data; -using Microsoft.Extensions.Caching.Memory; using JsonApiDotNetCoreExample.Models; -using JsonApiDotNetCore.Serialization; -using JsonApiDotNetCore.Formatters; -using JsonApiDotNetCore.Internal.Generics; +using Microsoft.AspNetCore.Http; +using Microsoft.Extensions.DependencyInjection; +using Xunit; +using Microsoft.EntityFrameworkCore; -namespace JsonApiDotNetCoreExampleTests.Unit.Extensions +namespace UnitTests.Extensions { public class IServiceCollectionExtensionsTests { @@ -25,18 +24,18 @@ public void AddJsonApiInternals_Adds_All_Required_Services() // arrange var services = new ServiceCollection(); var jsonApiOptions = new JsonApiOptions(); - - services.AddDbContext(options => - { - options.UseMemoryCache(new MemoryCache(new MemoryCacheOptions())); - }, ServiceLifetime.Transient); + + services.AddDbContext(options => options.UseInMemoryDatabase("UnitTestDb"), ServiceLifetime.Transient); // act services.AddJsonApiInternals(jsonApiOptions); + // this is required because the DbContextResolver requires access to the current HttpContext + // to get the request scoped DbContext instance + services.AddScoped(); var provider = services.BuildServiceProvider(); // assert - Assert.NotNull(provider.GetService()); + Assert.NotNull(provider.GetService()); Assert.NotNull(provider.GetService(typeof(IEntityRepository))); Assert.NotNull(provider.GetService()); Assert.NotNull(provider.GetService()); @@ -49,6 +48,7 @@ public void AddJsonApiInternals_Adds_All_Required_Services() Assert.NotNull(provider.GetService()); Assert.NotNull(provider.GetService()); Assert.NotNull(provider.GetService()); + Assert.NotNull(provider.GetService()); Assert.NotNull(provider.GetService(typeof(GenericProcessor))); } } diff --git a/test/UnitTests/Extensions/TypeExtensions_Tests.cs b/test/UnitTests/Extensions/TypeExtensions_Tests.cs new file mode 100644 index 0000000000..f59fa37be0 --- /dev/null +++ b/test/UnitTests/Extensions/TypeExtensions_Tests.cs @@ -0,0 +1,44 @@ +using System.Collections.Generic; +using JsonApiDotNetCore.Extensions; +using JsonApiDotNetCore.Models; +using Xunit; + +namespace UnitTests.Extensions +{ + public class TypeExtensions_Tests + { + [Fact] + public void GetCollection_Creates_List_If_T_Implements_Interface() + { + // arrange + var type = typeof(Model); + + // act + var collection = type.GetEmptyCollection(); + + // assert + Assert.NotNull(collection); + Assert.Empty(collection); + Assert.IsType>(collection); + } + + [Fact] + public void New_Creates_An_Instance_If_T_Implements_Interface() + { + // arrange + var type = typeof(Model); + + // act + var instance = type.New(); + + // assert + Assert.NotNull(instance); + Assert.IsType(instance); + } + + private class Model : IIdentifiable + { + public string StringId { get; set; } + } + } +} diff --git a/test/UnitTests/Internal/ContextGraphBuilder_Tests.cs b/test/UnitTests/Internal/ContextGraphBuilder_Tests.cs new file mode 100644 index 0000000000..5f56ac0bd8 --- /dev/null +++ b/test/UnitTests/Internal/ContextGraphBuilder_Tests.cs @@ -0,0 +1,48 @@ +using JsonApiDotNetCore.Builders; +using JsonApiDotNetCore.Internal; +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.Logging; +using Xunit; + +namespace UnitTests.Internal +{ + public class ContextGraphBuilder_Tests + { + [Fact] + public void AddDbContext_Does_Not_Throw_If_Context_Contains_Members_That_DoNot_Implement_IIdentifiable() + { + // arrange + var contextGraphBuilder = new ContextGraphBuilder(); + + // act + contextGraphBuilder.AddDbContext(); + var contextGraph = contextGraphBuilder.Build() as ContextGraph; + + // assert + Assert.Empty(contextGraph.Entities); + } + + [Fact] + public void Adding_DbContext_Members_That_DoNot_Implement_IIdentifiable_Creates_Warning() + { + // arrange + var contextGraphBuilder = new ContextGraphBuilder(); + + // act + contextGraphBuilder.AddDbContext(); + var contextGraph = contextGraphBuilder.Build() as ContextGraph; + + // assert + Assert.Single(contextGraph.ValidationResults); + Assert.Contains(contextGraph.ValidationResults, v => v.LogLevel == LogLevel.Warning); + } + + private class Foo { } + + private class TestContext : DbContext + { + public DbSet Foos { get; set; } + } + } + +} diff --git a/test/UnitTests/Internal/QuerySet_Tests.cs b/test/UnitTests/Internal/QuerySet_Tests.cs deleted file mode 100644 index 2a433e63af..0000000000 --- a/test/UnitTests/Internal/QuerySet_Tests.cs +++ /dev/null @@ -1,230 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using JsonApiDotNetCore.Controllers; -using JsonApiDotNetCore.Internal; -using JsonApiDotNetCore.Internal.Query; -using JsonApiDotNetCore.Services; -using Microsoft.AspNetCore.Http; -using Microsoft.Extensions.Primitives; -using Moq; -using Xunit; - -namespace UnitTests.Internal -{ - public class QuerySet_Tests - { - private readonly Mock _jsonApiContextMock; - private readonly Mock _queryCollectionMock; - - public QuerySet_Tests() - { - _jsonApiContextMock = new Mock(); - _queryCollectionMock = new Mock(); - } - - [Fact] - public void Can_Build_Filters() - { - // arrange - var query = new Dictionary { - { "filter[key]", new StringValues("value") } - }; - - _queryCollectionMock - .Setup(m => m.GetEnumerator()) - .Returns(query.GetEnumerator()); - - _jsonApiContextMock - .Setup(m => m.GetControllerAttribute()) - .Returns(new DisableQueryAttribute(QueryParams.None)); - - // act -- ctor calls BuildQuerySet() - var querySet = new QuerySet( - _jsonApiContextMock.Object, - _queryCollectionMock.Object); - - // assert - Assert.Equal("value", querySet.Filters.Single(f => f.Key == "Key").Value); - } - - [Fact] - public void Filters_Properly_Parses_DateTime_With_Operation() - { - // arrange - const string dt = "2017-08-15T22:43:47.0156350-05:00"; - var query = new Dictionary { - { "filter[key]", new StringValues("le:" + dt) } - }; - - _queryCollectionMock - .Setup(m => m.GetEnumerator()) - .Returns(query.GetEnumerator()); - - _jsonApiContextMock - .Setup(m => m.GetControllerAttribute()) - .Returns(new DisableQueryAttribute(QueryParams.None)); - - // act -- ctor calls BuildQuerySet() - var querySet = new QuerySet( - _jsonApiContextMock.Object, - _queryCollectionMock.Object); - - // assert - Assert.Equal(dt, querySet.Filters.Single(f => f.Key == "Key").Value); - Assert.Equal("le", querySet.Filters.Single(f => f.Key == "Key").Operation); - } - - [Fact] - public void Filters_Properly_Parses_DateTime_Without_Operation() - { - // arrange - const string dt = "2017-08-15T22:43:47.0156350-05:00"; - var query = new Dictionary { - { "filter[key]", new StringValues(dt) } - }; - - _queryCollectionMock - .Setup(m => m.GetEnumerator()) - .Returns(query.GetEnumerator()); - - _jsonApiContextMock - .Setup(m => m.GetControllerAttribute()) - .Returns(new DisableQueryAttribute(QueryParams.None)); - - // act -- ctor calls BuildQuerySet() - var querySet = new QuerySet( - _jsonApiContextMock.Object, - _queryCollectionMock.Object); - - // assert - Assert.Equal(dt, querySet.Filters.Single(f => f.Key == "Key").Value); - Assert.Equal(string.Empty, querySet.Filters.Single(f => f.Key == "Key").Operation); - } - - [Fact] - public void Can_Disable_Filters() - { - // arrange - var query = new Dictionary { - { "filter[key]", new StringValues("value") } - }; - - _queryCollectionMock - .Setup(m => m.GetEnumerator()) - .Returns(query.GetEnumerator()); - - _jsonApiContextMock - .Setup(m => m.GetControllerAttribute()) - .Returns(new DisableQueryAttribute(QueryParams.Filter)); - - // act -- ctor calls BuildQuerySet() - var querySet = new QuerySet( - _jsonApiContextMock.Object, - _queryCollectionMock.Object); - - // assert - Assert.Empty(querySet.Filters); - } - - [Fact] - public void Can_Disable_Sort() - { - // arrange - var query = new Dictionary { - { "sort", new StringValues("-key") } - }; - - _queryCollectionMock - .Setup(m => m.GetEnumerator()) - .Returns(query.GetEnumerator()); - - _jsonApiContextMock - .Setup(m => m.GetControllerAttribute()) - .Returns(new DisableQueryAttribute(QueryParams.Sort)); - - // act -- ctor calls BuildQuerySet() - var querySet = new QuerySet( - _jsonApiContextMock.Object, - _queryCollectionMock.Object); - - // assert - Assert.Empty(querySet.SortParameters); - } - - [Fact] - public void Can_Disable_Include() - { - // arrange - var query = new Dictionary { - { "include", new StringValues("key") } - }; - - _queryCollectionMock - .Setup(m => m.GetEnumerator()) - .Returns(query.GetEnumerator()); - - _jsonApiContextMock - .Setup(m => m.GetControllerAttribute()) - .Returns(new DisableQueryAttribute(QueryParams.Include)); - - // act -- ctor calls BuildQuerySet() - var querySet = new QuerySet( - _jsonApiContextMock.Object, - _queryCollectionMock.Object); - - // assert - Assert.Empty(querySet.IncludedRelationships); - } - - [Fact] - public void Can_Disable_Page() - { - // arrange - var query = new Dictionary { - { "page[size]", new StringValues("1") } - }; - - _queryCollectionMock - .Setup(m => m.GetEnumerator()) - .Returns(query.GetEnumerator()); - - _jsonApiContextMock - .Setup(m => m.GetControllerAttribute()) - .Returns(new DisableQueryAttribute(QueryParams.Page)); - - // act -- ctor calls BuildQuerySet() - var querySet = new QuerySet( - _jsonApiContextMock.Object, - _queryCollectionMock.Object); - - // assert - Assert.Equal(0, querySet.PageQuery.PageSize); - } - - [Fact] - public void Can_Disable_Fields() - { - // arrange - var query = new Dictionary { - { "fields", new StringValues("key") } - }; - - _queryCollectionMock - .Setup(m => m.GetEnumerator()) - .Returns(query.GetEnumerator()); - - _jsonApiContextMock - .Setup(m => m.GetControllerAttribute()) - .Returns(new DisableQueryAttribute(QueryParams.Fields)); - - // act -- ctor calls BuildQuerySet() - var querySet = new QuerySet( - _jsonApiContextMock.Object, - _queryCollectionMock.Object); - - // assert - Assert.Empty(querySet.Fields); - } - } -} diff --git a/test/JsonApiDotNetCoreExampleTests/Unit/Models/AttributesEqualsTests.cs b/test/UnitTests/Models/AttributesEqualsTests.cs similarity index 97% rename from test/JsonApiDotNetCoreExampleTests/Unit/Models/AttributesEqualsTests.cs rename to test/UnitTests/Models/AttributesEqualsTests.cs index 107dd1d593..0b989169ef 100644 --- a/test/JsonApiDotNetCoreExampleTests/Unit/Models/AttributesEqualsTests.cs +++ b/test/UnitTests/Models/AttributesEqualsTests.cs @@ -1,7 +1,7 @@ using JsonApiDotNetCore.Models; using Xunit; -namespace JsonApiDotNetCoreExampleTests.Unit.Models +namespace UnitTests.Models { public class AttributesEqualsTests { diff --git a/test/UnitTests/Models/IdentifiableTests.cs b/test/UnitTests/Models/IdentifiableTests.cs new file mode 100644 index 0000000000..778b1b485f --- /dev/null +++ b/test/UnitTests/Models/IdentifiableTests.cs @@ -0,0 +1,26 @@ +using JsonApiDotNetCore.Models; +using Xunit; + +namespace UnitTests.Models +{ + public class IdentifiableTests + { + [Fact] + public void Can_Set_StringId_To_Value_Type() + { + var resource = new IntId(); + resource.StringId = "1"; + Assert.Equal(1, resource.Id); + } + + [Fact] + public void Setting_StringId_To_Null_Sets_Id_As_Default() + { + var resource = new IntId(); + resource.StringId = null; + Assert.Equal(0, resource.Id); + } + + private class IntId : Identifiable { } + } +} diff --git a/test/UnitTests/Models/RelationshipDataTests.cs b/test/UnitTests/Models/RelationshipDataTests.cs new file mode 100644 index 0000000000..ff00144b62 --- /dev/null +++ b/test/UnitTests/Models/RelationshipDataTests.cs @@ -0,0 +1,98 @@ +using System.Collections.Generic; +using JsonApiDotNetCore.Models; +using Newtonsoft.Json.Linq; +using Xunit; + +namespace UnitTests.Models +{ + public class RelationshipDataTests + { + [Fact] + public void Setting_ExposedData_To_List_Sets_ManyData() + { + // arrange + var relationshipData = new RelationshipData(); + var relationships = new List { + new ResourceIdentifierObject { + Id = "9", + Type = "authors" + } + }; + + // act + relationshipData.ExposedData = relationships; + + // assert + Assert.NotEmpty(relationshipData.ManyData); + Assert.Equal("authors", relationshipData.ManyData[0].Type); + Assert.Equal("9", relationshipData.ManyData[0].Id); + Assert.True(relationshipData.IsHasMany); + } + + [Fact] + public void Setting_ExposedData_To_JArray_Sets_ManyData() + { + // arrange + var relationshipData = new RelationshipData(); + var relationshipsJson = @"[ + { + ""type"": ""authors"", + ""id"": ""9"" + } + ]"; + + var relationships = JArray.Parse(relationshipsJson); + + // act + relationshipData.ExposedData = relationships; + + // assert + Assert.NotEmpty(relationshipData.ManyData); + Assert.Equal("authors", relationshipData.ManyData[0].Type); + Assert.Equal("9", relationshipData.ManyData[0].Id); + Assert.True(relationshipData.IsHasMany); + } + + [Fact] + public void Setting_ExposedData_To_RIO_Sets_SingleData() + { + // arrange + var relationshipData = new RelationshipData(); + var relationship = new ResourceIdentifierObject { + Id = "9", + Type = "authors" + }; + + // act + relationshipData.ExposedData = relationship; + + // assert + Assert.NotNull(relationshipData.SingleData); + Assert.Equal("authors", relationshipData.SingleData.Type); + Assert.Equal("9", relationshipData.SingleData.Id); + Assert.False(relationshipData.IsHasMany); + } + + [Fact] + public void Setting_ExposedData_To_JObject_Sets_SingleData() + { + // arrange + var relationshipData = new RelationshipData(); + var relationshipJson = @"{ + ""id"": ""9"", + ""type"": ""authors"" + }"; + + var relationship = JObject.Parse(relationshipJson); + + // act + relationshipData.ExposedData = relationship; + + // assert + Assert.NotNull(relationshipData.SingleData); + Assert.Equal("authors", relationshipData.SingleData.Type); + Assert.Equal("9", relationshipData.SingleData.Id); + Assert.False(relationshipData.IsHasMany); + } + } +} diff --git a/test/UnitTests/Models/ResourceDefinitionTests.cs b/test/UnitTests/Models/ResourceDefinitionTests.cs new file mode 100644 index 0000000000..2112a49447 --- /dev/null +++ b/test/UnitTests/Models/ResourceDefinitionTests.cs @@ -0,0 +1,129 @@ +using JsonApiDotNetCore.Builders; +using JsonApiDotNetCore.Internal; +using JsonApiDotNetCore.Models; +using System.Collections.Generic; +using Xunit; + +namespace UnitTests.Models +{ + public class ResourceDefinition_Scenario_Tests + { + private readonly IContextGraph _graph; + + public ResourceDefinition_Scenario_Tests() + { + _graph = new ContextGraphBuilder() + .AddResource("models") + .Build(); + } + + [Fact] + public void Request_Filter_Uses_Member_Expression() + { + // arrange + var resource = new RequestFilteredResource(isAdmin: true); + + // act + var attrs = resource.GetOutputAttrs(null); + + // assert + Assert.Single(attrs); + Assert.Equal(nameof(Model.Password), attrs[0].InternalAttributeName); + } + + [Fact] + public void Request_Filter_Uses_NewExpression() + { + // arrange + var resource = new RequestFilteredResource(isAdmin: false); + + // act + var attrs = resource.GetOutputAttrs(null); + + // assert + Assert.Empty(attrs); + } + + [Fact] + public void Instance_Filter_Uses_Member_Expression() + { + // arrange + var model = new Model { AlwaysExcluded = "Admin" }; + var resource = new InstanceFilteredResource(); + + // act + var attrs = resource.GetOutputAttrs(model); + + // assert + Assert.Single(attrs); + Assert.Equal(nameof(Model.Password), attrs[0].InternalAttributeName); + } + + [Fact] + public void Instance_Filter_Uses_NewExpression() + { + // arrange + var model = new Model { AlwaysExcluded = "Joe" }; + var resource = new InstanceFilteredResource(); + + // act + var attrs = resource.GetOutputAttrs(model); + + // assert + Assert.Empty(attrs); + } + + [Fact] + public void InstanceOutputAttrsAreSpecified_Returns_True_If_Instance_Method_Is_Overriden() + { + // act + var resource = new InstanceFilteredResource(); + + // assert + Assert.True(resource._instanceAttrsAreSpecified); + } + + [Fact] + public void InstanceOutputAttrsAreSpecified_Returns_False_If_Instance_Method_Is_Not_Overriden() + { + // act + var resource = new RequestFilteredResource(isAdmin: false); + + // assert + Assert.False(resource._instanceAttrsAreSpecified); + } + } + + public class Model : Identifiable + { + [Attr("name")] public string AlwaysExcluded { get; set; } + [Attr("password")] public string Password { get; set; } + } + + public class RequestFilteredResource : ResourceDefinition + { + private readonly bool _isAdmin; + + // this constructor will be resolved from the container + // that means you can take on any dependency that is also defined in the container + public RequestFilteredResource(bool isAdmin) + { + _isAdmin = isAdmin; + } + + // Called once per filtered resource in request. + protected override List OutputAttrs() + => _isAdmin + ? Remove(m => m.AlwaysExcluded) + : Remove(m => new { m.AlwaysExcluded, m.Password }, from: base.OutputAttrs()); + } + + public class InstanceFilteredResource : ResourceDefinition + { + // Called once per resource instance + protected override List OutputAttrs(Model model) + => model.AlwaysExcluded == "Admin" + ? Remove(m => m.AlwaysExcluded, base.OutputAttrs()) + : Remove(m => new { m.AlwaysExcluded, m.Password }, from: base.OutputAttrs()); + } +} diff --git a/test/UnitTests/Serialization/JsonApiDeSerializerTests.cs b/test/UnitTests/Serialization/JsonApiDeSerializerTests.cs index 53edc9faad..2da434c765 100644 --- a/test/UnitTests/Serialization/JsonApiDeSerializerTests.cs +++ b/test/UnitTests/Serialization/JsonApiDeSerializerTests.cs @@ -1,8 +1,9 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; using JsonApiDotNetCore.Builders; using JsonApiDotNetCore.Configuration; -using JsonApiDotNetCore.Internal.Generics; using JsonApiDotNetCore.Models; +using JsonApiDotNetCore.Request; using JsonApiDotNetCore.Serialization; using JsonApiDotNetCore.Services; using Moq; @@ -26,14 +27,12 @@ public void Can_Deserialize_Complex_Types() jsonApiContextMock.SetupAllProperties(); jsonApiContextMock.Setup(m => m.ContextGraph).Returns(contextGraph); jsonApiContextMock.Setup(m => m.AttributesToUpdate).Returns(new Dictionary()); - jsonApiContextMock.Setup(m => m.Options).Returns(new JsonApiOptions - { - JsonContractResolver = new CamelCasePropertyNamesContractResolver() - }); - var genericProcessorFactoryMock = new Mock(); + var jsonApiOptions = new JsonApiOptions(); + jsonApiOptions.SerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver(); + jsonApiContextMock.Setup(m => m.Options).Returns(jsonApiOptions); - var deserializer = new JsonApiDeSerializer(jsonApiContextMock.Object, genericProcessorFactoryMock.Object); + var deserializer = new JsonApiDeSerializer(jsonApiContextMock.Object); var content = new Document { @@ -41,10 +40,9 @@ public void Can_Deserialize_Complex_Types() { Type = "test-resource", Id = "1", - Attributes = new Dictionary { - { - "complex-member", new { compoundName = "testName" } - } + Attributes = new Dictionary + { + { "complex-member", new { compoundName = "testName" } } } } }; @@ -69,14 +67,11 @@ public void Can_Deserialize_Complex_List_Types() jsonApiContextMock.SetupAllProperties(); jsonApiContextMock.Setup(m => m.ContextGraph).Returns(contextGraph); jsonApiContextMock.Setup(m => m.AttributesToUpdate).Returns(new Dictionary()); - jsonApiContextMock.Setup(m => m.Options).Returns(new JsonApiOptions - { - JsonContractResolver = new CamelCasePropertyNamesContractResolver() - }); - - var genericProcessorFactoryMock = new Mock(); + var jsonApiOptions = new JsonApiOptions(); + jsonApiOptions.SerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver(); + jsonApiContextMock.Setup(m => m.Options).Returns(jsonApiOptions); - var deserializer = new JsonApiDeSerializer(jsonApiContextMock.Object, genericProcessorFactoryMock.Object); + var deserializer = new JsonApiDeSerializer(jsonApiContextMock.Object); var content = new Document { @@ -84,12 +79,9 @@ public void Can_Deserialize_Complex_List_Types() { Type = "test-resource", Id = "1", - Attributes = new Dictionary { - { - "complex-members", new [] { - new { compoundName = "testName" } - } - } + Attributes = new Dictionary + { + { "complex-members", new [] { new { compoundName = "testName" } } } } } }; @@ -116,14 +108,11 @@ public void Can_Deserialize_Complex_Types_With_Dasherized_Attrs() jsonApiContextMock.Setup(m => m.ContextGraph).Returns(contextGraph); jsonApiContextMock.Setup(m => m.AttributesToUpdate).Returns(new Dictionary()); - jsonApiContextMock.Setup(m => m.Options).Returns(new JsonApiOptions - { - JsonContractResolver = new DasherizedResolver() // <--- - }); + var jsonApiOptions = new JsonApiOptions(); + jsonApiOptions.SerializerSettings.ContractResolver = new DasherizedResolver(); // <-- + jsonApiContextMock.Setup(m => m.Options).Returns(jsonApiOptions); - var genericProcessorFactoryMock = new Mock(); - - var deserializer = new JsonApiDeSerializer(jsonApiContextMock.Object, genericProcessorFactoryMock.Object); + var deserializer = new JsonApiDeSerializer(jsonApiContextMock.Object); var content = new Document { @@ -131,9 +120,10 @@ public void Can_Deserialize_Complex_Types_With_Dasherized_Attrs() { Type = "test-resource", Id = "1", - Attributes = new Dictionary { + Attributes = new Dictionary + { { - "complex-member", new Dictionary { { "compound-name", "testName" } } + "complex-member", new Dictionary { { "compound-name", "testName" } } } } } @@ -162,14 +152,11 @@ public void Immutable_Attrs_Are_Not_Included_In_AttributesToUpdate() jsonApiContextMock.Setup(m => m.ContextGraph).Returns(contextGraph); jsonApiContextMock.Setup(m => m.AttributesToUpdate).Returns(attributesToUpdate); - jsonApiContextMock.Setup(m => m.Options).Returns(new JsonApiOptions - { - JsonContractResolver = new DasherizedResolver() - }); - - var genericProcessorFactoryMock = new Mock(); + var jsonApiOptions = new JsonApiOptions(); + jsonApiOptions.SerializerSettings.ContractResolver = new DasherizedResolver(); + jsonApiContextMock.Setup(m => m.Options).Returns(jsonApiOptions); - var deserializer = new JsonApiDeSerializer(jsonApiContextMock.Object, genericProcessorFactoryMock.Object); + var deserializer = new JsonApiDeSerializer(jsonApiContextMock.Object); var content = new Document { @@ -177,11 +164,12 @@ public void Immutable_Attrs_Are_Not_Included_In_AttributesToUpdate() { Type = "test-resource", Id = "1", - Attributes = new Dictionary { - { "complex-member", new Dictionary { - { "compound-name", "testName" } } + Attributes = new Dictionary + { + { + "complex-member", new Dictionary { { "compound-name", "testName" } } }, - { "immutable", "value"} + { "immutable", "value" } } } }; @@ -193,12 +181,138 @@ public void Immutable_Attrs_Are_Not_Included_In_AttributesToUpdate() // assert Assert.NotNull(result.ComplexMember); - Assert.Equal(1, attributesToUpdate.Count); - - foreach(var attr in attributesToUpdate) + Assert.Single(attributesToUpdate); + + foreach (var attr in attributesToUpdate) Assert.False(attr.Key.IsImmutable); } + [Fact] + public void Can_Deserialize_Independent_Side_Of_One_To_One_Relationship() + { + // arrange + var contextGraphBuilder = new ContextGraphBuilder(); + contextGraphBuilder.AddResource("independents"); + contextGraphBuilder.AddResource("dependents"); + var contextGraph = contextGraphBuilder.Build(); + + var jsonApiContextMock = new Mock(); + jsonApiContextMock.SetupAllProperties(); + jsonApiContextMock.Setup(m => m.ContextGraph).Returns(contextGraph); + jsonApiContextMock.Setup(m => m.AttributesToUpdate).Returns(new Dictionary()); + + var jsonApiOptions = new JsonApiOptions(); + jsonApiContextMock.Setup(m => m.Options).Returns(jsonApiOptions); + + var deserializer = new JsonApiDeSerializer(jsonApiContextMock.Object); + + var property = Guid.NewGuid().ToString(); + var content = new Document + { + Data = new DocumentData + { + Type = "independents", + Id = "1", + Attributes = new Dictionary { { "property", property } } + } + }; + + var contentString = JsonConvert.SerializeObject(content); + + // act + var result = deserializer.Deserialize(contentString); + + // assert + Assert.NotNull(result); + Assert.Equal(property, result.Property); + } + + [Fact] + public void Can_Deserialize_Independent_Side_Of_One_To_One_Relationship_With_Relationship_Body() + { + // arrange + var contextGraphBuilder = new ContextGraphBuilder(); + contextGraphBuilder.AddResource("independents"); + contextGraphBuilder.AddResource("dependents"); + var contextGraph = contextGraphBuilder.Build(); + + var jsonApiContextMock = new Mock(); + jsonApiContextMock.SetupAllProperties(); + jsonApiContextMock.Setup(m => m.ContextGraph).Returns(contextGraph); + jsonApiContextMock.Setup(m => m.AttributesToUpdate).Returns(new Dictionary()); + + var jsonApiOptions = new JsonApiOptions(); + jsonApiContextMock.Setup(m => m.Options).Returns(jsonApiOptions); + + var deserializer = new JsonApiDeSerializer(jsonApiContextMock.Object); + + var property = Guid.NewGuid().ToString(); + var content = new Document + { + Data = new DocumentData + { + Type = "independents", + Id = "1", + Attributes = new Dictionary { { "property", property } }, + // a common case for this is deserialization in unit tests + Relationships = new Dictionary { { "dependent", new RelationshipData { } } } + } + }; + + var contentString = JsonConvert.SerializeObject(content); + + // act + var result = deserializer.Deserialize(contentString); + + // assert + Assert.NotNull(result); + Assert.Equal(property, result.Property); + } + + [Fact] + public void Sets_The_DocumentMeta_Property_In_JsonApiContext() + { + // arrange + var contextGraphBuilder = new ContextGraphBuilder(); + contextGraphBuilder.AddResource("independents"); + contextGraphBuilder.AddResource("dependents"); + var contextGraph = contextGraphBuilder.Build(); + + var jsonApiContextMock = new Mock(); + jsonApiContextMock.SetupAllProperties(); + jsonApiContextMock.Setup(m => m.ContextGraph).Returns(contextGraph); + jsonApiContextMock.Setup(m => m.AttributesToUpdate).Returns(new Dictionary()); + + var jsonApiOptions = new JsonApiOptions(); + jsonApiContextMock.Setup(m => m.Options).Returns(jsonApiOptions); + + + var deserializer = new JsonApiDeSerializer(jsonApiContextMock.Object); + + var property = Guid.NewGuid().ToString(); + + var content = new Document + { + Meta = new Dictionary() { { "foo", "bar" } }, + Data = new DocumentData + { + Type = "independents", + Id = "1", + Attributes = new Dictionary { { "property", property } }, + // a common case for this is deserialization in unit tests + Relationships = new Dictionary { { "dependent", new RelationshipData { } } } + } + }; + + var contentString = JsonConvert.SerializeObject(content); + + // act + var result = deserializer.Deserialize(contentString); + + // assert + jsonApiContextMock.VerifySet(mock => mock.DocumentMeta = content.Meta); + } + private class TestResource : Identifiable { [Attr("complex-member")] @@ -218,5 +332,207 @@ private class ComplexType { public string CompoundName { get; set; } } + + private class Independent : Identifiable + { + [Attr("property")] public string Property { get; set; } + [HasOne("dependent")] public Dependent Dependent { get; set; } + } + + private class Dependent : Identifiable + { + [HasOne("independent")] public Independent Independent { get; set; } + public int IndependentId { get; set; } + } + + [Fact] + public void Can_Deserialize_Object_With_HasManyRelationship() + { + // arrange + var contextGraphBuilder = new ContextGraphBuilder(); + contextGraphBuilder.AddResource("independents"); + contextGraphBuilder.AddResource("dependents"); + var contextGraph = contextGraphBuilder.Build(); + + var jsonApiContextMock = new Mock(); + jsonApiContextMock.SetupAllProperties(); + jsonApiContextMock.Setup(m => m.ContextGraph).Returns(contextGraph); + jsonApiContextMock.Setup(m => m.AttributesToUpdate).Returns(new Dictionary()); + jsonApiContextMock.Setup(m => m.HasManyRelationshipPointers).Returns(new HasManyRelationshipPointers()); + + var jsonApiOptions = new JsonApiOptions(); + jsonApiContextMock.Setup(m => m.Options).Returns(jsonApiOptions); + + var deserializer = new JsonApiDeSerializer(jsonApiContextMock.Object); + + var contentString = + @"{ + ""data"": { + ""type"": ""independents"", + ""id"": ""1"", + ""attributes"": { }, + ""relationships"": { + ""dependents"": { + ""data"": [ + { + ""type"": ""dependents"", + ""id"": ""2"" + } + ] + } + } + } + }"; + + // act + var result = deserializer.Deserialize(contentString); + + // assert + Assert.NotNull(result); + Assert.Equal(1, result.Id); + Assert.NotNull(result.Dependents); + Assert.NotEmpty(result.Dependents); + Assert.Single(result.Dependents); + + var dependent = result.Dependents[0]; + Assert.Equal(2, dependent.Id); + } + + [Fact] + public void Sets_Attribute_Values_On_Included_HasMany_Relationships() + { + // arrange + var contextGraphBuilder = new ContextGraphBuilder(); + contextGraphBuilder.AddResource("independents"); + contextGraphBuilder.AddResource("dependents"); + var contextGraph = contextGraphBuilder.Build(); + + var jsonApiContextMock = new Mock(); + jsonApiContextMock.SetupAllProperties(); + jsonApiContextMock.Setup(m => m.ContextGraph).Returns(contextGraph); + jsonApiContextMock.Setup(m => m.AttributesToUpdate).Returns(new Dictionary()); + jsonApiContextMock.Setup(m => m.HasManyRelationshipPointers).Returns(new HasManyRelationshipPointers()); + + var jsonApiOptions = new JsonApiOptions(); + jsonApiContextMock.Setup(m => m.Options).Returns(jsonApiOptions); + + var deserializer = new JsonApiDeSerializer(jsonApiContextMock.Object); + + var expectedName = "John Doe"; + var contentString = + @"{ + ""data"": { + ""type"": ""independents"", + ""id"": ""1"", + ""attributes"": { }, + ""relationships"": { + ""dependents"": { + ""data"": [ + { + ""type"": ""dependents"", + ""id"": ""2"" + } + ] + } + } + }, + ""included"": [ + { + ""type"": ""dependents"", + ""id"": ""2"", + ""attributes"": { + ""name"": """ + expectedName + @""" + } + } + ] + }"; + + // act + var result = deserializer.Deserialize(contentString); + + // assert + Assert.NotNull(result); + Assert.Equal(1, result.Id); + Assert.NotNull(result.Dependents); + Assert.NotEmpty(result.Dependents); + Assert.Single(result.Dependents); + + var dependent = result.Dependents[0]; + Assert.Equal(2, dependent.Id); + Assert.Equal(expectedName, dependent.Name); + } + + [Fact] + public void Sets_Attribute_Values_On_Included_HasOne_Relationships() + { + // arrange + var contextGraphBuilder = new ContextGraphBuilder(); + contextGraphBuilder.AddResource("independents"); + contextGraphBuilder.AddResource("dependents"); + var contextGraph = contextGraphBuilder.Build(); + + var jsonApiContextMock = new Mock(); + jsonApiContextMock.SetupAllProperties(); + jsonApiContextMock.Setup(m => m.ContextGraph).Returns(contextGraph); + jsonApiContextMock.Setup(m => m.AttributesToUpdate).Returns(new Dictionary()); + jsonApiContextMock.Setup(m => m.RelationshipsToUpdate).Returns(new Dictionary()); + jsonApiContextMock.Setup(m => m.HasManyRelationshipPointers).Returns(new HasManyRelationshipPointers()); + jsonApiContextMock.Setup(m => m.HasOneRelationshipPointers).Returns(new HasOneRelationshipPointers()); + + var jsonApiOptions = new JsonApiOptions(); + jsonApiContextMock.Setup(m => m.Options).Returns(jsonApiOptions); + + var deserializer = new JsonApiDeSerializer(jsonApiContextMock.Object); + + var expectedName = "John Doe"; + var contentString = + @"{ + ""data"": { + ""type"": ""dependents"", + ""id"": ""1"", + ""attributes"": { }, + ""relationships"": { + ""independent"": { + ""data"": { + ""type"": ""independents"", + ""id"": ""2"" + } + } + } + }, + ""included"": [ + { + ""type"": ""independents"", + ""id"": ""2"", + ""attributes"": { + ""name"": """ + expectedName + @""" + } + } + ] + }"; + + // act + var result = deserializer.Deserialize(contentString); + + // assert + Assert.NotNull(result); + Assert.Equal(1, result.Id); + Assert.NotNull(result.Independent); + Assert.Equal(2, result.Independent.Id); + Assert.Equal(expectedName, result.Independent.Name); + } + + private class OneToManyDependent : Identifiable + { + [Attr("name")] public string Name { get; set; } + [HasOne("independent")] public OneToManyIndependent Independent { get; set; } + public int IndependentId { get; set; } + } + + private class OneToManyIndependent : Identifiable + { + [Attr("name")] public string Name { get; set; } + [HasMany("dependents")] public List Dependents { get; set; } + } } } diff --git a/test/UnitTests/Serialization/JsonApiSerializerTests.cs b/test/UnitTests/Serialization/JsonApiSerializerTests.cs index e671f3fc0c..8a67b80434 100644 --- a/test/UnitTests/Serialization/JsonApiSerializerTests.cs +++ b/test/UnitTests/Serialization/JsonApiSerializerTests.cs @@ -1,14 +1,10 @@ -using System.Collections.Generic; -using JsonApiDotNetCore.Builders; +using JsonApiDotNetCore.Builders; using JsonApiDotNetCore.Configuration; using JsonApiDotNetCore.Internal; -using JsonApiDotNetCore.Internal.Generics; using JsonApiDotNetCore.Models; using JsonApiDotNetCore.Serialization; using JsonApiDotNetCore.Services; using Moq; -using Newtonsoft.Json; -using Newtonsoft.Json.Serialization; using Xunit; namespace UnitTests.Serialization @@ -26,9 +22,7 @@ public void Can_Serialize_Complex_Types() var jsonApiContextMock = new Mock(); jsonApiContextMock.SetupAllProperties(); jsonApiContextMock.Setup(m => m.ContextGraph).Returns(contextGraph); - jsonApiContextMock.Setup(m => m.Options).Returns(new JsonApiOptions { - JsonContractResolver = new DasherizedResolver() - }); + jsonApiContextMock.Setup(m => m.Options).Returns(new JsonApiOptions()); jsonApiContextMock.Setup(m => m.RequestEntity) .Returns(contextGraph.GetContextEntity("test-resource")); jsonApiContextMock.Setup(m => m.MetaBuilder).Returns(new MetaBuilder()); @@ -36,8 +30,10 @@ public void Can_Serialize_Complex_Types() var documentBuilder = new DocumentBuilder(jsonApiContextMock.Object); var serializer = new JsonApiSerializer(jsonApiContextMock.Object, documentBuilder); - var resource = new TestResource { - ComplexMember = new ComplexType { + var resource = new TestResource + { + ComplexMember = new ComplexType + { CompoundName = "testname" } }; @@ -47,7 +43,7 @@ public void Can_Serialize_Complex_Types() // assert Assert.NotNull(result); - Assert.Equal("{\"data\":{\"type\":\"test-resource\",\"id\":\"\",\"attributes\":{\"complex-member\":{\"compound-name\":\"testname\"}}}}", result); + Assert.Equal("{\"data\":{\"attributes\":{\"complex-member\":{\"compound-name\":\"testname\"}},\"type\":\"test-resource\",\"id\":\"\"}}", result); } private class TestResource : Identifiable diff --git a/test/UnitTests/Services/Operations/OperationsProcessorTests.cs b/test/UnitTests/Services/Operations/OperationsProcessorTests.cs new file mode 100644 index 0000000000..08211c5a67 --- /dev/null +++ b/test/UnitTests/Services/Operations/OperationsProcessorTests.cs @@ -0,0 +1,197 @@ +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; +using JsonApiDotNetCore.Data; +using JsonApiDotNetCore.Models.Operations; +using JsonApiDotNetCore.Services; +using JsonApiDotNetCore.Services.Operations; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Storage; +using Moq; +using Newtonsoft.Json; +using Xunit; + +namespace UnitTests.Services +{ + public class OperationsProcessorTests + { + private readonly Mock _resolverMock; + public readonly Mock _dbContextMock; + public readonly Mock _dbContextResolverMock; + public readonly Mock _jsonApiContextMock; + + public OperationsProcessorTests() + { + _resolverMock = new Mock(); + _dbContextMock = new Mock(); + _dbContextResolverMock = new Mock(); + _jsonApiContextMock = new Mock(); + } + + [Fact] + public async Task ProcessAsync_Performs_LocalId_ReplacementAsync_In_Relationships() + { + // arrange + var request = @"[ + { + ""op"": ""add"", + ""data"": { + ""type"": ""authors"", + ""lid"": ""a"", + ""attributes"": { + ""name"": ""dgeb"" + } + } + }, { + ""op"": ""add"", + ""data"": { + ""type"": ""articles"", + ""attributes"": { + ""title"": ""JSON API paints my bikeshed!"" + }, + ""relationships"": { + ""author"": { + ""data"": { + ""type"": ""authors"", + ""lid"": ""a"" + } + } + } + } + } + ]"; + + var op1Result = @"{ + ""links"": { + ""self"": ""http://example.com/authors/9"" + }, + ""data"": { + ""type"": ""authors"", + ""id"": ""9"", + ""lid"": ""a"", + ""attributes"": { + ""name"": ""dgeb"" + } + } + }"; + + var operations = JsonConvert.DeserializeObject>(request); + var addOperationResult = JsonConvert.DeserializeObject(op1Result); + + var databaseMock = new Mock(_dbContextMock.Object); + var transactionMock = new Mock(); + databaseMock.Setup(m => m.BeginTransactionAsync(It.IsAny())) + .ReturnsAsync(transactionMock.Object); + _dbContextMock.Setup(m => m.Database).Returns(databaseMock.Object); + + var opProcessorMock = new Mock(); + opProcessorMock.Setup(m => m.ProcessAsync(It.Is(op => op.DataObject.Type.ToString() == "authors"))) + .ReturnsAsync(addOperationResult); + + _resolverMock.Setup(m => m.LocateCreateService(It.IsAny())) + .Returns(opProcessorMock.Object); + + _dbContextResolverMock.Setup(m => m.GetContext()).Returns(_dbContextMock.Object); + var operationsProcessor = new OperationsProcessor(_resolverMock.Object, _dbContextResolverMock.Object, _jsonApiContextMock.Object); + + // act + var results = await operationsProcessor.ProcessAsync(operations); + + // assert + opProcessorMock.Verify( + m => m.ProcessAsync( + It.Is(o => + o.DataObject.Type.ToString() == "articles" + && o.DataObject.Relationships["author"].SingleData.Id == "9" + ) + ) + ); + } + + [Fact] + public async Task ProcessAsync_Performs_LocalId_ReplacementAsync_In_References() + { + // arrange + var request = @"[ + { + ""op"": ""add"", + ""data"": { + ""type"": ""authors"", + ""lid"": ""a"", + ""attributes"": { + ""name"": ""jaredcnance"" + } + } + }, { + ""op"": ""update"", + ""ref"": { + ""type"": ""authors"", + ""lid"": ""a"" + }, + ""data"": { + ""type"": ""authors"", + ""lid"": ""a"", + ""attributes"": { + ""name"": ""jnance"" + } + } + } + ]"; + + var op1Result = @"{ + ""data"": { + ""type"": ""authors"", + ""id"": ""9"", + ""lid"": ""a"", + ""attributes"": { + ""name"": ""jaredcnance"" + } + } + }"; + + var operations = JsonConvert.DeserializeObject>(request); + var addOperationResult = JsonConvert.DeserializeObject(op1Result); + + var databaseMock = new Mock(_dbContextMock.Object); + var transactionMock = new Mock(); + + databaseMock.Setup(m => m.BeginTransactionAsync(It.IsAny())) + .ReturnsAsync(transactionMock.Object); + + _dbContextMock.Setup(m => m.Database).Returns(databaseMock.Object); + + // setup add + var addOpProcessorMock = new Mock(); + addOpProcessorMock.Setup(m => m.ProcessAsync(It.Is(op => op.DataObject.Type.ToString() == "authors"))) + .ReturnsAsync(addOperationResult); + _resolverMock.Setup(m => m.LocateCreateService(It.IsAny())) + .Returns(addOpProcessorMock.Object); + + // setup update + var updateOpProcessorMock = new Mock(); + updateOpProcessorMock.Setup(m => m.ProcessAsync(It.Is(op => op.DataObject.Type.ToString() == "authors"))) + .ReturnsAsync((Operation)null); + _resolverMock.Setup(m => m.LocateUpdateService(It.IsAny())) + .Returns(updateOpProcessorMock.Object); + + _dbContextResolverMock.Setup(m => m.GetContext()).Returns(_dbContextMock.Object); + var operationsProcessor = new OperationsProcessor(_resolverMock.Object, _dbContextResolverMock.Object, _jsonApiContextMock.Object); + + // act + var results = await operationsProcessor.ProcessAsync(operations); + + // assert + updateOpProcessorMock.Verify( + m => m.ProcessAsync( + It.Is(o => + o.DataObject.Type.ToString() == "authors" + // && o.DataObject.Id == "9" // currently, we will not replace the data.id member + && o.DataObject.Id == null + && o.Ref.Id == "9" + ) + ) + ); + } + } +} diff --git a/test/UnitTests/Services/Operations/Processors/CreateOpProcessorTests.cs b/test/UnitTests/Services/Operations/Processors/CreateOpProcessorTests.cs new file mode 100644 index 0000000000..aa76f2dc17 --- /dev/null +++ b/test/UnitTests/Services/Operations/Processors/CreateOpProcessorTests.cs @@ -0,0 +1,80 @@ +using System.Collections.Generic; +using System.Threading.Tasks; +using JsonApiDotNetCore.Builders; +using JsonApiDotNetCore.Internal; +using JsonApiDotNetCore.Models; +using JsonApiDotNetCore.Models.Operations; +using JsonApiDotNetCore.Serialization; +using JsonApiDotNetCore.Services; +using JsonApiDotNetCore.Services.Operations.Processors; +using Moq; +using Xunit; + +namespace UnitTests.Services +{ + public class CreateOpProcessorTests + { + private readonly Mock> _createServiceMock; + private readonly Mock _deserializerMock; + private readonly Mock _documentBuilderMock; + + public CreateOpProcessorTests() + { + _createServiceMock = new Mock>(); + _deserializerMock = new Mock(); + _documentBuilderMock = new Mock(); + } + + [Fact] + public async Task ProcessAsync_Deserializes_And_Creates() + { + // arrange + var testResource = new TestResource { + Name = "some-name" + }; + + var data = new DocumentData { + Type = "test-resources", + Attributes = new Dictionary { + { "name", testResource.Name } + } + }; + + var operation = new Operation { + Data = data, + }; + + var contextGraph = new ContextGraphBuilder() + .AddResource("test-resources") + .Build(); + + _deserializerMock.Setup(m => m.DocumentToObject(It.IsAny(), It.IsAny>())) + .Returns(testResource); + + var opProcessor = new CreateOpProcessor( + _createServiceMock.Object, + _deserializerMock.Object, + _documentBuilderMock.Object, + contextGraph + ); + + _documentBuilderMock.Setup(m => m.GetData(It.IsAny(), It.IsAny())) + .Returns(data); + + // act + var result = await opProcessor.ProcessAsync(operation); + + // assert + Assert.Equal(OperationCode.add, result.Op); + Assert.NotNull(result.Data); + Assert.Equal(testResource.Name, result.DataObject.Attributes["name"]); + _createServiceMock.Verify(m => m.CreateAsync(It.IsAny())); + } + + public class TestResource : Identifiable + { + [Attr("name")] + public string Name { get; set; } + } + } +} diff --git a/test/UnitTests/Services/QueryAccessorTests.cs b/test/UnitTests/Services/QueryAccessorTests.cs index df455b1b92..aa8bc6ae7e 100644 --- a/test/UnitTests/Services/QueryAccessorTests.cs +++ b/test/UnitTests/Services/QueryAccessorTests.cs @@ -1,10 +1,10 @@ using System; using System.Collections.Generic; +using JsonApiDotNetCore.Internal; using JsonApiDotNetCore.Internal.Query; using JsonApiDotNetCore.Services; using Microsoft.AspNetCore.Http; using Microsoft.Extensions.Logging; -using Microsoft.Extensions.Primitives; using Moq; using Xunit; @@ -13,13 +13,13 @@ namespace UnitTests.Services public class QueryAccessorTests { private readonly Mock _contextMock; - private readonly Mock _loggerMock; + private readonly Mock> _loggerMock; private readonly Mock _queryMock; public QueryAccessorTests() { _contextMock = new Mock(); - _loggerMock = new Mock(); + _loggerMock = new Mock>(); _queryMock = new Mock(); } @@ -27,19 +27,16 @@ public QueryAccessorTests() public void Can_Get_Guid_QueryValue() { // arrange - const string key = "some-id"; - var filterQuery = $"filter[{key}]"; + const string key = "SomeId"; var value = Guid.NewGuid(); - - var query = new Dictionary { - { filterQuery, value.ToString() } + var querySet = new QuerySet + { + Filters = new List { + new FilterQuery(key, value.ToString(), "eq") + } }; - - _queryMock.Setup(q => q.GetEnumerator()).Returns(query.GetEnumerator()); - var querySet = new QuerySet(_contextMock.Object, _queryMock.Object); - _contextMock.Setup(c => c.QuerySet) - .Returns(querySet); + _contextMock.Setup(c => c.QuerySet).Returns(querySet); var service = new QueryAccessor(_contextMock.Object, _loggerMock.Object); @@ -50,5 +47,55 @@ public void Can_Get_Guid_QueryValue() Assert.True(success); Assert.Equal(value, result); } + + [Fact] + public void GetRequired_Throws_If_Not_Present() + { + // arrange + const string key = "SomeId"; + var value = Guid.NewGuid(); + + var querySet = new QuerySet + { + Filters = new List { + new FilterQuery(key, value.ToString(), "eq") + } + }; + + _contextMock.Setup(c => c.QuerySet).Returns(querySet); + + var service = new QueryAccessor(_contextMock.Object, _loggerMock.Object); + + // act + var exception = Assert.Throws(() => service.GetRequired("Invalid")); + + // assert + Assert.Equal(422, exception.GetStatusCode()); + } + + [Fact] + public void GetRequired_Does_Not_Throw_If_Present() + { + // arrange + const string key = "SomeId"; + var value = Guid.NewGuid(); + + var querySet = new QuerySet + { + Filters = new List { + new FilterQuery(key, value.ToString(), "eq") + } + }; + + _contextMock.Setup(c => c.QuerySet).Returns(querySet); + + var service = new QueryAccessor(_contextMock.Object, _loggerMock.Object); + + // act + var result = service.GetRequired("SomeId"); + + // assert + Assert.Equal(value, result); + } } } diff --git a/test/UnitTests/Services/QueryComposerTests.cs b/test/UnitTests/Services/QueryComposerTests.cs new file mode 100644 index 0000000000..330083820c --- /dev/null +++ b/test/UnitTests/Services/QueryComposerTests.cs @@ -0,0 +1,79 @@ +using System.Collections.Generic; +using JsonApiDotNetCore.Internal.Query; +using JsonApiDotNetCore.Services; +using Moq; +using Xunit; + +namespace UnitTests.Services +{ + public class QueryComposerTests + { + private readonly Mock _jsonApiContext; + + public QueryComposerTests() + { + _jsonApiContext = new Mock(); + } + + [Fact] + public void Can_ComposeEqual_FilterStringForUrl() + { + // arrange + var filter = new FilterQuery("attribute", "value", "eq"); + var querySet = new QuerySet(); + List filters = new List(); + filters.Add(filter); + querySet.Filters=filters; + + _jsonApiContext + .Setup(m => m.QuerySet) + .Returns(querySet); + + var queryComposer = new QueryComposer(); + // act + var filterString = queryComposer.Compose(_jsonApiContext.Object); + // assert + Assert.Equal("&filter[attribute]=eq:value", filterString); + } + + [Fact] + public void Can_ComposeLessThan_FilterStringForUrl() + { + // arrange + var filter = new FilterQuery("attribute", "value", "le"); + var filter2 = new FilterQuery("attribute2", "value2", ""); + var querySet = new QuerySet(); + List filters = new List(); + filters.Add(filter); + filters.Add(filter2); + querySet.Filters = filters; + + _jsonApiContext + .Setup(m => m.QuerySet) + .Returns(querySet); + + var queryComposer = new QueryComposer(); + // act + var filterString = queryComposer.Compose(_jsonApiContext.Object); + // assert + Assert.Equal("&filter[attribute]=le:value&filter[attribute2]=value2", filterString); + } + + [Fact] + public void NoFilter_Compose_EmptyStringReturned() + { + // arrange + var querySet = new QuerySet(); + + _jsonApiContext + .Setup(m => m.QuerySet) + .Returns(querySet); + + var queryComposer = new QueryComposer(); + // act + var filterString = queryComposer.Compose(_jsonApiContext.Object); + // assert + Assert.Equal("", filterString); + } + } +} diff --git a/test/UnitTests/Services/QueryParser_Tests.cs b/test/UnitTests/Services/QueryParser_Tests.cs new file mode 100644 index 0000000000..64c9830f2b --- /dev/null +++ b/test/UnitTests/Services/QueryParser_Tests.cs @@ -0,0 +1,358 @@ +using System.Collections.Generic; +using System.Linq; +using JsonApiDotNetCore.Configuration; +using JsonApiDotNetCore.Controllers; +using JsonApiDotNetCore.Internal; +using JsonApiDotNetCore.Models; +using JsonApiDotNetCore.Services; +using Microsoft.AspNetCore.Http; +using Microsoft.Extensions.Primitives; +using Moq; +using Xunit; + +namespace UnitTests.Services +{ + public class QueryParser_Tests + { + private readonly Mock _controllerContextMock; + private readonly Mock _queryCollectionMock; + + public QueryParser_Tests() + { + _controllerContextMock = new Mock(); + _queryCollectionMock = new Mock(); + } + + [Fact] + public void Can_Build_Filters() + { + // arrange + var query = new Dictionary { + { "filter[key]", new StringValues("value") } + }; + + _queryCollectionMock + .Setup(m => m.GetEnumerator()) + .Returns(query.GetEnumerator()); + + _controllerContextMock + .Setup(m => m.GetControllerAttribute()) + .Returns(new DisableQueryAttribute(QueryParams.None)); + + var queryParser = new QueryParser(_controllerContextMock.Object, new JsonApiOptions()); + + // act + var querySet = queryParser.Parse(_queryCollectionMock.Object); + + // assert + Assert.Equal("value", querySet.Filters.Single(f => f.Attribute == "key").Value); + } + + [Fact] + public void Filters_Properly_Parses_DateTime_With_Operation() + { + // arrange + const string dt = "2017-08-15T22:43:47.0156350-05:00"; + var query = new Dictionary { + { "filter[key]", new StringValues("le:" + dt) } + }; + + _queryCollectionMock + .Setup(m => m.GetEnumerator()) + .Returns(query.GetEnumerator()); + + _controllerContextMock + .Setup(m => m.GetControllerAttribute()) + .Returns(new DisableQueryAttribute(QueryParams.None)); + + var queryParser = new QueryParser(_controllerContextMock.Object, new JsonApiOptions()); + + // act + var querySet = queryParser.Parse(_queryCollectionMock.Object); + + // assert + Assert.Equal(dt, querySet.Filters.Single(f => f.Attribute == "key").Value); + Assert.Equal("le", querySet.Filters.Single(f => f.Attribute == "key").Operation); + } + + [Fact] + public void Filters_Properly_Parses_DateTime_Without_Operation() + { + // arrange + const string dt = "2017-08-15T22:43:47.0156350-05:00"; + var query = new Dictionary { + { "filter[key]", new StringValues(dt) } + }; + + _queryCollectionMock + .Setup(m => m.GetEnumerator()) + .Returns(query.GetEnumerator()); + + _controllerContextMock + .Setup(m => m.GetControllerAttribute()) + .Returns(new DisableQueryAttribute(QueryParams.None)); + + var queryParser = new QueryParser(_controllerContextMock.Object, new JsonApiOptions()); + + // act + var querySet = queryParser.Parse(_queryCollectionMock.Object); + + // assert + Assert.Equal(dt, querySet.Filters.Single(f => f.Attribute == "key").Value); + Assert.Equal(string.Empty, querySet.Filters.Single(f => f.Attribute == "key").Operation); + } + + [Fact] + public void Can_Disable_Filters() + { + // arrange + var query = new Dictionary { + { "filter[key]", new StringValues("value") } + }; + + _queryCollectionMock + .Setup(m => m.GetEnumerator()) + .Returns(query.GetEnumerator()); + + _controllerContextMock + .Setup(m => m.GetControllerAttribute()) + .Returns(new DisableQueryAttribute(QueryParams.Filter)); + + var queryParser = new QueryParser(_controllerContextMock.Object, new JsonApiOptions()); + + // act + var querySet = queryParser.Parse(_queryCollectionMock.Object); + + // assert + Assert.Empty(querySet.Filters); + } + + [Fact] + public void Can_Disable_Sort() + { + // arrange + var query = new Dictionary { + { "sort", new StringValues("-key") } + }; + + _queryCollectionMock + .Setup(m => m.GetEnumerator()) + .Returns(query.GetEnumerator()); + + _controllerContextMock + .Setup(m => m.GetControllerAttribute()) + .Returns(new DisableQueryAttribute(QueryParams.Sort)); + + var queryParser = new QueryParser(_controllerContextMock.Object, new JsonApiOptions()); + + // act + var querySet = queryParser.Parse(_queryCollectionMock.Object); + + // assert + Assert.Empty(querySet.SortParameters); + } + + [Fact] + public void Can_Disable_Include() + { + // arrange + var query = new Dictionary { + { "include", new StringValues("key") } + }; + + _queryCollectionMock + .Setup(m => m.GetEnumerator()) + .Returns(query.GetEnumerator()); + + _controllerContextMock + .Setup(m => m.GetControllerAttribute()) + .Returns(new DisableQueryAttribute(QueryParams.Include)); + + var queryParser = new QueryParser(_controllerContextMock.Object, new JsonApiOptions()); + + // act + var querySet = queryParser.Parse(_queryCollectionMock.Object); + + // assert + Assert.Empty(querySet.IncludedRelationships); + } + + [Fact] + public void Can_Disable_Page() + { + // arrange + var query = new Dictionary { + { "page[size]", new StringValues("1") } + }; + + _queryCollectionMock + .Setup(m => m.GetEnumerator()) + .Returns(query.GetEnumerator()); + + _controllerContextMock + .Setup(m => m.GetControllerAttribute()) + .Returns(new DisableQueryAttribute(QueryParams.Page)); + + var queryParser = new QueryParser(_controllerContextMock.Object, new JsonApiOptions()); + + // act + var querySet = queryParser.Parse(_queryCollectionMock.Object); + + // assert + Assert.Equal(0, querySet.PageQuery.PageSize); + } + + [Fact] + public void Can_Disable_Fields() + { + // arrange + var query = new Dictionary { + { "fields", new StringValues("key") } + }; + + _queryCollectionMock + .Setup(m => m.GetEnumerator()) + .Returns(query.GetEnumerator()); + + _controllerContextMock + .Setup(m => m.GetControllerAttribute()) + .Returns(new DisableQueryAttribute(QueryParams.Fields)); + + var queryParser = new QueryParser(_controllerContextMock.Object, new JsonApiOptions()); + + // act + var querySet = queryParser.Parse(_queryCollectionMock.Object); + + // assert + Assert.Empty(querySet.Fields); + } + + [Fact] + public void Can_Parse_Fields_Query() + { + // arrange + const string type = "articles"; + const string attrName = "some-field"; + const string internalAttrName = "SomeField"; + + var query = new Dictionary { { $"fields[{type}]", new StringValues(attrName) } }; + + _queryCollectionMock + .Setup(m => m.GetEnumerator()) + .Returns(query.GetEnumerator()); + + _controllerContextMock + .Setup(m => m.RequestEntity) + .Returns(new ContextEntity + { + EntityName = type, + Attributes = new List + { + new AttrAttribute(attrName) + { + InternalAttributeName = internalAttrName + } + } + }); + + var queryParser = new QueryParser(_controllerContextMock.Object, new JsonApiOptions()); + + // act + var querySet = queryParser.Parse(_queryCollectionMock.Object); + + // assert + Assert.NotEmpty(querySet.Fields); + Assert.Equal(2, querySet.Fields.Count); + Assert.Equal("Id", querySet.Fields[0]); + Assert.Equal(internalAttrName, querySet.Fields[1]); + } + + [Fact] + public void Throws_JsonApiException_If_Field_DoesNotExist() + { + // arrange + const string type = "articles"; + const string attrName = "dne"; + + var query = new Dictionary { { $"fields[{type}]", new StringValues(attrName) } }; + + _queryCollectionMock + .Setup(m => m.GetEnumerator()) + .Returns(query.GetEnumerator()); + + _controllerContextMock + .Setup(m => m.RequestEntity) + .Returns(new ContextEntity + { + EntityName = type, + Attributes = new List() + }); + + var queryParser = new QueryParser(_controllerContextMock.Object, new JsonApiOptions()); + + // act , assert + var ex = Assert.Throws(() => queryParser.Parse(_queryCollectionMock.Object)); + Assert.Equal(400, ex.GetStatusCode()); + } + + [Theory] + [InlineData("1", 1, false)] + [InlineData("abcde", 0, true)] + [InlineData("", 0, true)] + public void Can_Parse_Page_Size_Query(string value, int expectedValue, bool shouldThrow) + { + // arrange + var query = new Dictionary + { { "page[size]", new StringValues(value) } + }; + + _queryCollectionMock + .Setup(m => m.GetEnumerator()) + .Returns(query.GetEnumerator()); + + var queryParser = new QueryParser(_controllerContextMock.Object, new JsonApiOptions()); + + // act + if (shouldThrow) + { + var ex = Assert.Throws(() => queryParser.Parse(_queryCollectionMock.Object)); + Assert.Equal(400, ex.GetStatusCode()); + } + else + { + var querySet = queryParser.Parse(_queryCollectionMock.Object); + Assert.Equal(expectedValue, querySet.PageQuery.PageSize); + } + } + + [Theory] + [InlineData("1", 1, false)] + [InlineData("abcde", 0, true)] + [InlineData("", 0, true)] + public void Can_Parse_Page_Number_Query(string value, int expectedValue, bool shouldThrow) + { + // arrange + var query = new Dictionary + { { "page[number]", new StringValues(value) } + }; + + _queryCollectionMock + .Setup(m => m.GetEnumerator()) + .Returns(query.GetEnumerator()); + + var queryParser = new QueryParser(_controllerContextMock.Object, new JsonApiOptions()); + + // act + if (shouldThrow) + { + var ex = Assert.Throws(() => queryParser.Parse(_queryCollectionMock.Object)); + Assert.Equal(400, ex.GetStatusCode()); + } + else + { + var querySet = queryParser.Parse(_queryCollectionMock.Object); + Assert.Equal(expectedValue, querySet.PageQuery.PageOffset); + } + } + } +} \ No newline at end of file diff --git a/test/UnitTests/TestScopedServiceProvider.cs b/test/UnitTests/TestScopedServiceProvider.cs new file mode 100644 index 0000000000..af68e340b9 --- /dev/null +++ b/test/UnitTests/TestScopedServiceProvider.cs @@ -0,0 +1,28 @@ +using JsonApiDotNetCore.Services; +using Microsoft.AspNetCore.Http; +using Moq; +using System; + +namespace UnitTests +{ + public class TestScopedServiceProvider : IScopedServiceProvider + { + private readonly IServiceProvider _serviceProvider; + private Mock _httpContextAccessorMock = new Mock(); + + public TestScopedServiceProvider(IServiceProvider serviceProvider) + { + _serviceProvider = serviceProvider; + } + + public object GetService(Type serviceType) + { + if (serviceType == typeof(IHttpContextAccessor)) + { + return _httpContextAccessorMock.Object; + } + + return _serviceProvider.GetService(serviceType); + } + } +} diff --git a/test/UnitTests/UnitTests.csproj b/test/UnitTests/UnitTests.csproj index dcd659d2df..f8dde36f41 100644 --- a/test/UnitTests/UnitTests.csproj +++ b/test/UnitTests/UnitTests.csproj @@ -4,13 +4,14 @@ false - - + + - + + - \ No newline at end of file + diff --git a/test/UnitTests/xunit.runner.json b/test/UnitTests/xunit.runner.json new file mode 100644 index 0000000000..9db029ba52 --- /dev/null +++ b/test/UnitTests/xunit.runner.json @@ -0,0 +1,4 @@ +{ + "parallelizeAssembly": false, + "parallelizeTestCollections": false +}