public SimpleMembershipInitializer()
            {
                Database.SetInitializer<DatabaseContext>(null);

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

                    WebSecurity.InitializeDatabaseConnection("BerserkDB", "UserProfile", "UserId", "UserName", autoCreateTables: true);
                }
                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);
                }
            }
 public RoundRepository(DatabaseContext context)
 {
     _context = context;
 }
 public UserRepository(DatabaseContext context)
 {
     _context = context;
 }
 public TournamentRepository(DatabaseContext context)
 {
     _context = context;
 }
 public TableRepository(DatabaseContext context)
 {
     _context = context;
 }
Exemplo n.º 6
0
 public DalContext()
 {
     _database = new DatabaseContext();
 }