示例#1
0
        public async Task <ActionResult <int> > Post([FromBody] CarViewModel carViewModel)
        {
            try
            {
                var id = await carManager.AddNewCarAsync(carViewModel);

                return(Ok(id));
            }
            catch (CarException ex)
            {
                return(BadRequest(ex.Message));
            }
        }