📜 ⬆️ ⬇️

X.Scaffolding Library



Attention! Updated package to NuGet. Details at the end of the article.

With the release of Visual Studio 2013, ASP.NET MVC 5 and Entity Framework 6, the scaffolding capabilities built into Visual Studio are even better. However, until now creating a new web application has to do a lot of actions that could be automated.
Therefore, the X.Scaffolding package was created for myself and the developers with whom I work. It allows you to create web applications more productively. It is on the basis of this package that we now develop the majority of new web applications for working with data.
')
Today I decided to share this project with Habrahabr readers. Perhaps someone will find it interesting and will help in his work, and someone himself will want to participate in its development.

As you know, Visual Studio provides a huge number of functions that allow you to automate routine operations and focus on basic tasks. One of such convenient and rather demanded functions is the possibility of generating editing forms for database entities. This feature has appeared a long time ago, but with the release of Visual Studio 2013, the bootstrap framework has become even more convenient for integrating into the base application template. But as you know - the limit is not perfect.

One of the reasons for creating a package was that now standard controls created by various extension methods like EditorFor generate incompletely valid code from the point of view of the bootstrap framework. As a result, the pages with editors are not very well displayed. In order to avoid manual editing of styles, a set of own extension methods was also developed.

In addition, not all data types are currently supported by standard extensions. For example, now many of my projects often use the capabilities of the package for creating an HTML editor, calendar, and video preview.

Extensions


The key role in the library is played by the Extensions class, which contains extension methods for HtmlHelper):


In order to ensure the correct operation of all extensions, some files were added to the package, which added files to the structure of the web application and some dependencies. Consider them in more detail.

Package structure


After installing the X.Scaffolding NuGet package, the following elements will be added to your web application:


Authorization module

The authorization module is made on the basis of the template from the site bootsnipp.com


In addition to files added directly by the X.Scaffolding package, some other packages and related files are also added to the project. Consider them in more detail.

NuGet Plugin Packages



Join now!




Anyone can either get acquainted with the source code of the library, and expand its capabilities.
Project source codes are available on GitHub .

Nuget

You can install the package from the NuGet repository: Install-Package xscaffolding

Disclaimer
I want to immediately warn you that since the library was created primarily for use in your own projects, there may be several things to consider when using it:
  • Now the library is designed for using ASP.NET MVC 5 version and Entiy Framework 6 version in the project.
  • When installing the package, a branded favicon is added to the web application (due to the fact that most of the package installations are now made for our own projects)
  • When installing, a link to the WindowsAzure.Storage package is added to the web application, which may be superfluous for those who do not work with Windows Azure


However, the source code of the library is now open access. And besides, if there is enough interest in the library - I plan to create the X.Scaffolding.Core package, in which there will be no binding to the above packages and there will be no favicon.


Update
Since the package in NuGet initially contained both the library and the styles of design, I decided to divide it into two parts.

Therefore, if you do not need extra css styles in the project, then you can use the X.Scaffolding.Core package.

Source: https://habr.com/ru/post/200692/


All Articles