/// <summary>
        /// Gets the entity framework context.
        /// </summary>
        /// <param name="provider">The provider.</param>
        /// <returns></returns>
        private UserDashboardsEFDbContext GetContext(IUserDashboardsEFDataProvider provider)
        {
            if (provider.ProviderContext == null)
            {
                throw new Exception(String.Format("Provider {0} is not initialized.", provider.Name));
            }

            return(UserDashboardsEFDataConnection.GetContext(this.connectionName, provider));
        }
        public void Initialize(string providerName, NameValueCollection config, Type managerType)
        {
            this.connectionName = config["connectionName"];

            if (string.IsNullOrEmpty(this.connectionName))
            {
                this.connectionName = "Sitefinity"; /* the default connectionName */
            }
            var provider = this.DataProvider as IUserDashboardsEFDataProvider;

            if (provider != null)
            {
                UserDashboardsEFDataConnection connection = UserDashboardsEFDataConnection.InitializeConnection(this.connectionName, provider);

                provider.ProviderContext = new UserDashboardsEFDataProviderContext()
                {
                    ProviderKey  = Guid.NewGuid().ToString(),
                    ConnectionId = connection.Name
                };

                this.connectionName = connection.Name;
            }
        }