public void Dispose()
        {
            if (db != null)
            {
                db.Dispose();
                db = null;
            }

            GC.SuppressFinalize(this);
        }
            public SimpleMembershipInitializer()
            {
                Database.SetInitializer<EntityContext>(null);

                try
                {
                    using (var context = new EntityContext())
                    {
                        if (!context.Database.Exists())
                        {
                            // Create the SimpleMembership database without Entity Framework migration schema
                            ((IObjectContextAdapter) context).ObjectContext.CreateDatabase();
                        }
                    }

                    WebSecurity.InitializeDatabaseConnection("Default", "FightTime", "Usuarios", "UsuarioId", "Username", false);
                }
                catch (Exception ex)
                {
                    throw new InvalidOperationException(
                        "The ASP.NET Simple Membership database could not be initialized. For more information, please see http://go.microsoft.com/fwlink/?LinkId=256588",
                        ex);
                }
            }