gpt4 book ai didi

asp.net-core - .NET Core 是否支持 SqlDependency?

转载 作者:行者123 更新时间:2023-12-03 04:45:05 25 4
gpt4 key购买 nike

是否可以在 .NET Core v1.1 应用程序中利用 System.Data.SqlClient.SqlDependency?看来 System.Data.SqlClient 中的大多数其他类和方法都可用,但 SqlDependency 除外。

本质上,我试图在表数据更改时订阅 SQL 通知,然后更新客户端的 UI,因此如果 .NET Core 无法提供 SqlDependency,我愿意采用其他方法来实现此目的。

提前致谢!这是我完整的project.json 文件:

{
"dependencies": {
"Microsoft.NETCore.App": {
"version": "1.1.0",
"type": "platform"
},
"Microsoft.AspNetCore.Authentication": "1.0.0",
"Microsoft.AspNetCore.Authentication.Cookies": "1.0.0",
"System.IdentityModel.Tokens.Jwt": "5.0.0",
"Microsoft.AspNetCore.Authentication.OpenIdConnect": "1.0.0",
"Microsoft.AspNetCore.Authentication.Google": "1.0.0",
"Microsoft.AspNetCore.Authentication.JwtBearer": "1.0.0",
"Microsoft.EntityFrameworkCore.Tools": "1.0.0-preview2-final",
"Microsoft.AspNetCore.Server.Kestrel": "1.1.0",
"Microsoft.AspNetCore.StaticFiles": "1.1.0",
"Microsoft.EntityFrameworkCore": "1.1.0",
"Microsoft.EntityFrameworkCore.SqlServer": "1.1.0",
"Microsoft.EntityFrameworkCore.SqlServer.Design": "1.1.0",
"Microsoft.Extensions.Configuration.Binder": "1.1.0",
"Microsoft.Extensions.Configuration.FileExtensions": "1.1.0",
"Microsoft.Extensions.Configuration.Json": "1.1.0",
"Microsoft.Extensions.Logging.Console": "1.1.0",
"Microsoft.AspNetCore.Diagnostics": "1.1.0",
"Microsoft.AspNetCore.Identity": "1.1.0",
"Microsoft.AspNetCore.Mvc": "1.1.0",
"Microsoft.AspNetCore.Server.IISIntegration": "1.1.0",
"Microsoft.AspNetCore.Rewrite": "1.0.0",
"Microsoft.AspNetCore.ResponseCompression": "1.0.0",
"Microsoft.AspNetCore.SignalR.Server": "0.2.0-*",
"Microsoft.AspNetCore.WebSockets": "0.2.0-*"
},

"tools": {
"Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.0.0-preview2-final",
"Microsoft.AspNetCore.Razor.Tools": "1.0.0-preview2-final",
"Microsoft.EntityFrameworkCore.Tools": "1.0.0-preview2-final"
},

"frameworks": {
"netstandard1.1": {
"imports": [
"dotnet5.6",
"portable-net45+win8",
"net461",
"dnxcore50"
]
}
},

"buildOptions": {
"emitEntryPoint": true,
"preserveCompilationContext": true
},

"runtimeOptions": {
"configProperties": {
"System.GC.Server": true
}
},

"publishOptions": {
"include": [
"Views",
"wwwroot",
"appsettings.json",
"appsettings.dev.json",
"web.config"
]
},

"scripts": {
"postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ]
}
}

最佳答案

GitHub 上提供了一个基于 .Net Core 的开源解决方案: https://github.com/dyatchenko/ServiceBrokerListener

但是,我不确定性能,因为监听更改的多个客户端应用程序似乎正在创建专用队列。所以也许它的扩展性不如原始的 SqlDependency。

关于asp.net-core - .NET Core 是否支持 SqlDependency?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41657073/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com