コード例 #1
0
        public object Patch(string id, [FromBody] dynamic model)
        {
            HandlersId handlersId = new HandlersId(id);

            Site site = handlersId.SiteId == null ? null : SiteHelper.GetSite(handlersId.SiteId.Value);

            if (handlersId.SiteId != null && site == null)
            {
                return(NotFound());
            }

            if (model == null)
            {
                throw new ApiArgumentException("model");
            }

            // Check for config_scope
            string          configPath = model == null ? null : ManagementUnit.ResolveConfigScope(model);;
            HandlersSection section    = HandlersHelper.GetHandlersSection(site, handlersId.Path, configPath);

            HandlersHelper.UpdateFeatureSettings(model, section);

            ManagementUnit.Current.Commit();

            return(HandlersHelper.ToJsonModel(site, handlersId.Path));
        }
コード例 #2
0
        public object Get(string id)
        {
            HandlersId handlersId = new HandlersId(id);

            Site site = handlersId.SiteId == null ? null : SiteHelper.GetSite(handlersId.SiteId.Value);

            if (handlersId.SiteId != null && site == null)
            {
                return(NotFound());
            }

            return(HandlersHelper.ToJsonModel(site, handlersId.Path));
        }
コード例 #3
0
        public object Get()
        {
            Site   site = ApplicationHelper.ResolveSite();
            string path = ApplicationHelper.ResolvePath();

            if (path == null)
            {
                return(NotFound());
            }

            dynamic d = HandlersHelper.ToJsonModel(site, path);

            return(LocationChanged(HandlersHelper.GetLocation(d.id), d));
        }