-
Notifications
You must be signed in to change notification settings - Fork 177
Home
Christian Del Bianco edited this page Jan 22, 2020
·
40 revisions
Here are some examples of application getting notification on record table change. After download the example, please remember to update SqlTableDependency NuGet package:
- Monitor table change with Blazor: This example uses .NET CORE 3.0 Blazor (server side) to create a single page application that makes real-time update of its content on database record changes.
- Monitor table change with WPF and WCF: This example show how to keep up to date a grid containing some stocks data. That grid has been automatically updated whenever a record change using database notifications. This notification contains new values for the modified table record.
- Monitor table change with MVC, SignalR and jQuery: This example show how to keep up to date a table containing some stocks data. That table has been automatically updated whenever a record change using database notifications. This notification contains new values for the modified table record.
- Monitor table change with MVC, SignalR and Knockout JS: This example show how to refresh client web browsers used to book flight tickets. Those terminals have to be update as soon as the availability change and the Web application must take the initiative of sending this information to clients instead of waiting for the client to request it.
David Green reported me that he was able to make SqlTableDependency works on databases that were created before SQL 2008 R2 by running the following command:
ALTER AUTHORIZATION ON DATABASE::(database name here) TO sa;
Unfortunately, because i do not have any SQL server instance lower then < 2008 R2, was not possible for me to test.
This section reports some use cases examples:
- Model and properties with same name of table and columns.
- Code First Data Annotations to map model with database table.
- Explicit database table name.
- Custom map between model property and table column using ModelToTableMapper.
- Specify for which properties we want receive notification using UpdateOfModel mapper.
- Filter notification by change type.
- Get Errors.
- Logging.
- Get Status.
- Apply filter based on WHERE condition.
- Include old values.