Skip to content

Allow people to extend the default IxxxApiClient implementations, as well as implement from scratch #206

@apawsey

Description

@apawsey

Follow up from #201

Recently you added the IxxxApiClient interfaces, to allow each client to be re-implemented as per specific requirements. However, I didn't want to have to re-implement everything you had done, just to add some extra methods.

In the case of the EF core provider, patching a document via "class" is difficult, as everything is being interrogated and built-up at runtime. I don't know which properties will have been changed, so I would need an entirely dynamic way to build the patch objects. I did consider, and attempt, using things like an expando object, but realistically the easiest way to handle it is to be able to construct the patch json directly.

Side note: I am basing the ArangoDB EF core provider on the existing cosmos provider that is currently available, and this is the approach they also follow.

Back on topic.... therefore I wanted to use all the standard functionality, but just add an additional PatchDocument method, that allowed me to pass in the pre-json'ed patch document.

With that in mind, I standardised each client class, and then provided access to the various underlying services via protected properties, and made all the operations virtual. Then I can take your default implementation and just adjust it to my requirements, rather than copying all your code just to add one method.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions