API/CodeSamples/CategoryCharacter.md
... ...
@@ -16,13 +16,13 @@ public class CustomAdHocConfig : Izenda.AdHoc.DatabaseAdHocConfig
16 16
// Add custom settings after setting the license key and connection string by overriding the ConfigureSettings() method
17 17
public static void InitializeReporting() {
18 18
//Check to see if we've already initialized.
19
- if (HttpContext.Current.Session == null || HttpContext.Current.Session["ReportingInitialized"] != null)
19
+ if (AdHocContext.Initialized)
20 20
return;
21 21
AdHocSettings.LicenseKey = "INSERT_LICENSE_KEY_HERE";
22 22
AdHocSettings.SqlServerConnectionString = "INSERT_CONNECTION_STRING_HERE";
23 23
Izenda.AdHoc.AdHocSettings.AdHocConfig = new CustomAdHocConfig();
24 24
AdHocSettings.CategoryCharacter = ":"; //The relevant setting
25
- HttpContext.Current.Session["ReportingInitialized"] = true;
25
+ AdHocContext.Initialized = true;
26 26
}
27 27
}
28 28
```
... ...
@@ -37,14 +37,14 @@ Public Class CustomAdHocConfig
37 37
38 38
Shared Sub InitializeReporting()
39 39
'Check to see if we've already initialized
40
- If HttpContext.Current.Session Is Nothing OrElse HttpContext.Current.Session("ReportingInitialized") IsNot Nothing Then
40
+ If AdHocContext.Initialized Then
41 41
Return
42 42
'Initialize System
43 43
AdHocSettings.LicenseKey = "INSERT_LICENSE_KEY_HERE"
44 44
AdHocSettings.SqlServerConnectionString = "INSERT_CONNECTION_STRING_HERE"
45 45
Izenda.AdHoc.AdHocSettings.AdHocConfig = New CustomAdHocConfig()
46 46
AdHocSettings.CategoryCharacter = ":" 'The relevant setting
47
- HttpContext.Current.Session("ReportingInitialized") = True
47
+ AdHocContext.Initialized = True
48 48
End Sub
49 49
End Class
50 50
```
... ...
\ No newline at end of file