Ejemplo n.º 1
0
        public async Task <IActionResult> Create([FromBody] DummyVm dummyVm)
        {
            var dummy = _mapper.Map <Dummy>(dummyVm);
            await _dummyService.Create(dummy);

            return(Ok());
        }
Ejemplo n.º 2
0
        public IActionResult Post([FromBody] CreateDummyViewModel vm)
        {
            return(ApiAction(() =>
            {
                var contract = _mapper.Map <CreateDummyContract>(vm);
                var returnContract = _dummyService.Create(contract);

                return Created("Get", _mapper.Map <CreatedDummyViewModel>(returnContract));
            }));
        }