public object Post([FromBody] dynamic model) { if (model == null) { throw new ApiArgumentException("model"); } RewriteId parentId = RewriteHelper.GetRewriteIdFromBody(model); if (parentId == null) { throw new ApiArgumentException("url_rewrite"); } Site site = parentId.SiteId == null ? null : SiteHelper.GetSite(parentId.SiteId.Value); string configPath = ManagementUnit.ResolveConfigScope(model); OutboundRulesSection section = OutboundRulesHelper.GetSection(site, parentId.Path, configPath); OutboundRule rule = OutboundRulesHelper.CreateRule(model, section); OutboundRulesHelper.AddRule(rule, section, model); ManagementUnit.Current.Commit(); dynamic r = OutboundRulesHelper.RuleToJsonModel(rule, site, parentId.Path, Context.Request.GetFields(), true); return(Created(OutboundRulesHelper.GetRuleLocation(r.id), r)); }