public IHttpActionResult Post([FromBody] BlockModel blockModel) { var result = PerformAction <CreateBlock, Block>(new CreateBlock(blockModel.ToEntity())); return(new ActionResultToCreatedHttpActionResult <Block, BlockModel>(result, x => x.ToModel(), this) .Do()); }
public IHttpActionResult Put(int id, [FromBody] BlockModel model) { model.Id = id; var result = PerformAction <UpdateBlock, Block>(new UpdateBlock(model.ToEntity())); return(new ActionResultToOkHttpActionResult <Block, BlockModel>(result, x => x.ToModel(), this) .Do()); }
public IHttpActionResult Post(int id) { var blockModel = new BlockModel(id); var result = PerformAction <CreateNextBlock, Block>(new CreateNextBlock(blockModel.ToEntity())); return(new ActionResultToCreatedHttpActionResult <Block, BlockModel>(result, x => x.ToModel(), this) .Do()); }