WeavyApiController Class

Namespace:
Weavy.Web.Api.Controllers
Assembly:
Weavy.Web.dll

Abstract base class for API controllers.

public abstract class WeavyApiController : ApiController
Inheritance:
System.Object → WeavyApiController

Constructors

WeavyApiController()

Fields

DefaultPageSize The default page size for api requests.
MaxPageSize The max page size for api requests.

Properties

OwinContext Get the current Owin context.
User Gets the user security information for the current HTTP request.

Methods

ThrowResponseException(HttpStatusCode, string) Throws a HttpResponseException with the specified code and message.
ThrowValidationException(HttpStatusCode, ModelStateDictionary) Throws a HttpResponseException with the specified code and message.
ValidateModel(object) Helper method for validating an object after patch and put requests.

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, 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.