SqlDependency vs SqlCacheDependency

前端 未结 1 472
广开言路
广开言路 2021-02-15 23:12

What are the key differences between these and when should they be used? My initial understanding was that SqlCacheDependency used polling but I\'ve read it doesn\'t have too fo

1条回答
  •  清酒与你
    2021-02-16 00:02

    Query Notification is the underlying technology. SqlNotificationRequest is the ADO.Net client support. SqlDependency is the ADO.Net infrastructure to automate the deployment of temporary objects needed by SqlNotificationRequest. SqlCacheDependency uses SqlDependency to integrate it with the ASP caching infrastructure. See more at The Mysterious Notification.

    Note on them work with LINQ. See LinqToCache for a project that leverages Query Notifications with LINQ queries, and also explains why the vast majority of LINQ queries cannot use Query Notifications.

    0 讨论(0)
提交回复
热议问题