Beispiel #1
0
        public IActionResult Register([FromBody] Covers item)
        {
            // map dto to entity
            // var item = _mapper.Map<Covers>(paramDto);

            try
            {
                // save

                //item.FCreateUserId = GetNameClaim();
                item.CreatedAt = DateTime.Now;
                _itemService.Create(item);


                return(Ok(item));
            }
            catch (AppException ex)
            {
                // return error message if there was an exception
                return(DefaultError(ex.Message));
            }
        }