public PublicKeyRepository(PublicKeyContext context)
 {
     _context = context;
     Add(
         new PublicKey {
         user = "******",
         key  = "23j4k32m4e4oimd43idm3i"
     }
         );
 }
Beispiel #2
0
        public static PublicKeyContext Create(string connectionString)
        {
            var optionsBuilder = new DbContextOptionsBuilder <PublicKeyContext>();

            optionsBuilder.UseMySQL(connectionString);

            //Ensure database creation
            var context = new PublicKeyContext(optionsBuilder.Options);

            context.Database.EnsureCreated();

            return(context);
        }