User Class

Namespace:
Weavy.Core.Models
Assembly:
Weavy.Core.dll

An object representing a user.

[Boost(2F)]
public class User : IPrincipal, ITrashable, IFollowable, IEntity, ICloneable, IHasAvatar, IValidatableObject
Inheritance:
System.Object → User
Attributes:
BoostAttribute
Implements:
ITrashable, IFollowable, IEntity, IHasAvatar

Constructors

User() Initializes a new instance of the User class.

Properties

Avatar Gets or sets the avatar image.
ClientId Gets or sets the client id to associate with this user.
Comment Gets or sets application-specific information for the User.
CreatedAt Gets or sets the time (UTC) the User item was created.
CreatedById Gets or sets the id of the User that updated the User.
DirectoryId Gets or sets the user directory.
Email Gets or sets the email address.
FollowedByIds Gets the ids of the users that follow this user.
Guid Gets a globally unique identifier for the user.
Id Gets the user id.
Identity Gets the identity of the current user.
IsAdmin Gets a value indicating whether the User is a system administrator.
IsSuspended Gets or sets a value indicating whether the user account is suspended.
LastSeenAt Gets the time the User was last seen.
Logins Gets the list of logins for the User.
ModifiedAt Gets or sets the time (UTC) the User was updated.
ModifiedById Gets or sets the id of the User that updated this User.
Presence Gets a value indicating the current user's presence.
Profile Gets profile data for the user.
Roles Gets the list of roles the User is member of.
Timestamp Gets the timestamp.
Token Gets or sets a token that can be used to request a new password.
TrashedAt Gets the time (UTC) the User was deleted.
TrashedById Gets the id of the User that trashed this User.
Type Gets the type of the entity.
Username Gets or sets the username (used for login, @mentions etc).

Methods

Clone() Creates a new object that is a copy of the current instance.
GetExcerpt(bool) Gets an excerpt or summary suitable for display in lists and search results.
GetIcon() Gets an icon suitable for display in the user interface.
GetTitle() Gets a title suitable for display in lists and search results.
IsInRole(string) Determines whether the user belongs to the specified role.
Validate(ValidationContext) Performs custom validation. Subclasses can override this method to supply their own implementation.

Extension Methods

GetSettings(User) Get settings from the user profile
SetSettings(User, UserSettings) Store user settings in the user profile.
MergeSettings(User, Dictionary) Merges settings into user profile.
IsAuthenticated(User) Helper method for deciding whether a user is authenticated or not.
Serialize(object) Serializes an object, or graph of connected objects, to a byte array.
SerializeToJson(object, Formatting?, JsonSerializerSettings) Serializes an object, or graph of connected objects, to a json string.
IsValid(object) Determines whether the specified object is valid by evaluating each ValidationAttribute instance that is attached to the object type.