/// <summary>
        ///     Indicates whether the current <see cref="UserAccountRecord" /> instance is equal to another <see cref="UserAccountRecord" /> instance.
        /// </summary>
        /// <param name="that">
        ///     The <see cref="UserAccountRecord" /> instance to be compared against this instance.
        /// </param>
        /// <returns>
        ///     True if both instances are considered equal; otherwise, false.
        /// </returns>
        public Boolean Equals(UserAccountRecord that)
        {
            Boolean result = true;

            result = result && (this.Id == that.Id);
            result = result && (this.PrincipalId == that.PrincipalId);
            result = result && (this.PersonId.TrimOrNullify() == that.PersonId.TrimOrNullify());
            result = result && (this.SelcoId.TrimOrNullify() == that.SelcoId.TrimOrNullify());
            result = result && (this.Status == that.Status);
            result = result && (this.FailCount == that.FailCount);
            result = result && (this.LastLogin == that.LastLogin);
            result = result && (this.Provider.TrimOrNullify() == that.Provider.TrimOrNullify());
            result = result && (this.SysAdmin == that.SysAdmin);
            result = result && (this.LicenseType == that.LicenseType);
            result = result && (this.RepId.TrimOrNullify() == that.RepId.TrimOrNullify());
            return(result);
        }
        /// <summary>
        ///     Creates a new <see cref="UserAccountRecord" /> object instance that is a shallow-copy of the current object instance.
        /// </summary>
        /// <returns>
        ///     The shallow-copy of the current <see cref="UserAccountRecord" /> object instance.
        /// </returns>
        public UserAccountRecord Clone()
        {
            UserAccountRecord record = new UserAccountRecord();

            record.Id          = this.Id;
            record.PrincipalId = this.PrincipalId;
            record.PersonId    = this.PersonId;
            record.SelcoId     = this.SelcoId;
            record.Status      = this.Status;
            record.FailCount   = this.FailCount;
            record.LastLogin   = this.LastLogin;
            record.Provider    = this.Provider;
            record.SysAdmin    = this.SysAdmin;
            record.LicenseType = this.LicenseType;
            record.RepId       = this.RepId;
            return(record);
        }
Example #3
0
        /// <summary>
        ///     Retrieves a specific <see cref='UserAccountModel' /> instance.
        /// </summary>
        /// <param name="username">
        ///     The unique username which distinctly identifies the <see cref='UserAccountModel' /> instance to be returned.
        /// </param>
        /// <returns>
        ///     The <see cref='UserAccountModel' /> instance that matches the specified <paramref name='username' />; or null, if no matching instance can be found.
        /// </returns>
        public LocalUserAccountModel FetchByUsername(String username)
        {
            UserAccountRecord record = this.Provider.DataProvider.Security.UserAccount.FetchByUsername(username);

            return(record == null ? null : new LocalUserAccountModel(this.Provider, record));
        }