private CorsRule MapCorsRuleModel(CorsRuleModel corsRuleModel)
 {
     return(new CorsRule()
     {
         AllowedOrigins = corsRuleModel.AllowedOrigins,
         AllowedMethods = MapAllowedMethods(corsRuleModel.AllowedMethods),
         AllowedHeaders = corsRuleModel.AllowedHeaders,
         ExposedHeaders = corsRuleModel.ExposedHeaders,
         MaxAgeInSeconds = corsRuleModel.MaxAgeInSeconds
     });
 }
        public ActionResult Edit(int id, CorsRuleModel model)
        {
            if (!ModelState.IsValid)
            {
                return(View(model));
            }

            var corsRule = MapCorsRuleModel(model);

            try
            {
                _azureProvider.UpdateCorsRule(id - 1, corsRule);
            }
            catch (Exception e)
            {
                model.ExceptionMessage = e.Message;
                return(View(model));
            }

            return(RedirectToAction("Index"));
        }