Example #1
0
        /// <summary>
        /// Gets an Actor by the email value held in the repository
        /// </summary>
        /// <param name="email">The full email address to look up</param>
        /// <param name="cancellationToken"></param>
        /// <returns>The Actor that matched the email address</returns>
        /// <exception cref="ArgumentNullException"></exception>
        public async Task <Actor> GetUserByEmailAsync(string email, CancellationToken cancellationToken = default(CancellationToken))
        {
            Actor actor;

            if (!string.IsNullOrEmpty(email))
            {
                actor = await repository.GetActorByEmailAsync(email, cancellationToken);
            }
            else
            {
                throw new ArgumentNullException(nameof(email), "Email must be specified");
            }

            return(actor);
        }