Esempio n. 1
0
        public async Task <User> FindByEmailAsync(string email)
        {
            if (string.IsNullOrWhiteSpace(email))
            {
                throw new ArgumentException("Value cannot be null or whitespace.", nameof(email));
            }
            var users = await _dbContext.GetUsersAsync();

            var cursor = await users.FindAsync(u => u.Email == email);

            return(await cursor.FirstOrDefaultAsync());
        }