Nikey646 / VndbSharp

A C# Vndb API Library. #OriginalNamingScheme
MIT License
18 stars 4 forks source link

More examples on using IRequestOptions #18

Closed micah686 closed 4 years ago

micah686 commented 7 years ago

Could you put some examples on using the IRequestOptions on the program.cs? I'm trying to do a reverse sort by ID, but it's a little unclear of how to add the specific request options (or it may just be my inexperience).

If you could some examples, that would be much appreciated.

Nikey646 commented 7 years ago

You just need a class that implements IRequestOptions (One isn't provided) with all the properties implemented, then set the IRequestOptions.Reverse property to true and pass that in with the request. For more information about what each property does, the Vndb API Documentation can do that better than i could.

Do note, that if you want to use the IRequestOptions.Count property, it needs to be decorated with a [JsonProperty("results")] attribute, due to a different name.

Nikey646 commented 4 years ago

A default RequestOptions class now exists. Added in #64 thanks to @micah686!