Beispiel #1
0
        public async Task <ActionResult> Post([FromBody] CarModelDto carModelDto)
        {
            try
            {
                if (carModelDto == null)
                {
                    return(BadRequest($"{nameof(carModelDto)} can not not be null!"));
                }
                await _carModelService.AddAsync(carModelDto);

                return(Ok());
            }
            catch (Exception e)
            {
                return(BadRequest(e));
            }
        }