private async Task<ApplicationUser> ResolveApplicationUserAsync(UserResource userResource)
        {
            var user = await DbContext.ApplicationUsers.FirstOrDefaultAsync(u => u.UserName == userResource.Username);

            if (user == null)
            {
                user = new ApplicationUser { UserName = userResource.Username, DisplayName = userResource.DisplayName };
                DbContext.ApplicationUsers.Add(user);
                await DbContext.SaveChangesAsync();
            }
            else if (user.DisplayName != userResource.DisplayName)
            {
                user.DisplayName = userResource.DisplayName;
                await DbContext.SaveChangesAsync();
            }

            return user;
        }
        private async Task<ApplicationUser> GetOrAddUserAsync(string userName)
        {
            var user = await DbContext.ApplicationUsers.FirstOrDefaultAsync(u => u.UserName == userName);

            if (user == null)
            {
                user = new ApplicationUser { UserName = userName };
                DbContext.ApplicationUsers.Add(user);
                await DbContext.SaveChangesAsync();
            }

            return user;
        }