ThatRendle/Simple.Web

Discuss: change to Input?

Closed this issue · 7 comments

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?

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;
    }
}

That looks better to me, much clearer what is going on

There are occasions where a bodyless POST or PUT are required so as long as the existing IPost & IPut are still usable.

agree with @richardhopton IPost would be nice

+1

Indeed, there would still be empty versions of every method.

Done (in 0.5 branch).