This repository was archived by the owner on Jan 27, 2022. It is now read-only.
Added support for persisting value objects in shared collections.#4
Merged
iscottb122 merged 7 commits intomasterfrom Sep 19, 2018
Merged
Added support for persisting value objects in shared collections.#4iscottb122 merged 7 commits intomasterfrom
iscottb122 merged 7 commits intomasterfrom
Conversation
Choc13
reviewed
Sep 19, 2018
| { | ||
| if (documentCollection.PartitionKey.Paths.Any()) | ||
| { | ||
| throw new NotSupportedException("Partitioned collections not supported."); |
Contributor
There was a problem hiding this comment.
Should the error message not be: "Partitioned collections are not supported"?
| { | ||
| string valueObjectType = ValueObjectDocument<TValueObject>.GetDocumentType(); | ||
|
|
||
| ValueObjectDocument<TValueObject> document = |
Contributor
There was a problem hiding this comment.
Given this is the same as for the Create method, I think we could have a private Find method that finds the ValueObjectDocument by the TValueObject.
Contributor
There was a problem hiding this comment.
I think you could also extract:
string valueObjectType = ValueObjectDocument<TValueObject>.GetDocumentType();
ValueObjectDocument<TValueObject> document =
_documentClient.CreateDocumentQuery<ValueObjectDocument<TValueObject>>(GetUri())
.Where(x => x.Type == valueObjectType)
.AsEnumerable()
into a private method called something like CreateValueObjectDocumentQuery
| } | ||
| } | ||
|
|
||
| public sealed class Type : EntityDocumentTests |
Contributor
There was a problem hiding this comment.
This should inherit from ValueObjectDocumentTests rather than EntityDocumentTests.
Choc13
reviewed
Sep 19, 2018
| } | ||
|
|
||
| [JsonProperty(PropertyName = "id")] | ||
| public string Id { get; set; } |
Contributor
There was a problem hiding this comment.
Does this have to be mutable for it to work with DocumentDB?
Choc13
approved these changes
Sep 19, 2018
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.