Discuss: change to Input?
Closed this issue · 7 comments
ThatRendle commented
I'm wondering if the IInput interface with an Input property might be a bit crufty, and whether having IPost, IPut and so on might be better?
ThatRendle commented
Comparative code:
Current:
public class PostThing : IPost, IInput<Thing>
{
public Status Post()
{
Save(Input);
return Status.NoContent;
}
public Thing Input { private get; set; }
}
Proposed:
public class PostThing : IPost<Thing>
{
public Status Post(Thing thing)
{
Save(thing);
return Status.NoContent;
}
}
martin308 commented
That looks better to me, much clearer what is going on
richardhopton commented
There are occasions where a bodyless POST or PUT are required so as long as the existing IPost & IPut are still usable.
squidge commented
agree with @richardhopton IPost would be nice
ToJans commented
+1
ThatRendle commented
Indeed, there would still be empty versions of every method.
ThatRendle commented
Done (in 0.5 branch).