public async Task <ActionResult <Customer> > GetAdminById(int adminid) { AnonymousUserFacade facade = new AnonymousUserFacade(false); Administrator result = null; try { result = await Task.Run(() => facade.GetAdminById(adminid)); } catch (Exception ex) { return(StatusCode(400, $"{{ error: can't get administrator by id \"{ex.Message}\" }}")); } if (result == null) { return(StatusCode(204, "{No administrator by this id. }")); } return(Ok(result)); }