Skip to content

[WIP] v2.2.0 Operations #229

New issue

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

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

Already on GitHub? Sign in to your account

Merged
merged 39 commits into from
Mar 7, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
2341ac4
feat(models): initial operation models
jaredcnance Aug 10, 2017
5a2f49a
feat(pointers): first pass at OperationsPointer
jaredcnance Aug 10, 2017
9464d68
feat(pointers): wrap up OperationsPointers and tests
jaredcnance Aug 11, 2017
24e7a99
feat(pointers): finish pointer modeling and eval
jaredcnance Aug 25, 2017
d64709e
first pass at pointer replacement and service location
jaredcnance Aug 25, 2017
8d10016
chore(pointers): move classes into separate files
jaredcnance Aug 26, 2017
ac57c75
feat(RelationshipData): expose IsHasMany property
jaredcnance Aug 26, 2017
d3c3493
test(OperationsProcessor): performs pointer substitution
jaredcnance Aug 26, 2017
4518cb6
style(*): naming conventions and namespacr cleanup
jaredcnance Aug 26, 2017
c997fac
style(processors): create namespace for individual processors
jaredcnance Aug 26, 2017
a34ef20
test(CreateOpProcessor): test and implement the create op processor
jaredcnance Aug 27, 2017
8e6a240
feat(content-negotiation): wire up reader and input formatter
jaredcnance Aug 27, 2017
6dca5c0
feat(reader): deserialize operations document
jaredcnance Aug 27, 2017
00cbc04
feat(*): add controller, input formatter, and services
jaredcnance Aug 29, 2017
bbc4dea
feat(examples): add operations example
jaredcnance Aug 29, 2017
5f3370e
fix(controller): use HTTP PATCH
jaredcnance Sep 12, 2017
c0e4e6c
fix(inputFormatters): needed FromBody param attribute
jaredcnance Sep 13, 2017
a66534b
chore(*): replace Any with Count
jaredcnance Sep 15, 2017
2a3cdc4
fix(CreateOpProcessor): issues around service location
jaredcnance Sep 15, 2017
5c55973
fix(DocumentBuilder): duplicate included entities
jaredcnance Sep 15, 2017
f54dc4a
test(add): integration tests add articles
jaredcnance Sep 27, 2017
ee5b34a
feat(fetch): add get all operation
jaredcnance Sep 27, 2017
0f99794
feat(fetch): get by id operation
jaredcnance Sep 27, 2017
69323c6
replace operations
jaredcnance Oct 23, 2017
7471aa5
remove operations
jaredcnance Oct 23, 2017
7e438bf
wrap operations in EF transaction
jaredcnance Oct 23, 2017
2d5f203
chore(*): bump project version and document usage
jaredcnance Oct 24, 2017
da46203
fix tests
jaredcnance Oct 24, 2017
8b54eca
chore(csproj): bump package version
jaredcnance Nov 13, 2017
72388aa
Merge branch 'master' into develop
jaredcnance Feb 18, 2018
bd462e3
fix build issues and consolidate props definitions
jaredcnance Feb 18, 2018
e78a3f3
fix tests
jaredcnance Feb 18, 2018
3447bae
feat(operations): remove JSON pointers from previous spec draft
jaredcnance Feb 18, 2018
820b2dc
breaking(Document): introduce RO and RIO from spec
jaredcnance Feb 18, 2018
6ff299c
fix standad tests
jaredcnance Feb 18, 2018
6fd2f29
fix(deserialization): deserialize operations document
jaredcnance Mar 1, 2018
31a1e8b
test(operations): use dbcontext resolver
jaredcnance Mar 1, 2018
770aea8
use local ids instead of JsonPointers
jaredcnance Mar 1, 2018
92aa732
replace ref.lid with results ids
jaredcnance Mar 2, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
2 changes: 1 addition & 1 deletion .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@
"problemMatcher": "$msCompile"
}
]
}
}
20 changes: 13 additions & 7 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,26 +1,32 @@
<Project>

<PropertyGroup>
<NetCoreAppVersion>netcoreapp2.0</NetCoreAppVersion>
<NetStandardVersion>netstandard2.0</NetStandardVersion>

<AspNetCoreVersion>2.0.1</AspNetCoreVersion>
<EFCoreVersion>2.0.1</EFCoreVersion>

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


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

<NpgsqlVersion>3.2.6</NpgsqlVersion>
<NpgsqlPostgreSQLVersion>2.0.0</NpgsqlPostgreSQLVersion>

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

<!-- Test Project Dependencies -->
<PropertyGroup>
<NetCoreAppVersion>netcoreapp2.0</NetCoreAppVersion>
<MicrosoftOptionsVersion>2.0.0</MicrosoftOptionsVersion>
<NpgsqlPostgreSQLVersion>2.0.0</NpgsqlPostgreSQLVersion>
<NpgsqlVersion>3.2.6</NpgsqlVersion>
<EFCoreToolsVersion>2.0.1</EFCoreToolsVersion>
<TestSdkVersion>15.3.0-preview-20170427-09</TestSdkVersion>
<TestHostVersion>1.1.2</TestHostVersion>
<XUnitVersion>2.3.0-beta3-build3705</XUnitVersion>
<BogusVersion>15.0.3</BogusVersion>
<MoqVersion>4.7.99</MoqVersion>
</PropertyGroup>

</Project>
</Project>
38 changes: 34 additions & 4 deletions JsonApiDotnetCore.sln
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "benchmarks", "benchmarks",
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Benchmarks", "benchmarks\Benchmarks.csproj", "{1F604666-BB0F-413E-922D-9D37C6073285}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OperationsExample", "src\Examples\OperationsExample\OperationsExample.csproj", "{CF2C1EB6-8449-4B35-B8C7-F43D6D90632D}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OperationsExampleTests", "test\OperationsExampleTests\OperationsExampleTests.csproj", "{9CD2C116-D133-4FE4-97DA-A9FEAFF045F1}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -110,10 +114,34 @@ Global
{FBFB0B0B-EA86-4B41-AB2A-E0249F70C86D}.Debug|x86.Build.0 = Debug|Any CPU
{FBFB0B0B-EA86-4B41-AB2A-E0249F70C86D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FBFB0B0B-EA86-4B41-AB2A-E0249F70C86D}.Release|Any CPU.Build.0 = Release|Any CPU
{FBFB0B0B-EA86-4B41-AB2A-E0249F70C86D}.Release|x64.ActiveCfg = Release|Any CPU
{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
{FBFB0B0B-EA86-4B41-AB2A-E0249F70C86D}.Release|x64.ActiveCfg = Release|x64
{FBFB0B0B-EA86-4B41-AB2A-E0249F70C86D}.Release|x64.Build.0 = Release|x64
{FBFB0B0B-EA86-4B41-AB2A-E0249F70C86D}.Release|x86.ActiveCfg = Release|x86
{FBFB0B0B-EA86-4B41-AB2A-E0249F70C86D}.Release|x86.Build.0 = Release|x86
{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|x64
{CF2C1EB6-8449-4B35-B8C7-F43D6D90632D}.Debug|x64.Build.0 = Debug|x64
{CF2C1EB6-8449-4B35-B8C7-F43D6D90632D}.Debug|x86.ActiveCfg = Debug|x86
{CF2C1EB6-8449-4B35-B8C7-F43D6D90632D}.Debug|x86.Build.0 = Debug|x86
{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|x64
{CF2C1EB6-8449-4B35-B8C7-F43D6D90632D}.Release|x64.Build.0 = Release|x64
{CF2C1EB6-8449-4B35-B8C7-F43D6D90632D}.Release|x86.ActiveCfg = Release|x86
{CF2C1EB6-8449-4B35-B8C7-F43D6D90632D}.Release|x86.Build.0 = Release|x86
{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|x64
{9CD2C116-D133-4FE4-97DA-A9FEAFF045F1}.Debug|x64.Build.0 = Debug|x64
{9CD2C116-D133-4FE4-97DA-A9FEAFF045F1}.Debug|x86.ActiveCfg = Debug|x86
{9CD2C116-D133-4FE4-97DA-A9FEAFF045F1}.Debug|x86.Build.0 = Debug|x86
{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|x64
{9CD2C116-D133-4FE4-97DA-A9FEAFF045F1}.Release|x64.Build.0 = Release|x64
{9CD2C116-D133-4FE4-97DA-A9FEAFF045F1}.Release|x86.ActiveCfg = Release|x86
{9CD2C116-D133-4FE4-97DA-A9FEAFF045F1}.Release|x86.Build.0 = Release|x86
{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
Expand All @@ -139,6 +167,8 @@ Global
{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}
{CF2C1EB6-8449-4B35-B8C7-F43D6D90632D} = {026FBC6C-AF76-4568-9B87-EC73457899FD}
{9CD2C116-D133-4FE4-97DA-A9FEAFF045F1} = {24B15015-62E5-42E1-9BA0-ECE6BE7AA15F}
{1F604666-BB0F-413E-922D-9D37C6073285} = {076E1AE4-FD25-4684-B826-CAAE37FEA0AA}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
Expand Down
1 change: 0 additions & 1 deletion benchmarks/Benchmarks.csproj
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\build\dependencies.props" />
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>$(NetCoreAppVersion)</TargetFramework>
Expand Down
11 changes: 0 additions & 11 deletions build/dependencies.props

This file was deleted.

33 changes: 33 additions & 0 deletions docs/Operations.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
currentMenu: operations
---

# Operations

Operations is currently an unofficial proposal. It allows you to perform bulk operations in a single transaction.

### Enabling

To enable the operations extension, modify you `Startup.ConfigureServices` method:

```csharp
services.AddJsonApi<AppDbContext>(opt => opt.EnableExtension(JsonApiExtension.Operations));
```

### Controllers

To create a bulk operations controller, inherit `JsonApiOperationsController`:

```csharp
[Route("api/bulk")]
public class OperationsController : JsonApiOperationsController
{
public OperationsController(IOperationsProcessor processor)
: base(processor)
{ }
}
```

### Example

There is a working example in the `/src/examples/OperationsExample` directory of the repository.
2 changes: 1 addition & 1 deletion docs/Usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ public void Configure(
AppDbContext context)
{
context.Database.EnsureCreated();
if(context.People.Any() == false)
if(context.People.Count == 0)
{
context.People.Add(new Person {
Name = "John Doe"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<Import Project="..\..\..\build\dependencies.props" />
<PropertyGroup>
<TargetFramework>$(NetCoreAppVersion)</TargetFramework>
<PreserveCompilationContext>true</PreserveCompilationContext>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<Import Project="..\..\..\build\dependencies.props" />
<PropertyGroup>
<TargetFramework>$(NetCoreAppVersion)</TargetFramework>
</PropertyGroup>
Expand Down
Loading