Skip to content

Hooks #478

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 185 commits into from
Jun 17, 2019
Merged

Hooks #478

Show file tree
Hide file tree
Changes from 72 commits
Commits
Show all changes
185 commits
Select commit Hold shift + click to select a range
eed794a
feat(business-logic): added more integration with ResourceDefinition
Feb 20, 2019
9fee385
feat(business-logic): added some preliminary code
Feb 20, 2019
d7c9331
feat: added first version of logic tree traversing
Feb 25, 2019
b8e4b99
feat: added logic when retrieving information
Feb 26, 2019
128fbc4
feat: first ever working test on resourcedefinition
Mar 22, 2019
c6f94bb
chore: cleanup of unused functions, restored original usage of Includ…
maurei Apr 4, 2019
46ba26d
feat: abstracted resource definition logic into ResourceLogicExecutor…
maurei Apr 4, 2019
870cc25
feat: draft setup for "resource hooks"
maurei Apr 5, 2019
f2373da
feat: introduced ResourceHookExecutor and ResourceHookContainer abstr…
maurei Apr 5, 2019
cf294f8
feat: improved proposal resource hooks
maurei Apr 8, 2019
7f8c550
tests: hook discovery test (with implementation) and scaffolded some …
maurei Apr 9, 2019
826ee9a
feat: wired up AfterDelete and BeforeDelete, created tests for all of…
maurei Apr 9, 2019
3aa5123
chore: explanations added to classes involved in hook execution
maurei Apr 9, 2019
113610e
chore: typo in comments
maurei Apr 9, 2019
8af48d4
fix: naming rule violation
maurei Apr 9, 2019
035b674
fix: edge case
maurei Apr 9, 2019
f2d446a
fix: previous rename caused dotnet to crash
maurei Apr 9, 2019
9a64aad
feat: first version of generic tree traversing
maurei Apr 10, 2019
690aa02
feat: more performant version of traversal
maurei Apr 12, 2019
945abb4
chore: prior tests are passing again and updated implementation in se…
maurei Apr 12, 2019
87289e2
test: updated unit tests for beforecreate and aftercreate
maurei Apr 16, 2019
56d6708
test: made implementedhooks configurable
maurei Apr 16, 2019
950c976
chore: reorganised hooks test
maurei Apr 16, 2019
40ecd5e
feat: hook response validation, some more tests
maurei Apr 17, 2019
383d15d
chore: compatability with prior tests, tests reorganized
maurei Apr 17, 2019
906585e
feat: many-to-many support with identifiable jointable entity
maurei Apr 17, 2019
94608fa
feat: many-to-many support with non-identifiable jointable entities
maurei Apr 17, 2019
a3c5397
fix: sln merge conflict
maurei Apr 17, 2019
f58c3c8
feat: added support for entities datasets with populated inverse navi…
maurei Apr 19, 2019
20b7c49
test: some complex scenario tests
maurei Apr 19, 2019
d4527ef
chore: wired up service layer to hook executor
maurei Apr 19, 2019
d27fec0
fix: modelbuilder update
maurei Apr 19, 2019
9c0893e
feat: backward compatible usage of resource hooks in service layer
maurei Apr 23, 2019
2356673
feat: ability to disable resource hooks in startup configuration
maurei Apr 23, 2019
5500998
fix: fixed some internal casting issues that occured during integrati…
maurei Apr 23, 2019
62dff10
feat: breaking change (DeleteAsync) method in repository interface, c…
maurei Apr 24, 2019
3b858f1
chore: reorganized resource hook files, updated comments
maurei Apr 24, 2019
d990504
chore: rm unused class
maurei Apr 24, 2019
4965424
chore: updated tests with renamed classes, removed unused imports
maurei Apr 24, 2019
1b3bf8c
chore: minor refactor and comment update in hook executor
maurei Apr 24, 2019
fc51de0
chore: simplified tests, cleanup unused imports
maurei Apr 24, 2019
2446d86
chore: cleanup unused packages, typo in comments, whitespaces
maurei Apr 24, 2019
876529b
docs: first version usage guide hooks
maurei Apr 24, 2019
f546600
Merge branch 'master' into feat/#477
maurei Apr 25, 2019
e22e954
fix: bad mergefix
maurei Apr 25, 2019
30c1c4a
fix: adjusted order of execution hooks
maurei Apr 25, 2019
6c00d28
docs: update hooks usage
maurei Apr 25, 2019
c61ea75
chore: decoupled ResourceHookExecutor from TEntity
maurei Apr 26, 2019
d11c611
fix: failing integration test
maurei Apr 26, 2019
df6ae88
chore: rm unused interface
maurei Apr 26, 2019
409714f
chore: redundant itemgroup in csproj
maurei Apr 29, 2019
cb8a32e
test: does not fire nested hook when removing nested relationship
maurei Apr 29, 2019
c5a5b1c
test: cascade permission tests
maurei Apr 30, 2019
656c9ae
fix: firing nested hooks when setting relationship to null
maurei Apr 30, 2019
b888a88
chore: comment in test
maurei Apr 30, 2019
45b60c8
feat: first implementation with EntityDiff and HookContext
maurei May 1, 2019
861f1d9
feat: first diff and hook context implementation finished (ie compiles)
maurei May 1, 2019
5e84788
fix: compilation errors unit tests
maurei May 1, 2019
072a728
test: unit tests passing again
maurei May 1, 2019
20b0877
refactor: improvement in execution loop
maurei May 2, 2019
0000f5e
refactor: renamed internal classes involved in traversal, fixed hasma…
maurei May 2, 2019
723ea3a
feat: added correct status code
May 2, 2019
74e08d6
fix: nullcheck in service, query in no entity test: integration tests…
maurei May 2, 2019
61dd367
chore: rm rogue files
maurei May 2, 2019
bf72290
test: re-added cascade permission tests
maurei May 2, 2019
e14e931
fix: cascade delete violation error in tests
maurei May 2, 2019
8a8ec82
Merge branch 'feat/#477' of github.com:wisepotato/JsonApiDotNetCore i…
May 2, 2019
b0ed30a
chore: mv files and renamed variables
maurei May 2, 2019
3bd339b
Merge branch 'feat/#477' of https://github.com/wisepotato/JsonApiDotN…
maurei May 2, 2019
c39f968
feat: first implementation database diff in hooks
maurei May 2, 2019
05bf462
feat: database diff support implemented, about to fix broken tests
maurei May 2, 2019
e69a2f8
fix: previous tests passing again, change tracking errors remain
maurei May 2, 2019
fc4cfb6
docs: some doc cleaning + added todo
May 3, 2019
b3a7cbf
feat: refactor, implicit update draft
maurei May 3, 2019
09d6a1e
feat: further implicit update support
maurei May 6, 2019
0c70ed7
feat: simplified implementation: BeforeRead
maurei May 8, 2019
e9d5ed2
test: simplification BeforeRead
maurei May 8, 2019
f50550e
test: unit tests for simplification AfterRead
maurei May 8, 2019
b2ec87d
feat: simplifications AfterRead
maurei May 8, 2019
b695aa9
feat: unit, integration tests and hook implementation for simplified …
maurei May 8, 2019
30e713b
Merge branch 'feat/#477' of https://github.com/wisepotato/JsonApiDotN…
maurei May 8, 2019
c6007ad
feat: simplified interface BeforeUpdate
maurei May 8, 2019
5e5ba6f
test: unit tests BeforeUpdate
maurei May 8, 2019
8b08443
feat: BeforeUpdate - further update interface and unit tests
maurei May 8, 2019
b73093c
feat: added identifiableComparer
May 8, 2019
cf792d4
Merge branch 'feat/#477' of github.com:wisepotato/JsonApiDotNetCore i…
May 8, 2019
caea445
Merge branch 'feat/#477' of https://github.com/wisepotato/JsonApiDotN…
maurei May 8, 2019
5884058
feat: equality comparer hotfix
maurei May 8, 2019
bda613b
feat: simplified BeforeUpdate without edgecases
maurei May 8, 2019
c2604ad
feat: beforeupdate with implicit support
maurei May 10, 2019
4a0d72d
feat: support implicit delete
maurei May 13, 2019
c4c6f22
feat: implicit principal support
maurei May 13, 2019
b73b5a8
test: implicit principal support
maurei May 13, 2019
7267a76
test: implicit affected tests, principal and dependent
maurei May 13, 2019
518f9d0
feat: reorganised after hooks interface
maurei May 14, 2019
12fb3e7
chore: minor adjustments
maurei May 14, 2019
4e77c9b
feat: added principal and dependent type to Relationship attribute
maurei May 14, 2019
7ea03d8
feat: inverse relationship resolver
maurei May 14, 2019
84c27b7
comment: InverseRelationshipResolver
maurei May 14, 2019
2838443
feat: updated interface
maurei May 14, 2019
86e7055
test: unit tests passing resource hooks
maurei May 15, 2019
d3aec2d
test: integration tests
maurei May 15, 2019
34d67f7
feat: validate hook response for GetSingle
maurei May 15, 2019
36754a7
chore: rm unused properties, spacing
maurei May 15, 2019
876b839
fix: load db values for guid models
maurei May 15, 2019
8f29b60
test: added missing implicit tests
maurei May 15, 2019
9379d2f
fix: wrong pipeline in after read
maurei May 15, 2019
4190368
feat: after update, after create
maurei May 15, 2019
1d3a947
feat: get relationship behaves different in OnReturn
maurei May 15, 2019
7888704
fix: hooks for cyclic relations and self multiple relations to same type
maurei May 15, 2019
57fdb8c
refactor: traversal
maurei May 15, 2019
07b0348
chore: spacing
maurei May 15, 2019
68b6fcb
feat: RootNode<TEntity> draft
maurei May 15, 2019
2c6f751
feat: hotfix for #507
May 16, 2019
6441e1a
refactor: clean up
maurei May 17, 2019
6a0cc58
refactor: hooks namespace
maurei May 17, 2019
f21862c
Merge branch 'feat/#477' of https://github.com/wisepotato/JsonApiDotN…
maurei May 17, 2019
34a138b
fix: db values not properly provided to hook
maurei May 17, 2019
b6af596
refactor: cast extension
maurei May 17, 2019
c693539
refactor: reorganised files
maurei May 17, 2019
cd26e13
refactor: rename attr
maurei May 17, 2019
ad89db9
chore: rename files
maurei May 17, 2019
eb41cfe
refactor: get hook helper
maurei May 17, 2019
039e1b0
refactor: changed isRelated -> isIncluded for legibility
May 17, 2019
35bb793
comments: documentation
maurei May 17, 2019
e27eeb7
Merge branch 'feat/#477' of https://github.com/wisepotato/JsonApiDotN…
maurei May 17, 2019
d81350c
fix: spelling of 'instead'
May 17, 2019
bee21d7
comments: documentation
maurei May 17, 2019
912bc2c
feat: entity diff includes relationshiphelper
maurei May 22, 2019
b64feac
comments: documentation in code
maurei May 22, 2019
ab1f96d
comments: IHookExecutorHelper
maurei May 22, 2019
4a6e2e3
documentation: usage guide
maurei May 24, 2019
d7b5b55
documentation: finish
maurei May 27, 2019
08917c7
documentation: usage guide update
maurei May 27, 2019
71b3bd0
Update hooks.md
maurei May 27, 2019
67ddff6
Update hooks.md
maurei May 27, 2019
446dad3
fix: processed milous comments
maurei May 27, 2019
7a737aa
fix: merge
maurei May 27, 2019
0b1a40f
fix: wiring up resource definition to other repository constructors
maurei May 27, 2019
86e11d4
feat: #500
maurei May 27, 2019
5a141cf
fix: milou comments
maurei May 27, 2019
553bf3e
fix: ambiguous constructor
maurei May 27, 2019
37edd26
fix: ambiguous constructor
maurei May 27, 2019
38cbed1
fix: downgrading test sdk for compatiblity with unix, see https://git…
maurei May 27, 2019
d22f417
fix: repo context issue
maurei May 27, 2019
f66f894
comment: update
maurei May 27, 2019
1ecab38
refactor: rename pipeline enum members
maurei May 27, 2019
b5a27c4
refactor: renamed some internals, and added id to mapped out entity i…
maurei May 28, 2019
d089461
test: inheritance
maurei May 28, 2019
d7e71d8
fix: dont include when IsInclude is false
maurei May 28, 2019
d84f30f
feat: AuthResourceBase with default hook implementation
maurei May 28, 2019
c284ed9
chore: rename member
maurei May 29, 2019
0a3605d
documentation: hooks
maurei May 30, 2019
b4777b4
docs: update hooks
maurei May 31, 2019
a8e3525
docs: update hooks guide
maurei May 31, 2019
30f6e65
docs: fix typo hooks"
maurei May 31, 2019
e924833
chore: default value option
maurei Jun 4, 2019
50d34b0
fix: default option loaddbvalues
maurei Jun 4, 2019
0f385f1
y
maurei Jun 4, 2019
762210e
tests: DRCU update tests
maurei Jun 4, 2019
bcf2dbc
chore: rm forgotten line
maurei Jun 5, 2019
61c2e93
fix: removed usage of guid-based repositories
maurei Jun 5, 2019
c70dea4
documentation: enumeration change
maurei Jun 5, 2019
e184e7f
documentation: typo
maurei Jun 5, 2019
61dc5d5
fix: remove unused code
maurei Jun 5, 2019
50167e0
documentation: improve advanced auth example
maurei Jun 5, 2019
61634f1
fix: reverted change of 2c6f751
maurei Jun 5, 2019
a1f5d12
feat: more structual ctors EntityResourceService
maurei Jun 5, 2019
b8df749
feat: improved loaddbvalues attribute error handling, refactored a bit
maurei Jun 5, 2019
29abae0
refactor: renamed AffectedRelationships
maurei Jun 5, 2019
8fc015a
feat: throw error if trying to access databasevalues when loading is …
maurei Jun 5, 2019
59a9359
feat: IAffectedResource, IEntityDiff, IAffectedRelationships have upg…
maurei Jun 6, 2019
6a7c8d1
documentation: upgrade
maurei Jun 6, 2019
e9d553f
fix: merge
maurei Jun 6, 2019
d6d4a61
refactor: rename entitydiff to resourcediff
maurei Jun 6, 2019
ad85758
fix: traversal bug related to parsing next layer relationships when l…
maurei Jun 6, 2019
5cd07d5
fix: added backward compatability relationship attr equality check
maurei Jun 6, 2019
de82fee
fix: merge
maurei Jun 11, 2019
db5bf23
fix: merge
maurei Jun 11, 2019
0290ae4
fix: separation and merge
maurei Jun 11, 2019
86dfd8d
refactor: AffectedResourcesDiff
maurei Jun 11, 2019
5ab6407
fix: inverse loading without inverse relationship attribute
maurei Jun 11, 2019
1705bef
Merge branch 'fix/reattachment' into feat/#477
maurei Jun 12, 2019
57a7971
fix: merge
maurei Jun 17, 2019
6ccb1bb
fix: merge
maurei Jun 17, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions JsonApiDotnetCore.sln
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27130.2010
# Visual Studio Version 16
VisualStudioVersion = 16.0.28606.126
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "JsonApiDotNetCore", "src\JsonApiDotNetCore\JsonApiDotNetCore.csproj", "{C0EC9E70-EB2E-436F-9D94-FA16FA774123}"
EndProject
Expand Down Expand Up @@ -41,13 +41,13 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OperationsExample", "src\Ex
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OperationsExampleTests", "test\OperationsExampleTests\OperationsExampleTests.csproj", "{9CD2C116-D133-4FE4-97DA-A9FEAFF045F1}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ResourceEntitySeparationExample", "src\Examples\ResourceEntitySeparationExample\ResourceEntitySeparationExample.csproj", "{F4097194-9415-418A-AB4E-315C5D5466AF}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ResourceEntitySeparationExample", "src\Examples\ResourceEntitySeparationExample\ResourceEntitySeparationExample.csproj", "{F4097194-9415-418A-AB4E-315C5D5466AF}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ResourceEntitySeparationExampleTests", "test\ResourceEntitySeparationExampleTests\ResourceEntitySeparationExampleTests.csproj", "{6DFA30D7-1679-4333-9779-6FB678E48EF5}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ResourceEntitySeparationExampleTests", "test\ResourceEntitySeparationExampleTests\ResourceEntitySeparationExampleTests.csproj", "{6DFA30D7-1679-4333-9779-6FB678E48EF5}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GettingStarted", "src\Examples\GettingStarted\GettingStarted.csproj", "{DF9BFD82-D937-4907-B0B4-64670417115F}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GettingStarted", "src\Examples\GettingStarted\GettingStarted.csproj", "{DF9BFD82-D937-4907-B0B4-64670417115F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DiscoveryTests", "test\DiscoveryTests\DiscoveryTests.csproj", "{09C0C8D8-B721-4955-8889-55CB149C3B5C}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DiscoveryTests", "test\DiscoveryTests\DiscoveryTests.csproj", "{09C0C8D8-B721-4955-8889-55CB149C3B5C}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down Expand Up @@ -204,6 +204,7 @@ Global
{09C0C8D8-B721-4955-8889-55CB149C3B5C}.Release|x86.ActiveCfg = Release|Any CPU
{09C0C8D8-B721-4955-8889-55CB149C3B5C}.Release|x86.Build.0 = Release|Any CPU
{DF9BFD82-D937-4907-B0B4-64670417115F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DF9BFD82-D937-4907-B0B4-64670417115F}.Debug|Any CPU.Build.0 = Debug|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
7 changes: 1 addition & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,7 @@ Running tests locally requires access to a postgresql database.
If you have docker installed, this can be propped up via:

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

And then to run the tests:
Expand Down
4 changes: 2 additions & 2 deletions docs/usage/extensibility/services.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ public class TodoItemService : EntityResourceService<TodoItem>

public TodoItemService(
IJsonApiContext jsonApiContext,
IEntityRepository<T, TId> repository,
IEntityRepository<TodoItem, int> repository,
ILoggerFactory loggerFactory,
INotificationService notificationService)
: base(jsonApiContext, repository, loggerFactory)
{
_notificationService = notificationService;
}

public override async Task<TEntity> CreateAsync(TEntity entity)
public override async Task<TodoItem> CreateAsync(TodoItem entity)
{
// call the base implementation which uses Entity Framework
var newEntity = await base.CreateAsync(entity);
Expand Down
Loading