コード例 #1
0
        public void Delete(string id)
        {
            LoggingId logId = new LoggingId(id);

            Context.Response.StatusCode = (int)HttpStatusCode.NoContent;

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

            if (site == null)
            {
                return;
            }

            var section = LoggingHelper.GetHttpLoggingSection(site, logId.Path, ManagementUnit.ResolveConfigScope());

            section.RevertToParent();

            ManagementUnit.Current.Commit();
        }
コード例 #2
0
        public async Task Delete(string id)
        {
            LoggingId logId = new LoggingId(id);

            Context.Response.StatusCode = (int)HttpStatusCode.NoContent;

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

            if (site != null)
            {
                var section = LoggingHelper.GetHttpLoggingSection(site, logId.Path, ManagementUnit.ResolveConfigScope());
                section.RevertToParent();
                ManagementUnit.Current.Commit();
            }

            if (logId.SiteId == null && (LoggingHelper.IsHttpEnabled() || LoggingHelper.IsCustomEnabled()))
            {
                await LoggingHelper.SetFeatureEnabled(false);
            }
        }