Skip to content

Feature/request meta #61

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 12 commits into from
Mar 17, 2017
Merged

Feature/request meta #61

merged 12 commits into from
Mar 17, 2017

Conversation

jaredcnance
Copy link
Contributor

Closes #56

@@ -57,7 +57,7 @@ public RepositoryOverrideTests(DocsFixture<Startup, JsonDocWriter> fixture)
// act
var response = await client.SendAsync(request);
var responseBody = await response.Content.ReadAsStringAsync();
var deserializedBody = JsonApiDeSerializer.DeserializeList<TodoItem>(responseBody, jsonApiContext, _fixture.GetService<AppDbContext>());
var deserializedBody = _fixture.GetService<IJsonApiDeSerializer>().DeserializeList<TodoItem>(responseBody);

Copy link
Contributor Author

@jaredcnance jaredcnance Mar 17, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only "breaking" changes here are Serialization/DeSerialization APIs. I would consider this a breaking change because it may be used in tests. This is a much needed change that helps to de-couple concrete types.

I implemented it in this PR because allowing an IRequestMeta service to be injected and used by the DocumentBuilder would require an extra call to HttpContext.RequestServices.GetService<TService>().

These changes reduce the number of times we have to go back to the container. We now define 3 distinct composition roots from which all services resolve:

  • JsonApiInputFormatter
  • JsonApiController
  • JsonApiOutputFormatter

@jaredcnance jaredcnance merged commit 7a95169 into develop Mar 17, 2017
@jaredcnance jaredcnance deleted the feature/request-meta branch March 17, 2017 13:45
@jaredcnance jaredcnance restored the feature/request-meta branch March 17, 2017 13:45
@jaredcnance jaredcnance deleted the feature/request-meta branch March 17, 2017 13:46
@jaredcnance jaredcnance mentioned this pull request Mar 21, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

1 participant