Beispiel #1
0
        public async Task <int> AddOrderedBlockAsync(OrderedBlockAddDTO orderedBlockAddDTO)
        {
            var orderedBlock = _mapper.Map <OrderedBlock>(orderedBlockAddDTO);
            await _repository.AddOrderedBlockAsync(orderedBlock);

            return(orderedBlock.Id);
        }
        public async Task <IActionResult> AddOrderedBlockAsync([FromBody] OrderedBlockAddDTO orderedBlockAddDTO)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }
            var result = await _service.AddOrderedBlockAsync(orderedBlockAddDTO);

            return(Ok(result));
        }