RedditSharp-DEPRECATED-
RedditSharp-DEPRECATED- copied to clipboard
Change anything requiring additional web requests to be a method instead of a property
Historically things have been pulled via Properties on an object like Subreddit.Moderators
. Changing everything over to async, this doesn't always work the best as it can't actually call an async method in the getter of a property. You can get around this by calling Task.Run()
, but you lose performance benefits from async if I am understanding everything correctly.
Thoughts on how this should be designed going forward? 2.0 is going to break enough stuff that we can safely redesign it however we want most likely.
properties on objects that are filled at the creation of the object are fine, but otherwise it just looks nicer in the code as a property, but having a method to retrieve it asyncronously if wanted could be done just fine
I'm leaning towards anything that comes as data with the actual json should be a property. Anything that fires an additional web request should be a method.
I like that idea.
Properties shouldn't be that complex anyway.
Is this what we've decided on, then? Properties requiring another web call are getting moved to Methods?
Yes i think that's the best way to handle it
On Jan 18, 2017 5:14 PM, "Andrew" [email protected] wrote:
Is this what we've decided on, then? Properties requiring another web call are getting moved to Methods?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/CrustyJew/RedditSharp/issues/40#issuecomment-273632596, or mute the thread https://github.com/notifications/unsubscribe-auth/AHDuEN5m1zcah00y3nS-U7pRDgKqN6UFks5rTpzwgaJpZM4LREtk .