Exemple #1
0
        public static void CreateDatabase(this IdentityStorage storage)
        {
            var script = Script.GetScript("IdentityDb.sql");

            using var connection = storage.GetConnection();
            connection.Open();
            using var transaction = connection.BeginTransaction();
            connection.ExecuteNonQuery(script);
            transaction.Commit();
        }
Exemple #2
0
        public static async Task <T> FindUserByUserName <T>(this IdentityStorage storage, string userName) where T : IdentityUser
        {
            var normalizedUserName = userName.ToUpper(CultureInfo.CurrentCulture);

            return(await storage.FindOne <T>(x => x.NormalizedUserName == normalizedUserName));
        }
Exemple #3
0
        public static async Task <T> FindUserByEmailAddress <T>(this IdentityStorage storage, string emailAddress) where T : IdentityUser
        {
            var normalizedEmail = emailAddress.ToUpper(CultureInfo.CurrentCulture);

            return(await storage.FindOne <T>(x => x.NormalizedEmail == normalizedEmail));
        }