XOS.MVC.Framework
A set of .NET (C#) base classes, extensions, javascript and css helpers to aid in rapid web application development.
Getting Started
Installation
To install the latest version from NuGet using the Package Manager Console in Visual Studio, use the command:
PM> install-package xos.mvc.framework
While earlier versions of the source code are not archived, earlier nuget package versions remain active. In order to install a specific version of the package, use the command:
PM> install-package xos.mvc.framework -version x.x.x
where x.x.x is the desired version.
For example:
PM> install-package xos.mvc.framework -version 3.1.0
will install the version just prior to the latest as of this writing.
Uninstalling
To remove the package via the Package Manager Console, use the command:
PM> uninstall-package xos.mvc.framework
If the source was added to the project manually, simply delete the ~/Framework
folder, just so long as it is the folder containing the source code for the XOS.MVC.Framework.
Summary
The XOS.MVC.Framework project aims to speed up development by providing useful base classes, extensions, filters, and scripts for ASP.NET MVC applications. While the features are not exhaustive (in some cases only the plumbing for a feature exists, the functionality hasn't been implemented), these components serve as templates for implementation in an application.
When installed, the host project maintains its original structure and Xos.Mvc project simply adds a folder named Framework with all necessary sub-directories, classes and other assets. This keeps the tools in one place and allow for clean updates without polluting the project with magic directories and mystery files. Another benefit is that a simple directory delete operation removes the framework from the application (or if installed via the Package Manager Console,
then uninstall-package xos.mvc.framework
.
The framework directory contains a few sub-directories that are empty. These sub-directories act as stubs for the most logical types of modules to come. Whether implemented by the application owner, or by the authors of this project, these sub-directories serve as a structural roadmap for the project.
Some key project features are: Key Features
-
Extensions to the optimization system by adding a
~/Framework/Infrastructure/FrameworkBundleConfig.cs
file which adds additonal script and style bundles found in the respective subdirectories. The stylesheets are implemented as overrides which should be used to add custom style definitions without modifying the base corporate, bootstrap, or other design template.
-
~/Framework/Models/BaseModel.cs
and~/Framework/Models/BaseUser.cs
are base classes that add common properties when used in derived models.
-
~/Framework/Infrastructure/BaseDbContext.cs
,~/Framework/Infrastructure/BaseRepository.cs
and~/Framework/Infrastructure/IBaseRepository.cs
serve as base classes which implement the repository pattern with generics. This functionality can be leveraged with derived classes such as anApplicationDbContext.cs
andApplicationRepository.cs
classes.
-
Javascript, more specifically jQuery helper functions, found in
~/Framework/Scripts/jquery-form-defaults.js
provide default form behavior.~/Framework/Scripts/scripts-not-found.js
is a fallback script when attempting to load optional javascript libraries such as thejquery.ui.timepicker.js
plugin which is supported by the framework but not included by default.~/Framework/Scripts/xos-js-exceptions.js
holds the custom javascript exceptions that can be called by the framwork. Finally,~/Framework/Scripts/xos-js-extensions.js
provide extensions to javascript types.
-
~/Framework/Extensions/Extensions.cs
provides extensions for .NET system typesDateTime
andint
, as well as the .NET Framework typeIEnumerable<>
which iterates over the collection and performs an Action on each item within the collection.
-
Finally, a set of Attribute Filters found in the
~/Framework/Filters
directory folder, that are simply stubbed out to allow for domain specific implementations.
XNODE™ Solutions, LLC © 2013-2018
Released under MIT License
All code provided herein is provided AS-IS.