This question is locked. New answers and comments are not allowed.
Hello.
Suppose I've got the following code:
But I don't see any messages from disposing and state changing, but as I understand when context is disposed this messages should appear? Or maybe I'm wrong? Can you explain, please.
Thanks in advance.
Suppose I've got the following code:
using
(EntitiesModel model =
new
EntitiesModel(Settings1.Default.ConnString))
{
model.Connection.StoreConnection.StateChange += ConnectionStateChange;
model.Connection.StoreConnection.Disposed += ConnectionDisposed;
....
}
private
static
void
ConnectionDisposed(
object
sender, EventArgs e)
{
Console.WriteLine(
"Disposed"
);
}
private
static
void
ConnectionStateChange(
object
sender, StateChangeEventArgs e)
{
Console.WriteLine(
"Connection state changed from {0} to {1}"
, e.OriginalState, e.CurrentState);
}
But I don't see any messages from disposing and state changing, but as I understand when context is disposed this messages should appear? Or maybe I'm wrong? Can you explain, please.
Thanks in advance.