public UserAccount FindByEmail(string email)
        {
            Check.Argument.IsNotNullOrEmpty(email, nameof(email));

            using (var context = new IdentityDbContext())
            {
                return(context.UserAccounts.Include(ua => ua.Claims).Include(ua => ua.Emails).FirstOrDefault(u => u.Emails.Any(e => e.Value.Equals(email))));
            }
        }
        public IEnumerable <UserAccount> Search(Expression <Func <UserAccount, bool> > predicate, int?skip, int?count)
        {
            Check.Argument.IsNotNull(predicate, nameof(predicate));

            using (var context = new IdentityDbContext())
            {
                return(context.UserAccounts.Include(ua => ua.Claims).Include(ua => ua.Emails).Where(predicate).ToArray());
            }
        }
        public UserAccount FindByUsername(string username)
        {
            Check.Argument.IsNotNullOrEmpty(username, nameof(username));

            using (var context = new IdentityDbContext())
            {
                return(context.UserAccounts.Include(ua => ua.Claims).FirstOrDefault(u => u.Username.Equals(username)));
            }
        }