Example #1
0
        public ActionResult Create(PolicyCustomer policyCustomer)
        {
            var postTask = _apiConnection.Client.PostAsJsonAsync <PolicyCustomer>("policycustomers", policyCustomer);

            postTask.Wait();
            var results = postTask.Result;

            if (results.IsSuccessStatusCode)
            {
                return(RedirectToAction(nameof(Index)));
            }

            return(View());
        }
 public ActionResult Post([FromBody] PolicyCustomer policyCustomer)
 {
     _repository.PolicyCustomer.Create(policyCustomer);
     _repository.Save();
     return(Ok());
 }