DotConnect for Postgresql with Entity Developer - How use ConnectionLost Event

DotConnect for Postgresql with Entity Developer - How use ConnectionLost Event

Hi, 

I am using DotConnect for Postgresql with Entity Developer (edml Data Model) in an ASP.NET Framework, C# and Entity Framework 5.0 application; Sometimes the connection with the Postgresql database is lost, how can I use the ConnectionLost Event in the connection code that is automatically generated by Entity Developer?

This is the connection string:
  1. <connectionStrings>
  2.    <add name="AartePostgreSqlEntitiesConnectionString" connectionString="metadata=res://Aarte.Model/Aarte.Model.PostgreSql.AarteDataModel.csdl|res://Aarte.Model/Aarte.Model.PostgreSql.AarteDataModel.ssdl|res://Aarte.Model/Aarte.Model.PostgreSql.AarteDataModel.msl;provider=Devart.Data.PostgreSql;provider connection string=&quot;User Id=aartet0004;Password=xxxxxx;Host=localhost;Database=t0004;Persist Security Info=True;Initial Schema=aarte&quot;"
  3.       providerName="System.Data.EntityClient" />
  4. </connectionStrings>

This is the code generated by Entity Developer:

  1.    /// <summary>
  2.     /// No Metadata Documentation available.
  3.     /// </summary>
  4.     public partial class AarteContext : ObjectContext
  5.     {
  6.         #region Constructors

  7.         /// <summary>
  8.         /// Initialize a new AarteContext object.
  9.         /// </summary>
  10.         public AarteContext() :
  11.                 base(@"name=AartePostgreSqlEntitiesConnectionString", "AarteContext")
  12.         {
  13.             this.ContextOptions.LazyLoadingEnabled = true;
  14.             OnContextCreated();
  15.         }

  16.         /// <summary>
  17.         /// Initializes a new AarteContext object using the connection string found in the 'AarteContext' section of the application configuration file.
  18.         /// </summary>
  19.         public AarteContext(string connectionString) :
  20.                 base(connectionString, "AarteContext")
  21.         {
  22.             this.ContextOptions.LazyLoadingEnabled = true;
  23.             OnContextCreated();
  24.         }

  25.         /// <summary>
  26.         /// Initialize a new AarteContext object.
  27.         /// </summary>
  28.         public AarteContext(EntityConnection connection) : base(connection, "AarteContext")
  29.         {
  30.             this.ContextOptions.LazyLoadingEnabled = true;
  31.             OnContextCreated();
  32.         }


  33.         #endregion