示例#1
0
        public async Task <IActionResult> AddAsync([FromBody] PhoneDto model)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            return(ReturnResult(await _phoneService.AddAsync(model)));
        }
示例#2
0
        public async Task <IActionResult> PostAsync([FromBody] Phone phone)
        {
            var addedPhone = await phoneService.AddAsync(phone);

            return(Json(addedPhone));
        }