Skip to content

Commit 82a4a80

Browse files
authored
Update README.md
1 parent cc18b49 commit 82a4a80

File tree

1 file changed

+31
-1
lines changed

1 file changed

+31
-1
lines changed

README.md

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,36 @@
11
# Dashboard for ASP.NET Core - How to customize a database schema for SQL data sources
22

3-
This example demonstrates how to customize a database schema for an SQL data source.
3+
This example shows how to provide a custom database schema for the dashboard. The example contains two implementation of the [IDBSchemaProviderEx](https://docs.devexpress.com/CoreLibraries/DevExpress.DataAccess.Sql.IDBSchemaProviderEx) interface, `MyDBSchemaProvider` and `CustomDBSchemaProvider`. Use the [DashboardConfigurator.SetDBSchemaProvider](https://docs.devexpress.com/Dashboard/DevExpress.DashboardWeb.DashboardConfigurator.SetDBSchemaProvider(DevExpress.DataAccess.Sql.IDBSchemaProviderEx)) method to assign the database schema for the Web Dashboard.
4+
5+
To see the result, add a new query or edit the existing query.
6+
7+
### The MyDBSchemaProvider class
8+
9+
File: [MyDBSchemaProvider.cs](./CS/WebDashboardAspNetCore/MyDBSchemaProvider.cs)
10+
11+
This provider displays only:
12+
13+
- Tables which names start with the letter *C*
14+
- Views which names start with *Sales*
15+
- Stored procedures with zero arguments
16+
17+
![](custom_dbschema_views.png)
18+
19+
### The CustomDBSchemaProvider class
20+
21+
File: [CustomDBSchemaProvider.cs](./CS/WebDashboardAspNetCore/CustomDBSchemaProvider.cs)
22+
23+
This provider loads only two tables (`Categories` and `Products`) for the `NWindConnectionString` connection. Both tables contain only two columns and the tables are linked by the `CategoryID` field.
24+
25+
![](custom_dbschema_tables.png)
26+
27+
This technique improves the dashboard performance, since only the specified tables are loaded to the dashboard.
28+
29+
## Files to Look At
30+
31+
* [MyDBSchemaProvider.cs](./CS/WebDashboardAspNetCore/MyDBSchemaProvider.cs)
32+
* [CustomDBSchemaProvider.cs](./CS/WebDashboardAspNetCore/CustomDBSchemaProvider.cs)
33+
* [DashboardUtils.cs](/CS/WebDashboardAspNetCore/Code/DashboardUtils.cs#L19)
434

535
## Documentation
636

0 commit comments

Comments
 (0)