public object Get(string id)
        {
            AnonAuthId authId = new AnonAuthId(id);

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

            return(AnonymousAuthenticationHelper.ToJsonModel(site, authId.Path));
        }
        public object Get()
        {
            // Check if the scope of the request is for site or application
            Site   site = ApplicationHelper.ResolveSite();
            string path = ApplicationHelper.ResolvePath();

            return(AnonymousAuthenticationHelper.ToJsonModel(site, path));
        }
        public object Patch(string id, [FromBody] dynamic model)
        {
            AnonAuthId authId = new AnonAuthId(id);

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

            // Targetting section for a site, but unable to find that site
            if (authId.SiteId != null && site == null)
            {
                return(NotFound());
            }

            string configPath = model == null ? null : ManagementUnit.ResolveConfigScope(model);

            AnonymousAuthenticationHelper.UpdateSettings(model, site, authId.Path, configPath);

            ManagementUnit.Current.Commit();

            return(AnonymousAuthenticationHelper.ToJsonModel(site, authId.Path));
        }