Entity Class

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

Encapsulates a reference to an entity.

public class Entity : Entity, ISpaceEntity, ITrashable, IEntity, ICloneable where T : class, IEntity
Inheritance:
System.Object → EntityEntity
Implements:
ISpaceEntity, ITrashable, IEntity

Constructors

Entity(Int32) Initializes a new instance of the Weavy.Core.Models.Entity%601 class.
Entity(T) Initializes a new instance of the Weavy.Core.Models.Entity%601 class.

Properties

Type Gets the type of the referenced entity, e.g. Comment, Content, Message, Role, Space, User etc.
Value Gets or sets the value of the referenced entity.

Extension Methods

IsNullOrDefault(T) Gets a value indicating if the specified value has the default value of the generic type.
Assert(IEntity, Permission, User) Throws a ForbiddenException if a user does not have the requested permission to an entity.
Boost(IEntity) Gets the boost factor for the fulltext index.
HasPermission(IEntity, Permission, User) Check if the current user has the requested permission to the specified entity.
HasValue(IEntity, Boolean) Returns true if the entity has a value otherwise false.
Value(IEntity, Boolean) Returns the actual underlying value of an IEntity.
Kind(IEntity) Returns a label that is suitable for display in lists and search results.
CssClass(IEntity) CSS class for an entity.
Serialize(Object) Serializes an object, or graph of connected objects, to a byte array.
SerializeToJson(Object, Nullable, JsonSerializerSettings) Serializes an object, or graph of connected objects, to a json string.
Breadcrumbs(IEntity, Boolean, Boolean) Returns the breadcrumb segments for en entity.
DavUrl(IEntity, Boolean) Returns an url that can be used by WebDAV clients.
ThumbPlaceholderUrl(IEntity, Boolean, Boolean) Returns a placeholder url to a thumbnail image of the specified entity. The url contains the string "{options}" which can be replaced with the desired resize options, e.g. "128", "128x0", "0x128", "128x256" etc.
ThumbUrl(IEntity, Nullable, Nullable, Boolean, FitMode, ScaleMode, ContentAlignment, Nullable, Int32, Int32, Boolean, Boolean, Boolean, Boolean) Returns an url to a thumbnail image for the specified entity.
Url(IEntity, Boolean) Returns the url to an entity.
IsValid(Object) Determines whether the specified object is valid by evaluating each ValidationAttribute instance that is attached to the object type.
IsTrashed(ITrashable) Gets a value indicating whether the entity is trashed.
TrashedBy(ITrashable, Boolean) Gets the User that trashed the entity.
IsBuiltIn(IEntity) Gets a value indicating whether the specified entity is built-in.
CreatedBy(IEntity, Boolean) Gets the User that created the item.
ModifiedBy(IEntity, Boolean) Gets the User that modified the item.
Space(ISpaceEntity, Boolean) Gets the Space where the entity is located.
TableName(IEntity) Gets the table name where the reference should be stored.
Link(IEntity) Returns a link to the entity.