Exemple #1
0
        private bool _fillCache(ApplicationDbContext context)
        {
            var mu        = MainUserRepository.MainUserNames;
            var t         = context.Users.Where(i => mu.Contains(i.UserName));
            var mainUsers = t.ToList();

            foreach (var mainUser in mainUsers)
            {
                MainUserRepository.Update(mainUser);
            }
            return(true);
        }
Exemple #2
0
        private async Task <ApplicationUser> _createMainUserIfNotExist(UserManager <ApplicationUser> userMamanger, ApplicationUser importantUser, string password)
        {
            var before  = importantUser.ToSerealizeString();
            var created = await CreateAppProgrammUser(userMamanger, importantUser, password);

            var after = created.ToSerealizeString();

            if (before != after)
            {
                MainUserRepository.Update(created);
            }
            return(created);
        }