So, I searched all morning, but could not find a satisfactory answer
I am trying to write a general method (service) that takes an object as input (maybe a JObject or Document or dynamic) and requests a collection for the properties of the object.
Example - if you send {"name": "abc"}, I will look for name = "abc" in any of the documents. if you send {"name": "abc", "department": "xyz"}, it searches in both fields.
Question. What should be the best input for the method? Options - 1. public bool Exists (Document doc) // Suppose I already have a Collection.Selflink class. I can't seem to iterate over the properties of a doc object.
- public bool Exists (JObject obj) I will need to go through obj and prepare the request myself.
Is there an easier way to just see if a document matches any of the documents in the collection. I'm just interested in matching the fields that are contained in the document.
Thanks in advance!
source share