Пример #1
0
 /// <summary>
 /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
 /// </summary>
 public override void Dispose()
 {
     if (_RBEPortalData != null) {
         _RBEPortalData.Dispose();
         _RBEPortalData = null;
     }
     if (_SharedConnection != null) {
         _SharedConnection.Dispose();
         _SharedConnection = null;
     }
     base.Dispose();
 }
Пример #2
0
        /// <summary>
        /// Inits the data.
        /// </summary>
        protected void InitData()
        {
            var core =
                new System.Data.EntityClient.EntityConnection(
                    @"metadata=res://Core/Schema.Core.csdl|res://Core/Schema.Core.msl|res://Core/Schema.Core.ssdl;provider=System.Data.SqlClient;provider connection string=""""");
            var portal =
                new System.Data.EntityClient.EntityConnection(
                    @"metadata=res://*/Schema.RBEPortal.csdl|res://*/Schema.RBEPortal.ssdl|res://*/Schema.RBEPortal.msl;provider=System.Data.SqlClient;provider connection string=""""");

            _SharedConnection = new System.Data.SqlClient.SqlConnection(Settings.ConnectionString);

            base.CoreData = new CoreData(new System.Data.EntityClient.EntityConnection(core.GetMetadataWorkspace(), _SharedConnection), false);
            base.CoreData.ObjectContext.ContextOptions.ProxyCreationEnabled = false;
            _RBEPortalData = new Schema.RBEPortalData(new System.Data.EntityClient.EntityConnection(portal.GetMetadataWorkspace(), _SharedConnection), false);
            _RBEPortalData.ObjectContext.ContextOptions.ProxyCreationEnabled = false;
        }