Example #1
0
        public override void ResolveRequest(HttpListenerContext context)
        {
#if (IN_MEMORY_DB)
            using (Context = new CodeRunnerEntities(connection))
            {
                Next.ResolveRequest(context);
            }
#else
            using (Context = new CodeRunnerEntities())
            {
                Next.ResolveRequest(context);
            }
#endif
        }
Example #2
0
        static DBMiddleware()
        {
            using (Context = new CodeRunnerEntities(connection))
            {
                var adminUser = new User
                {
                    Id           = Guid.NewGuid(),
                    Email        = "*****@*****.**",
                    PasswordHash = Encoding.ASCII.GetBytes(BCrypt.Net.BCrypt.HashPassword("admin1", 12)),
                    Username     = "******"
                };

                Context.Users.Add(adminUser);
                Context.SaveChanges();
            }
        }