User Class

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

An object representing a user.

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

Constructors

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

Properties

Avatar Gets or sets the avatar image.
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.
Email Gets or sets the main 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.
IsExternal Gets a value indicating whether the User is an external user.
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.
SpaceId Always returns SystemId
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

IsNullOrDefault(T) Gets a value indicating if the specified value has the default value of the generic type.
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.