ASP.NET Boilerplate


Hi all,

I’m building an application framework for more than one year. It provides an NLayered and modular application template to start with. Includes dependency-injection, logging, localization, validation, exception hanlding, DDD infrastructure and so on… Works with NHibernate and EntityFramework. Also works good with AngularJs.

I thought that it’s good to announce it here for who like open source projects.

See for the project and documentation.



it is interesting to get a complete project by entering only one name - the project name.

As of I am working on a model driven development approach, I am interested in web based frameworks to support them.
Using UML, XMI and XSLT, I generate applications on the fly after a basic class model has been entered using as little extra modeling as possible such as stereotypes.

Do you plan any support to extend your template mechanism to support more model elements despite one single project name like class for an entity, class with stereotype form to specify basic contents for a form representing part of a basic class’s attributes?

My homepage is at
A template supporting commercial grade DevExpress WinForms library is at
It is currently supporting an intranet scenario with WCF based web services for entities and identification/authentification.

The last link is part of the project and thus I am restricted to 2 links, I am pointing this out.

Like this DevExpress efford, I like to find ASP.NET based, but opensource dependent frameworks…

Thanks, Lothar



Thanks for your comments.

ASP.NET Boilerplate actually is an application framework to create applications in DDD approach with best bractices like DI. The template part is just a starting point. It makes starting an ABP based project faster. You can see documentation ( to better understand it.

One-time application creation from an XML (or another metadata) is bad since if we change the generated code, then we can not build from XML again. But I think this is not the point you wanted to say.

Creating application on runtime by reading metadata is another approach. Creating apps on the fly by reading some XML files also a good idea. Also, developer can inject codes into XML for specific business logic. These type frameworks have a customization problem as I see. They are good for simple domains but not appropriate for huge enterprise solutions. Also it’s very hard to make everyone happy.

So, with ASP.NET Boilerplate I try to leave developer free to write it’s own code and choice what UI tool he uses (ABP provides Angular and Durandal templates but not depend on they). I just provide standard mechanisms like DI, exception handling, validation, logging, localization, configuration, navigation, calling a web api method easier… and so on.


One-time: Yes, you can’t override, but working constantly in the template code and not directly in the generated code is an acceptable compromise for me. This is only acceptable when the code repeats and changin the template saves time. Simply put - it depents to where it makes sense and repetition is the point.

Runtime: Hereunder falls UI. Having one declarative UI description on one platform and another on a different is a problem. In my prototyping approach I do generate UI on the fly based on metadata out of my application configuration. At that point I do not have comprehensive UI layout, but I plan to use one designer within my generated code and grab the relative layout coordinates and tree. This becomes then my metadata for other frameworks to generate UI on the fly. The next step is generating code out of the metadata when I think the prototype is good enough for this step (inclusive using the custom layout metadata in a transformed way). But you see, I am mainly at the prototyping step in the beginning of a project, where this is mentioned by several books. My domain is simple CRUD applications and firsttimers - starting projects. And yes, it is not a on fits all solution.

Boilerplate is in that way interesting as it provides several crosscutting stuff. Lets see what I can do with it. One of my main interest in web technologies is the CSS issue and how to map one design to the target CSS classes used in a target framework, because of keeping design separated and in a more common format. Moreover the structural layout and cascading and the question: Can I derive it from a domain model with as little as possible additional design attributes?

Generally I am a pro speaking about code generation. One point in my job is finding me repeating stuff in the UI design every time ai´gain and this is my boring job I am thinking about doing it better. One can create custom controls per UI interaction use case but then there is still a repeating usage of that new control. I have the feeling that 80% can be generated with ease and little upfront design.

Edit: And indeed, you have a model and a ontime code generator! You let create your users ready made jumpstart projects based on as little as possible model information. Adding a database schema in XML or providing them by some wizards in a more extended jumpstart configuration you have it what I mean a way to enter the metadata.


While this looks like an interesting project, I do have one or two reservations. First of all, there doesn’t appear to be any unit testing code. It would be good to see this included, as TDD is a pretty important practice these days.

Secondly, I have several serious reservations about the n-layered architecture in general and the Repository pattern in particular as it’s commonly implemented. My main concern is that the separation between the different layers is often not clear-cut, and attempting to segregate things out leads to concerns being mis-categorised, causing all sorts of problems such as poor testability, DRY violations, and performance problems. In particular, if you’re forcing everything to go to Entity Framework through a generic Repository wrapper, you’re not going to be able to specify prefetch paths for your queries, and that’s going to set you up for some serious select n+1 issues.

I’m also unhappy about the use of DTOs here. DTO stands for “Data Transfer Object” and as such DTOs are supposed to be for communication across the wire, often between machines on different servers. For these, your requirements are totally different from objects that can be passed around between layers in the same process. As such, you should only be using DTOs at a service boundary – they are really to WebAPI what views are to MVC. Using them to pass data from your application layer to your presentation layer is more often than not a waste of effort. Just let your entities go all the way to your views.

Separation of concerns is important, but it’s equally important to remember that it’s a means to an end and not an end in itself. It needs to solve a specific business problem, otherwise you’re just wasting your time and making a rod for your back. For what it’s worth, the way I prefer to approach separation of concerns is to have it driven by my unit tests – to have just enough of it to make my code testable and no more.


Hi, I’m actively looking at you framwork as a good starting point, and I’m considering to use it for my next project and suggesting it even in my organization.

I have a question regarding the “application extensibility model”, the question are two:

  1. What if I want to do a module which extends the UI and provides itself some UI parts
  2. I’m considering partecipating in the developing of the framework because I’ll try to introduce a dynamic and pluggable module extension behavior, are you interested in ?

Thanks in advance



Thanks for your comments. For your questions,

  1. I don’t think to work on UI-reusability in a near time. Angular and other tools try to do it.
  2. Yes, absolutely I think it. Before developing it, please create an issue in github and we discuss features and the implementation.

Thanks again.


Awesome project,keep watching!

.NET Foundation Website | Blog | Projects | Code of Conduct