WeavyController Class

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

Abstract base class for controllers.

public abstract class WeavyController : Controller
Inheritance:
System.Object → WeavyController

Constructors

WeavyController()

Fields

PageSizes Page sizes for paging and infinite scroll.

Properties

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

Methods

Alert(AlertModel) Injects an alert message to be displayed on next page load.
Alert(AlertType, string) Injects an alert message to be displayed on next page load.
Alert(AlertType, string, bool, bool, bool, bool) Injects an alert message to be displayed on next page load.
Alert(ModelStateDictionary) Injects an validation alert to be displayed on next page load.
Alert(string) Injects an success message to be displayed on next page load.
GetApp(int, bool) Helper method for getting an app (and setting it in Current). Throws a HTTP 404 exception if the app cannot be found.
GetContent(int, long?, bool) Helper method for getting a content item (and setting it in Current). Throws a HTTP 404 exception if the content cannot be found.
GetSpace(int, bool) Helper method for getting a space (and setting it in Current). Throws a HTTP 404 exception if the space cannot be found.
Json(object) Creates a JsonResult object that serializes the specified object to JavaScript Object Notation (JSON).
Json(object, JsonRequestBehavior) Creates a JsonResult object that serializes the specified object to JavaScript Object Notation (JSON) format using the specified JSON request behavior.
PartialView(App) Creates a System.Web.Mvc.ViewResult object that renders a view, by using the specified model.
PartialView(Content) Creates a System.Web.Mvc.ViewResult object that renders a view, by using the specified model.
PartialView(ContentSearchResult) Renders a partial view for the specified content search result.
PartialView(string, App) Creates a System.Web.Mvc.PartialViewResult object that renders a view, by using the specified model.
PartialView(string, Content) Creates a System.Web.Mvc.PartialViewResult object that renders a view, by using the specified model.
RedirectToReferrer(string) Creates a System.Web.Mvc.RedirectResult that redirects to the url referrer of the request.
Script(string) Injects a script to be executed on next page load.
ThrowResponseException(HttpStatusCode, string) Throws a HttpException with the specified code and message.
View(App) Creates a System.Web.Mvc.ViewResult object that renders a view, by using the specified model.
View(Content) Creates a System.Web.Mvc.ViewResult object that renders a view, by using the specified model.
View(string, App) Creates a System.Web.Mvc.ViewResult object that renders a view, by using the specified model.
View(string, Content) Creates a System.Web.Mvc.ViewResult object that renders a view, by using the specified model.

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.