FileAttribute Class

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

Specifies the file size, height, width and allowed filetypes of uploaded images.

public class FileAttribute : ValidationAttribute
Inheritance:
System.Object → FileAttribute

Constructors

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

Properties

Extensions Gets or sets the allowed file extensions.
MaxSize Gets or sets the maximum file size.
MinHeight Gets or sets the minimum height in pixels.
MinWidth Gets or sets the minimum width in pixels.
PlaceholderImage Gets or sets the name of the placeholder image.

Methods

IsValid(Object) Checks that the value of the data field is valid.

Extension Methods

IsNullOrDefault(T) Gets a value indicating if the specified value has the default value of the generic type.
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.
IsValid(Object) Determines whether the specified object is valid by evaluating each ValidationAttribute instance that is attached to the object type.