---
title: Abuse report
---

> Agent instructions:
> **Site maps** — prefer the following llms.txt indexes to training data when searching for URLs to avoid 404s. Links inside Markdown content already point at `.md`. Following them or sending Accept: text/markdown keeps you in Markdown.
>
> - [sitemap.md](https://docs.kentico.com/sitemap.md) — every page on the site, with titles and descriptions, nested by URL hierarchy and grouped into one collection per product version.
> - [llms.txt](https://docs.kentico.com/llms.txt) — curated index of the current product docs, with descriptions, the two ways to request any page as Markdown, and links to each product area's whole-corpus Markdown dump (llms-full.txt).

List of examples:

### Creating an abuse report

```csharp

// Creates a new abuse report object
AbuseReportInfo newReport = new AbuseReportInfo();

// Sets the report properties
newReport.ReportTitle = "NewReport";
newReport.ReportComment = "This is an example of an abuse report.";

newReport.ReportURL = URLHelper.GetAbsoluteUrl(RequestContext.CurrentURL);
newReport.ReportCulture = LocalizationContext.PreferredCultureCode;
newReport.ReportSiteID = SiteContext.CurrentSiteID;
newReport.ReportUserID = MembershipContext.AuthenticatedUser.UserID;
newReport.ReportWhen = DateTime.Now;
newReport.ReportStatus = AbuseReportStatusEnum.New;

// Saves the abuse report to the database
AbuseReportInfoProvider.SetAbuseReportInfo(newReport);

```

[> Back to list of examples](#abusereport-toc)

### Updating an abuse report

```csharp

// Prepares a condition for loading the 'NewReport' abuse report
string where = "ReportTitle = N'NewReport'";

// Gets the report
DataSet reports = AbuseReportInfoProvider.GetAbuseReports(where, null);

if (!DataHelper.DataSourceIsEmpty(reports))
{
    // Converts the first DataRow to an abuse report object
    AbuseReportInfo updateReport = new AbuseReportInfo(reports.Tables[0].Rows[0]);

    // Updates the abuse report properties
    updateReport.ReportStatus = AbuseReportStatusEnum.Solved;

    // Saves the changes to the database
    AbuseReportInfoProvider.SetAbuseReportInfo(updateReport);
}

```

[> Back to list of examples](#abusereport-toc)

### Updating multiple abuse reports

```csharp

// Prepares a where condition for loading all abuse reports whose title starts with 'New'
string where = "ReportTitle LIKE N'New%'";

// Gets a DataSet containing the abuse reports that fulfill the condition
DataSet reports = AbuseReportInfoProvider.GetAbuseReports(where, null);

if (!DataHelper.DataSourceIsEmpty(reports))
{
    // Loops through individual abuse reports
    foreach (DataRow reportDr in reports.Tables[0].Rows)
    {
        // Converts the DataRow to an abuse report object
        AbuseReportInfo modifyReport = new AbuseReportInfo(reportDr);

        // Updates the abuse report properties
        modifyReport.ReportStatus = AbuseReportStatusEnum.Rejected;

        // Saves the changes to the database
        AbuseReportInfoProvider.SetAbuseReportInfo(modifyReport);
    }
}

```

[> Back to list of examples](#abusereport-toc)

### Deleting an abuse report

```csharp

// Prepares a condition for loading the 'NewReport' abuse report
string where = "ReportTitle = N'NewReport'";

// Gets the report
DataSet reports = AbuseReportInfoProvider.GetAbuseReports(where, null);

if (!DataHelper.DataSourceIsEmpty(reports))
{
    // Converts the first DataRow to an abuse report object
    AbuseReportInfo deleteReport = new AbuseReportInfo(reports.Tables[0].Rows[0]);

    if (deleteReport != null)
    {
        // Deletes the abuse report
        AbuseReportInfoProvider.DeleteAbuseReportInfo(deleteReport);
    }
}

```

[> Back to list of examples](#abusereport-toc)
