MvcTemplate.Validators.AccountValidator.IsUniqueUsername C# (CSharp) Method

IsUniqueUsername() private method

private IsUniqueUsername ( Int32 accountId, String username ) : System.Boolean
accountId System.Int32
username String
return System.Boolean
        private Boolean IsUniqueUsername(Int32 accountId, String username)
        {
            Boolean isUnique = !UnitOfWork
                .Select<Account>()
                .Any(account =>
                    account.Id != accountId &&
                    account.Username.ToLower() == username.ToLower());

            if (!isUnique)
                ModelState.AddModelError<AccountView>(model => model.Username, Validations.UniqueUsername);

            return isUnique;
        }
        private Boolean IsUniqueEmail(Int32 accountId, String email)