public IHttpActionResult AddEmail(Email email) { int mail; if (email == null) { return(BadRequest(Resources.EmptyEmail)); } try { mail = _emailEmailManager.AddEmail(User.GetUserId(), email); } catch (ValidationException exception) { return(BadRequest(exception.Message)); } email.Id = mail; return(Created($"{mail}", email)); }