SqlProviderServices.RegisterInfoMessageHandler 方法
[此頁面專屬於 Entity Framework 第 6 版。最新版本可從 'Entity Framework' NuGet 套件取得。如需 Entity Framework 的詳細資訊,請參閱 msdn.com/data/ef。]
註冊處理常式,以處理來自資料庫提供者的非錯誤訊息。
命名空間: System.Data.Entity.SqlServer
組件: EntityFramework.SqlServer (在 EntityFramework.SqlServer.dll 中)
語法
'宣告
Public Overrides Sub RegisterInfoMessageHandler ( _
connection As DbConnection, _
handler As Action(Of String) _
)
'用途
Dim instance As SqlProviderServices
Dim connection As DbConnection
Dim handler As Action(Of String)
instance.RegisterInfoMessageHandler(connection, _
handler)
public override void RegisterInfoMessageHandler(
DbConnection connection,
Action<string> handler
)
public:
virtual void RegisterInfoMessageHandler(
DbConnection^ connection,
Action<String^>^ handler
) override
abstract RegisterInfoMessageHandler :
connection:DbConnection *
handler:Action<string> -> unit
override RegisterInfoMessageHandler :
connection:DbConnection *
handler:Action<string> -> unit
public override function RegisterInfoMessageHandler(
connection : DbConnection,
handler : Action<String>
)
參數
- connection
類型:System.Data.Common.DbConnection
用來接收資訊的連接。
- handler
類型:System.Action<String>
處理訊息的處理常式。