Open DuncanMillard opened 8 years ago
Bit more research: if I intercept at RequestWriter.cs @ line 333
var linkedCollectionName = _session.Metadata.GetLinkedCollectionName(
referenceLink.LinkData.GetType().Name, linkTypeWithKey.Name, out isSingleton);
and manually force linkedCollectionName to be the plural version, then the correct PATCH request is generated and the data is updated on the server.
OK - got it - the suffix "status" isn't correctly pluralised to "statuses" by the pluralizer, so the Entity Collection lookup in TryGetEntitySet fails to match:
entitySet = _model.SchemaElements
.Where(x => x.SchemaElementKind == EdmSchemaElementKind.EntityContainer)
.SelectMany(x => (x as IEdmEntityContainer).EntitySets())
.BestMatch(x => x.Name, entitySetName, _session.Pluralizer);
The above returns null instead of the assignmentstatuses entity set.
Could either add "status" to the hardcoded suffixes list, or allow a custom set of suffixes/plurals to be passed in whe constructing the ODataClientSettings instance. I'll try and get a pull request together for the latter but it won't be for a while.
I'm not sure if this is an issue with the Simple Odata Client, or with the way odata (and in particular entity pluralization) is implemented by this server app...
I'm trying to update a Navigation Link with the following code:
The odata.bind value PATCHed back uses the singular name for the linked assignmentstatus entity rather than the plural name.
So the data passed to the server is:
it should be:
If I examine the annotations for the assignmentStatus object, the ReadLink, Id and EditLink all use the plural form of the name to refer to the entity - seems it should be using this in generating the link value too?