Class MongoUser
Represents a MongoDB user.
[Serializable]
[Obsolete("Use the new user management commands instead.")]
public class MongoUser : IEquatable<MongoUser>
- Inheritance
-
MongoUser
- Implements
- Inherited Members
- Extension Methods
Constructors
MongoUser(string, PasswordEvidence, bool)
Creates a new instance of MongoUser.
public MongoUser(string username, PasswordEvidence password, bool isReadOnly)
Parameters
username
stringThe username.
password
PasswordEvidenceThe password.
isReadOnly
boolWhether the user has read-only access.
MongoUser(string, string, bool)
Creates a new instance of MongoUser.
public MongoUser(string username, string passwordHash, bool isReadOnly)
Parameters
username
stringThe username.
passwordHash
stringThe password hash.
isReadOnly
boolWhether the user has read-only access.
Properties
IsReadOnly
Gets or sets a value indicating whether the user is a read-only user.
public bool IsReadOnly { get; set; }
Property Value
PasswordHash
Gets or sets the password hash.
public string PasswordHash { get; set; }
Property Value
Username
Gets or sets the username.
public string Username { get; set; }
Property Value
Methods
Equals(MongoUser)
Determines whether this instance and another specified MongoUser object have the same value.
public bool Equals(MongoUser rhs)
Parameters
rhs
MongoUserThe MongoUser object to compare to this instance.
Returns
- bool
True if the value of the rhs parameter is the same as this instance; otherwise, false.
Equals(MongoUser, MongoUser)
Determines whether two specified MongoUser objects have the same value.
public static bool Equals(MongoUser lhs, MongoUser rhs)
Parameters
lhs
MongoUserThe first value to compare, or null.
rhs
MongoUserThe second value to compare, or null.
Returns
- bool
True if the value of lhs is the same as the value of rhs; otherwise, false.
Equals(object)
Determines whether this instance and a specified object, which must also be a MongoUser object, have the same value.
public override bool Equals(object obj)
Parameters
obj
objectThe MongoUser object to compare to this instance.
Returns
- bool
True if obj is a MongoUser object and its value is the same as this instance; otherwise, false.
GetHashCode()
Returns the hash code for this Class1 object.
public override int GetHashCode()
Returns
- int
A 32-bit signed integer hash code.
HashPassword(string, PasswordEvidence)
Calculates the password hash.
public static string HashPassword(string username, PasswordEvidence password)
Parameters
username
stringThe username.
password
PasswordEvidenceThe password.
Returns
- string
The password hash.
HashPassword(string, string)
Calculates the password hash.
public static string HashPassword(string username, string password)
Parameters
Returns
- string
The password hash.
ToString()
Returns a string representation of the user.
public override string ToString()
Returns
- string
A string representation of the user.
Operators
operator ==(MongoUser, MongoUser)
Determines whether two specified MongoUser objects have the same value.
public static bool operator ==(MongoUser lhs, MongoUser rhs)
Parameters
lhs
MongoUserThe first value to compare, or null.
rhs
MongoUserThe second value to compare, or null.
Returns
- bool
True if the value of lhs is the same as the value of rhs; otherwise, false.
operator !=(MongoUser, MongoUser)
Determines whether two specified MongoUser objects have different values.
public static bool operator !=(MongoUser lhs, MongoUser rhs)
Parameters
lhs
MongoUserThe first value to compare, or null.
rhs
MongoUserThe second value to compare, or null.
Returns
- bool
True if the value of lhs is different from the value of rhs; otherwise, false.