Portoa.Web
If the result implements , then the HTTP status
code on the Response will be set according to the value of
Enables you to dynamically add filters to a ControllerActionInvoker. This class will also
perform injection on all filters that are annotated with NeedsBuildUpAttribute.
Adapted from http://blog.ploeh.dk/2009/12/01/GlobalErrorHandlingInASPNETMVC.aspx
Overridden to add the new filters to the default filters
whose lifetime lasts as long as the HTTP request.
The object is stored in HttpContext.Current.Items, keyed by a .
Matching rule that matches when a method is annotated with an attribute
The attribute to match against
Model binder that uses an IUnityContainer to resolve the model binder designated by
which will do the actual model binding
The model binder to resolve
The container to use to resolve the model binder
Model binder that uses a service provider to resolve the model binder designated by
which will do the actual model binding
The model binder to resolve
The service provider to use to resolve the model binder
Controller factory that uses a service provider to resolve controllers
Gets the HTML-safe string representation of the tag. Thanks, Microsoft, for making
this method internal; it was really helpful.
Creates a submit button with the specified button text, input name and HTML attributes
The text to display on the submit button
The name of the input
Anonymous object with HTML attribute values
Creates a label with the specified text for the specified reference tag
The text/HTML to display inside the label
The reference ID of the labeled node (e.g. the value of the "for" attribute)
The HTML attributes
Creates a label for the model property identified by , applying
the given HTML attributes
A lambda expression identifying the model property to create a label for
Any extra HTML attributes that should be applied to the <label> tag
Creates a button with the specified display text and the specified custom HTML attributes
The text that the button will display
Any additional HTML attributes for the input tag
Indicates that an object needs to be built up by the container
Service for authenticating users
Logs in the specified user with the specified username
Logs out the currently logged in user
Determines if a user identified by the given username and password
is a valid user in the system
Adapted from http://eliasbland.wordpress.com/2009/08/08/enumeration-model-binder-for-asp-net-mvc/
Represents a view for when an error occurs
Enables action results to override the HTTP status code
Gets or sets the new HTTP status code for the result
Gets or sets the error message
Gets or sets the error that occurred
Gets or sets the delegate to create the error model. By default it creates
an instance of ErrorModel. The first argument
(the exception) can be null.
Handles global application-wide errors that don't get caught by
normal means
The system's logger
The current HttpContext
Handles global application errors by invoking the specified error controller
The exception that caused the error
The controller to use handle errors
Binds an enumeration annotated with the FlagsAttribute
Adapted from http://blog.nathan-taylor.net/2010/06/aspnet-mvc-flags-enumeration-model.html
Represents an object that can create error results
Creates an ActionResult for error actions
The status code for the result
Represents a simple, consistent object to use for AJAX responses
Gets or sets the error message that occurred. If null, it's assumed
that no error occurred.
Gets or sets any extra data the client may be expecting. This value should
not be null.
Flattens a FilterInfo object into a single IEnumerable containing
the ActionFilter, ExceptionFilter, ResultFilter and
AuthorizationFilter collections
Adds a URL pattern to the route collection utilizing intelligent casing when
deconstructing URLs. Make sure you add the to
your .
The name of the route, or null if unnamed
The route's URL pattern
Default values (if applicable) for this route
Constraints (if applicable) for the route values
Namespaces to search (unused)
This class exists to get rid of the SessionState and TempData error. Just google it.
Don't use this method, it's only here to prevent you from using it.
Maps the type to the binder type .
Maps the type to the binder type
using the to resolve the binder
Maps the type to the binder type
using the to resolve the binder
Logs all interceptable method calls via the
Matching rule that matches compiler-generated methods for property
getters and setters
Exposes an interface to configure log4net
Sets the name of the logger to retrieve
Name of the logger to use
Uses the > to configure log4net
Optional filename to watch, otherwise it uses the default
Configures the application to use log4net
decorator that allows you to explicitly control
how the object disposes (useful for 3rd-party objects that do not implement
)
The to decorate. This should be a
that actually has a backing store, e.g. will not be properly
disposed because there is no backing store for the objects it manages.
Action to call when the value needs to be disposed
Provides an interface for interacting with session data
Gets or sets an item from the backing store
The key of the item to retrieve
The value stored in the specified key, or null if no such key exists
Adds an extension if it hasn't already been registered with the container
Determines whether any of the given types are registered in the container
Determines if all of the given types are registered in the container
Registers the type and configures an for
This must be an interface type
The type to resolve the interface to
Registers the interface type and configures interception for it
Registers the type and configures interception for it
Registers the type and configures interception for it
Registers the instance and configures interception for it
Registers the type and configures interception for it
This must be an interface type
Registers the type and configures interception for it
Matching rule where a member is match if it is assignable from
The base class/interface to match against
Gets a value from the request and casts it to the specified type
Gets a value from the request
Adds an error to the model state
View engine for creating views that have been routed by a
Route that handles casing intelligently. It converts incoming paths to lowercase,
and adds a hyphen before each upper case letter (unless it starts the string). Use
to make use of this class.
Error result factory that returns a result suitable
for HTML views strongly typed to ErrorModel<T>
The user type
The currently logged in user
Error result factory that returns a result suitable
for HTML views strongly typed to ErrorModel
Session store that uses the current HttpContext
IControllerFactory that provides a mechanism to perform injection
on the controller after it is instantiated
Event that fires after a controller is instantiated
Uses an IUnityContainer to create controllers
Call handler that wraps a method call in a unit of work
Generic model for displaying errors where the currently logged in user is needed
The user type
Generic model for displaying errors
Gets or sets the exception that occurred
Gets or sets the currently logged in user, or null if no one is logged in
Provides an interface for identifying the current user
The user type
Returns the user currently performing actions on the site, or null
if the user cannot be identified
Base for an MVC application using Unity/NHibernate
The user type
The container associated with this application
Handles uncaught application exceptions; default implementation uses
and to
display errors
The uncaught exception
Override to perform any extra startup tasks; default implementation does nothing
Override to configure the model binders for the application; default implementation
does nothing
Creates the configuration used for NHibernate; default implementation uses the default
NHibernate configuration, and sets a custom interceptor. The configuration can be retrieved
outside of this method (if needed) via the container. Do not call this method directly.
Registers any routes for the application; default implementation registers nothing
Registers any applicable areas; default implementations calls
AreaRegistration.RegisterAllAreas()
Configures the controller factory; default implementation uses Unity to
resolve each controller with a custom action invoker
Enables smart casing for views and routes. This should
be called after Unity is configured, e.g. in .
Raised if is not registered in the container
Performs any application-specific configuration for Unity; default implementation
does nothing
Performs any needed cleanup when the application ends; default implementation
does nothing. Be aware that the container gets disposed of
later.
Applies smart casing rules to strings
Converts a smart-cased string back to a "dumb" one
The smart-cased string to convert
Converts a "dumb" string to a smart-cased one
The non-smart-cased string to convert
Negates a matching rule
The type of matching rule to negate
Negates a matching rule
The matching rule to negate
Service provider that uses an IUnityContainer to instantiate and locate services
Gets the MethodInfo associated with the actual object instance
in a CallHandler's method invocation
LINQifies an annoying IParameterCollection
Exposes an interface to apply configuration to an extension that configures
Unity using information contained in a config file
Sets the name of the Unity configuration section in the config file
The section name
Reads the app config and applies the Unity configuration, if applicable
Gets an object from the request variables, or its default value if
the key does not exist
The type to convert the value to
The request key of the object to retrieve
Strongly-typed model for displaying data that should be paged
The type of data to be paged
Model for displaying data that should be paged
Gets or sets the current page number (starting from 1)
Gets the starting point of the current page
Gets the actual ending point of the current page
Gets the theoretical ending point of the current page
Gets the total number of pages in the set
Gets or sets the total number of records
Gets the page size
Gets whether or not a previous page is possible
Gets whether or not a next page is possible
Gets or sets filtered record set; Count() should be less than or equal to the page size
Gets or sets filtered record set; Count() should be less than or equal to the page size
Model for displaying a paging menu
The model used for displaying the paged data
Gets the data needed to display a link to a certain page
The number of the page to retrieve
Gets or sets action to navigate to when going to the next or previous page
Gets or sets the controller to navigate to when going to the next or previous page
Gets the starting point of the current page
Gets the actual ending point of the current page
Gets the theoretical ending point of the current page
Gets the total number of pages in the set
Gets the current page number
Gets whether or not a previous page is possible
Gets whether or not a next page is possible
Gets the page size
Gets the total number of records
Gets whether or not the menu should be shown
Gets whether or not the current page is a valid page number for the given data
Gets the data needed to display a link to all the pages
Represents the data needed to show a link to a page
Gets or sets the starting point of this page
Gets or sets the ending point of this page
Gets or sets the page number
Disallows public access to a controller's action. This is basically a more useful version of
. When the action is accessed publicly, an
with a 404 status code is raised.
Verifies that an uploaded file has a certain mimetype
Gets or sets the expected mimetype (i.e. text/plain, image/png, etc.)
Verifies that an uploaded file's length lies within a range
The (inclusive) maximum length of the uploaded file
Gets or sets the (inclusive) maximum length of the uploaded file
Gets or sets the (inclusive) minimum length of the uploaded file
ActionResult decorator that enables you to override the HTTP status code
Signifies that this controller can handle errors that aren't handled by
application code
Executed when an unknown error occurs
Executed when a page is not found
Executed when the user is forbidden from seeing the requested page
Gets all model state errors as a line feed-delimited string
Creates a JSON response if an error occurred, appending all errors
to the response object
The error message to display to the user, this value cannot be null
Creates a JSON response from an Exception
Creates a JSON response object
The error message to display to the user (null if no error occurred)
Any extra data that needs to be passed to the client
Sets up the temporary data provider so that it won't barf with Session errors
Serializes to a JSON string and returns it as
application/json
The data to serialize to a JSON string
Controller for handling and displaying errors that aren't handled by application code
The factory to use to create the action results
Base class for authenticating users using the built-in
mechanism
Performs any extra logout tasks; default implementation does nothing
Performs any extra login tasks; default implementation does nothing
The name of the user to login
Performs automatic logging of method calls and returns while respecting
Truncates a string to 150 characters in a pretty way, if necessary