public async Task <IActionResult> AddAsync([FromBody] PhoneDto model) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } return(ReturnResult(await _phoneService.AddAsync(model))); }
public async Task <IActionResult> PostAsync([FromBody] Phone phone) { var addedPhone = await phoneService.AddAsync(phone); return(Json(addedPhone)); }