public ActionResult <string> Post([FromBody] Phone phone) { ActionResult retval = BadRequest(phone); try { if (phone != null) { phone.PhoneId = Guid.NewGuid(); if (_phoneService.AddPhone(phone)) { retval = new OkObjectResult(phone); } } } catch (Exception e) { Console.Write(e); } return(retval); }