Skip to content

Move EF core related building to extension methods #616

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 10 commits into from
Nov 6, 2019

Conversation

maurei
Copy link
Member

@maurei maurei commented Nov 5, 2019

This PR fixes the inability to use auto discovery when setting up a JADNC application with the ef-core minded AddJsonApi<TDbContext> overload. It does so by moving all EF Core related configuration to extension methods instead of them being hardcoded in the interface of JsonApiApplicationBuilder. This is also an important step towards decoupling EF core from the core of JADNC.

Inspired by https://dotnetcoretutorials.com/2017/01/24/servicecollection-extension-pattern/

@maurei maurei marked this pull request as ready for review November 6, 2019 10:48
@maurei maurei requested a review from wisepotato November 6, 2019 10:48
@maurei maurei changed the title [draft] move EF core related building to extension methods Move EF core related building to extension methods Nov 6, 2019
@maurei
Copy link
Member Author

maurei commented Nov 6, 2019

@wisepotato it seems that default interface members with internal access modifiers are not usable the way we expected it (unless you're going for explicit implementations), see https://stackoverflow.com/questions/58734707/using-static-internal-and-protected-access-modifiers-in-interfaces-c-sharp-8

Either way I've refactored the extensions methods to no longer need the internals of ResourceGraphBuilder, which works around the issue in the SO post and resolves all of your comments

@maurei maurei merged commit 3707110 into develop Nov 6, 2019
@maurei maurei deleted the feat/efcore-extension-methods branch November 6, 2019 17:21
@maurei maurei mentioned this pull request Nov 7, 2019
wisepotato pushed a commit that referenced this pull request Nov 11, 2019
* Fix/deviating dbset name (#603)

* test: expose dbset name bug

* fix: deviating dbset name

* chore: add launchSettings.json to gitignore

* chore: delete launchSettings.json from git

* Fix/pagesize (#601)

* feat: new startup for test

* chore: rename startup class

* test: reproduce #599 in test

* fix: zero division error

* chore: remove redundant DefaultPageSize on IPageService

* chore: update .gitignore

* fix: typo LoaDatabaseValues (#608)

* fix: typo

* fix: typo in fix of typo

* chore: enable sql logging in JsonApiDotNetCoreExample

* Acceptance tests EF inheritance (#610)

* chore: create inheritance model + controller

* test: create and patch acceptance test

* chore: close issue

* Improve usability RequestSerializer (#613)

* feat: remove inability to use request serializer with unknown type at runtime

* fix: typo in test setup

* chore: spacing

* fix: add IResourceQueryService and IResourceCmdService to DI container in application builder

* chore: update comments IRequestSerializer

* Move EF core related building to extension methods (#616)

* feat: remove inability to use request serializer with unknown type at runtime

* fix: typo in test setup

* chore: spacing

* fix: add IResourceQueryService and IResourceCmdService to DI container in application builder

* chore: update comments IRequestSerializer

* chore: moved ef core related building to extension methods

* chore: spacing, rename file

* refactor: remove need for internal modifier

* refactor: minor refactor id type retrieval

* Hooks discovery detection of implemented hooks issue (#617)

* fix: discovery issue related to assemblies

* fix: LoaDatabaseValue typo

* fix: set EnableResourceHooks to true by default

* chore: add comment in code in hooksdiscovery

* fix: use IServiceProvider instead of IScopedServiceProvider

* fix: discovery unit test with ServiceProvider instead of ScopedServiceProvider

* refactor: TResource instead of TEntity

* chore: process PR review

* chore: move comment to separate line (stylecop)

* feat: use camelCase as default (#618)

* feat: use camelCase as default

* refactor: massive replace all to replace kebab-case with camelCase default

* chore: fix remaining unit tests

* fix: fix  remaining JsonApiDotNetCoreExampleTests

* feat: introduce proper usage of WebApplicationFactory in KebabCaseFormatterTests

* fix: remaining functional tests

* fix: minor changes PR review

* fix: camelCase revert in comments

* fix: camelCase revert in comments

* fix: camelCase revert in comments

* fix: camelCase revert in comments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants