Closed gregsochanik closed 10 years ago
I had a closer look at it, seems fine to me.
Style - how to chose between the form used here
public IEnumerable<IFoo> GetFoos()
{
yield return new FooOne();
yield return new FooTwo();
}
and the more traditional
public IEnumerable<IFoo> GetFoos()
{
return new List<IFoo>
{
new FooOne(),
new FooTwo()
}
}
Mater of taste I suppose?
In order to do this I had to invert a switch statement that selected which
RequestHandler
to use based on the current request Method, so now theRequestCoordinator
ctor signature has changed to take anIEnumerable<RequestHandler>
. (https://github.com/gregsochanik/SevenDigital.Api.Wrapper/compare/crenna-oauth?expand=1#diff-80302ed9266f92bd2e22a9a34809bb66R25)This may cause a breaking change to the way you instantiate an instance of
FluentApi
, but if you're using a decent IoC framework you shouldn't have a problem.I've included a static
RequestHandlerFactory
that sets up the concreteGetRequestHandler
andPostRequestHandler
s for now.This work is necessary not only for making replacing the OAuth code with the http://www.nuget.org/packages/OAuth/ library, but also in order to support requesting the Api with non GET and POST verbs in the future.
The Locker Test changes are to a dummy locker I created with a Token and Secret that I haven't committed. It checks for the existance of the TEST CONTENT dummy release.