예제 #1
0
        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());
        }
예제 #2
0
        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());
        }
예제 #3
0
        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());
        }