Introduction to the problem

IMPORTANT NOTE:
While this article shows to develop User Interface vith Durandal, it's not
possible to create Durdandal templates from http://aspnetboilerplate.com
anymore. But this article is still useful to who want to use NHibernate as ORM
within ABP framework and to understand ABP in general. Click here for Angular & EntityFramework version of this article.

DRY - Don't Repeat Yourself! is one of the main ideas of a good developer while developing a software. We're trying to implement it from simple methods to classes and modules. What about developing a new web based application? We, software developers, have similar needs when developing enterprise web applications.

Starting a new enterprise web application is a hard work. Since all applications need some common tasks, we're repeating ourselves. Many companies are developing their own Application Frameworks or Libraries for such common tasks to do not re-develop same things. Others are copying some parts of existing applications and preparing a start point for their new application. First approach is pretty good if your company is big enough and has time to develop such a framework.

As a software architect, I also developed such a framework im my company. But, there is some point it feels me bad: Many company repeats same tasks. What if we can share more, repeat less? What if DRY principle is implemented universally instead of per project or per company? It sounds utopian, but I think there may be a starting point for that!

What is ASP.NET Boilerplate?

ASP.NET Boilerplate [1] is a starting point for new modern web applications using best practices and most popular tools. It's aimed to be a solid model, a general-purpose application framework and a project template. What it does?

Beside these common infrastructure, a module named zero is being developed. It will provide a role and permission based authorization system (implementing latest ASP.NET Identity Framework), a setting system, multi-tenancy and so on.

What ASP.NET Boilerplate is not?

ASP.NET Boilerplate provides an application development model with best practices. It has base classes, interfaces and tools those make easy to build maintainable large-scale applications. But..

It's not one of RAD (Rapid Application Development) tools those try to provide infrastructure for building applications without coding. Instead, it provides an infrastructure to code in best practices.

It's not a code generation tool. While it has several features those build dynamic code in run-time, it does not generate codes.

It's not a all-in-one framework. Instead, it uses well known tools/libraries for specific tasks (like NHibernate and EntityFramework for O/RM, Log4Net for logging, Castle Windsor as DI container, AngularJs for SPA framework).

Getting started

In this article, I'll show how to deleveop a Single-Page and Responsive Web Application using ASP.NET Boilerplate (I'll call it as ABP from now). I will use DurandalJs as SPA framework and NHibernate as ORM framework here. I prepared another article that implements same application with AngularJs and EntityFramework.

This sample application is named as "Simple Task System" and it consists of two pages: one for list of tasks, other one is to add new task. A Task can be related to a Person, can be active or completed. The application is localized in two languages. Screenshot of Task List in the application is shown below:

Creating empty web application from template

ABP provides a startup template for new projects (Even if you can manually create your project and get ABP packages from nuget, template way is much more easy). Go to www.aspnetboilerplate.com/Templates to create your application from template. You can choice SPA (Single-Page Application) project with optionally AngularJs or DurandalJs. Or you can choice MPA (classic, Multi-Page Application) project. Then you can choice EntityFramework or NHibernate for as ORM framework.

I named my project as SimpleTaskSystem and created a SPA project with Durandal and NHibernate. Downloaded project as a zip file. When I open the zip file, I see a solution is ready that contains assemblies (projects) for each layer of Domain Driven Design:

Created project's runtime is .NET Framework 4.5.1, I advice to open with Visual Studio 2013. The only prerequise to be able to run the project is to create a database. SPA template assumes that you're using SQL Server 2008 or later. But you can change it easily to another DBMS. See the connection string in web.config file of the web project:

You can change connection string here. I don't change the database name, so I'm creating an empty database, named SimpleTaskSystemDb, in SQL Server:

That's it, your project is ready to run! Open it in VS2013 and press F5:

Template consists of two pages: One for Home page, other is About page. It's localized in English and Turkish. And it's Single-Page Application! Try to navigate between pages, you'll see that only the contents are changing, navigation menu is fixed, all scripts and styles are loaded only once. And it's responsive. Try to change size of the browser.

Now, I'll show how to change the application to a Simple Task System application layer by layer.

Domain layer

"Responsible for representing concepts of the business, information about the business situation, and business rules" (Eric Evans) [2]. In the Domain Driven Design (DDD), the core layer is the Domain Layer. Domain Layer defines your Entities, implements your business rules and so on.

Entities

Entities are one of the core concepts of DDD. Eric Evans describe it as "An object that is not fundamentally defined by its attributes, but rather by a thread of continuity and identity". So, entities have Id's and stored in a database.

A task has a relation to a person and that's all for this simple application.

Entities implements IEntity<TPrimaryKey> interface in ABP. So, if type of your primary key is long for an Entity, it must implement IEntity<long>. If your Entity's primary key is int, you may not define primary key type and directly implement IEntity interface. In practice, you can easily derive from Entity or Entity<TPrimaryKey> classes as shown above (Task and Person). IEntity defines Id property for the Entity.

Repositories

"Mediates between the domain and data mapping layers using a collection-like interface for accessing domain objects" (Martin Fowler) [3]. Repositories, in practice, are used to perform database operations for domain objects (Entities or Value Types).

Generally, a seperated repository is used for each Entity (or Aggregate Root).
ASP.NET Boilerplate provides default repositories for each entity (we will see
how to use default repositories). If we need to
define additional methods, we can extend IRepository interface. I extended it for Task
repository:

It's good to define an interface for each Repository. Thus, we can seperate interface from implementation.
IRepository interface defines most-common methods for repositories:

It defines basic CRUD methods. So, all repositories are automatically implement all these methods. In addition to standard base methods, you can add methods specific to this repository, as I defined GetAllWithPeople method.

About namespaces

When you investigate source code of the sample application, you'll see that classes packaged by intention and domain, related classes/interfaces/enums are in same namespace instead of packaging by infrastructure. I would place Task class to TaskSystem.Entities namespace, ITaskRepository to TaskSystem.Repositories namespace, TaskState to TaskSystem.Enums namespace and so on... Instead, I placed all of these classes to TTaskSystem.Tasks namespace since all of these are related to each other. This is more appropriate to nature of Domain Driven Design. So, I think it's not a good practice to place all Entities to TaskSystem.Entities namespace. Some of you may not think like that. I can understand they since I was doing it like that until short time ago. But I did see the problems and I strongly advice to place related classes/interfaces/enums to same namespace, maybe different assemblies but the same namespace. You can read "The pitfalls of Infrastructure-Driven Packaging" section of Domain Driven Design [2] book of Eric Evans.

Infrastructure layer

"Provides generic technical capabilities that support the higher layers" (Eric Evans). It's used to implement abstractions of your application using third-party libraries & frameworks such as Object-Relational Mapping. In this application, I'll use Infrastructure Layer for:

Creating database migration system using FluentMigrator.

Implementing Repositories and mapping Entities with NHibernate and FluentNHibernate.

Database Migrations

"Evolutionary Database Design: Over the last few years we've developed a number of techniques that allow a database design to evolve as an application develops. This is a very important capability for agile methodologies." Martin Fowler says in his web site [3]. Database migration is an important technique to support this idea. It's very hard to maintain an application's database in more than one production environment without such techniques. Even if you've only one live system, it's critical.

FluentMigrator [4] is a good tool for database migrations. It supports most common database systems. Here, my migration codes for Person and Task tables.

In FluentMigrator, a migration is defined in a class derived from Migration. AutoReversingMigration is a shortcut if your migration can be automatically rolled back. A migration class should has MigrationAttribute. It defines version number of the migration class. All migrations are applied ordered by this version number. It can be any long number. I use a number that identify the migration class's creation date plus an incremental value for same day (Example: for second migration class in 24 April 2014, version is '2014042402'). It's completely up to you. Only important thing is their relative order.

FluentMigrator stores latest applied version number in a table in the database. So, it applies only migrations those are bigger than the version of the database. By default, it uses 'VersionInfo' table. If you want to change the table name, you can create such a class:

For a shortcut, ABP template includes RunMigrations.bat file. After I compile the project in Debug mode, I run the "RunMigrations.bat":

As you see, two migration files are executed and tables are created:

For more information on FluentMigrator, see it's web site [4].

Entity mappings

In order to get/store Entities into database, we should map Entities with database tables. NHibernate has several options to accomplish that. Here, I'll use manual Fluent Mapping (You can use conventional auto-mapping, see FluentNHibernate's web site [5]):

NhRepositoryBase implements all methods those are defined in IRepository interface. So, you must only implement your custom methods as I implemented for GetAllWithPeople.

GetAll() method returns IQueryable<TEntity>, so you can write additional conditions until invoke ToList().

No need to define or implement a repository for an entity if standard
repository methods are enough for this entity. So, I did not implemented
repository for Person entity.

Application layer

"Defines the jobs the software is supposed to do and directs the expressive domain objects to work out problems" (Eric Evans). Application layer does not include domain information and business rules in an ideal application (this may not be possible in the real life but we should minimize it). It mediates between presentation layer and domain layer.

Application services and Data Transfer Objects (DTOs)

Application services provide the functionality of the application layer. An application service method gets data transfer objects as arguments and returns a data transfer object. Directly returning Entities (or other domain object) has many problems (Like data hiding, serialization and lazy loading problems). I strongly recommend to not get/return Entities or any other domain objects from application services. They should only ger/return DTOs. Thus, Presentation layer is completely isolated from Domain layer.

All application services implement IApplicationService by convention. It ensures dependency injection and provides some built-in features of ABP (like validation,
audit logging and authorization). I defined only one method, named GetAllPeople() and returns a DTO named GetAllPeopleOutput. I name DTOs as like that: method name plus Input or Output postfix. See GetAllPeopleOutput class:

PersonAppService gets IRepository<Person> as argument in it's constructor. ABP's built-in dependency injection system handles it using Castle Windsor. All repositories and application services are automatically registered to IOC (Inversion of Control) container as transient objects. So, you're not thinking on DI details.
Also, ABP can create a standard repository for an entity without defining or
implementing a repository.

GetAllPeople() method simply gets a list of all people (using ABP's out of the box implementation) from database and converts it to list of PersonDto objects using AutoMapper [6] library. AutoMapper makes it incredibly easy to map one class to another using conventions (and configurations if needed).
ABP's MapTo extension method uses AutoMapper internally to convert it.

Mapper.CreateMap<Person, PersonDto>();

To get more informatin about AutoMapper, see it's web site [6]. Other application service is TaskAppService implemented as below:

In the UpdateTask method, I'm getting the Task Entity from task repository and setting changed properties. State or/and AssignedPersonId might be changed. Notice that I did not call _taskRepository.Update or any other method to save changes to database. Because, an application service method is a unit of work as default in ASP.NET Boilerplate. For a unit of work method, it basically opens a database connection and begins transaction at the beginning of the method and saves all changes (commits the transaction) to database at the end of the method automatically. It rollbacks the transaction if an Exception is thrown in the execution of the method. If a unit of work method calls another unit of work method, they use the same transaction. First called unit of work method handles connection and transaction management automatically.

To read more about unit of work system in ASP.NET Boilerplate, see documentation.

DTO Validation

Validation is an important and critical but a little tedious concept in
application development. ABP provides infrastructure to make validation easier
and nicer. Validating the user input is an application-layer task. An
application service method should validate inputs and throw exceptions if given
input is not valid. ASP.NET MVC and Web API has built-in validation system that
can be achived using data annotations (like Required). But an Application
service is a plain class, not derived from Controller. Fortunately, ABP provides
similar mechanism for ordinary application service methods (using Castle Dynamic
proxies and interception):

In this input DTO, only the Description property is required. ABP automatically checks it before calling the application service method and throws exception if it's null or empty. All of validation attributes in System.ComponentModel.DataAnnotations namespace can be used here. If these standard attributes are not enough for you, you can implement ICustomValidate:

One more thing: ABP checks if input parameter of a service method is null. So, you don't need to write guard clauses for that.

I advice to create seperated input and output classes for each application service method even it has only one input argument. This is good when extending the application by adding other arguments to this method. It provides a way of adding parameters to the application service method without breaking existing clients.

Dynamic Web API Controllers

Application services are consumed by Presentation Layer. In a Single-Page application, all datas are sent/received using AJAX between javascript and the server. ABP extremely simplifies calling an application service method from javascript. How it does this? Let me to explain...

An application service can not directly called by javascript. We may use ASP.NET Web API to expose services to clients (There are many other frameworks for that such as Web Services, WCF, SignalR and so on). So, there may be such a flow:

Javascript calls a Web API controller's action via AJAX, the Web API controller's action then calls corresponding application service's method, gets result and returns to the client. This is pretty robotic. ABP automates this and can dynamically create a Web API controller for an application service. Here the all code to create Web API controllers for my Application Services: task service and person service:

Thus, all methods of task and person application services are exposed to clients using ASP.NET Web API (ABP's fluent dynamic controller creation API supports hiding a method from Web API
or selecting specific application services, try it yourself). In the Presentation Layer section, we will see how to call these Web API controllers with ABP's dynamic javascript proxies.

Presentation layer

"Responsible for showing information to the user and interpreting user's commands" (Eric Evans). The most obvious layer of the DDD is the Presentation Layer since we can see it, we can click it :).

Single page applications

Wikipedia says about SPA:

A single-page application (SPA), also known as single-page interface (SPI), is a web application or web site that fits on a single web page with the goal of providing a more fluid user experience akin to a desktop application.

In an SPA, either all necessary code – HTML, JavaScript, and CSS – is retrieved with a single page load, or the appropriate resources are dynamically loaded and added to the page as necessary, usually in response to user actions. The page does not reload at any point in the process, nor does control transfer to another page, although modern web technologies (such as those included in HTML5) can provide the perception and navigability of separate logical pages in the application. Interaction with the single page application often involves dynamic communication with the web server behind the scenes.

There are many frameworks and libraries those provide an infrastructure to build SPAs. ASP.NET Boilerplate can work with any SPA framework but provides simple infrastructure to work with DurandalJs and AngularJs easier (See same application developed with AngularJs).

Durandal [7] is one of these frameworks and I think it's is a very successful open source project. It's built on successful and mostly used projects: jQuery (used for DOM manipulation and AJAX), knockout.js (used for MVVM, binding javascript models with HTML) and require.js (used to manage javascript dependencies and loading javascript from server dynamically). For more information and rich documentation, visit to Durandal's web site.

Views and ViewModels

In Durandal, a part of a page consists of a view and a viewmodel.
In ABP's startup template, there are three views: layout, home and about. Layout provides menu and container for pages. home and about are views loaded dynamically into page. I changed views and models in order to create my Simple Task System application. After changing views, here the files of all view and viewmodels:

I have a layout and two-views: task list and new task. Let's begin to investigate views.

Task list

In the task list, there is a list of all tasks with task description, assigned person and creation date. There is a combobox to filter all/avtice/completed tasks. Completed tasks are shown as gray (with an OK icon), active tasks are shown as bold (with a minus icon). The only completed task is the "Complete the Codeproject article!" that's assigned to me. Thus, you can read this article :)

Let me to start with the view model. A ViewModel is used to communicate with the server to perform user actions (listing tasks, changing combobox, clicking the icon to change status of the task) and provide a model to show in the view.

First line calls require.js's define function to register the module and declare dependencies. A dependency is generally another module (even maybe a view model). 'service!tasksystem/task' is a special syntax of ABP that reference to the dynamic Web API controller for task application service (remember how I defined the task service in Dynamic Web API Controllers section). getTasks function is dynamically created by ABP.

Second parameter of define function is the module itself. It should be a function that defines the module. It's parameters are automatically filled by Durandal using your dependency list.

that.tasks is a knockout observable array. It's created using knockout.mapping function. that.localize is a function to be used for localization. It's a feature of ABP to localize texts dynamically in javascript (Will be detailed in Localization section). that.selectedTaskState is an observable that is binded to the combobox to show all/active/completed tasks.

activate is a special function of Durandal. This function is called automatically by Durandal when this view is activated. So, we can write some codes to run when user enters the view.

In the refreshTasks method, I called Task Application Service's getTasks method to load tasks from server. To call an application service from javascript is that easy through ABP's dynamic Web API controller and dynamic javascript client proxies. getTasks function gets same arguments of TaskAppService.GetTasks. The function will return a jQuery promise, so you can write a done handler to get return value the GetTasks method of the task application service. taskService.getTasks also handles errors and shows error message to the user if needed. If the done handler is called, you can be sure that there is no error. In the done handler, I added retrived tasks to the that.task observable array.

changeTaskState is also pretty similar. It's used to change a task's state from active to completed or vice verse. In the done handler, you can see usages of localization and notification APIs.

Like a ViewModel is a javascript file, a View is an HTML file. In this HTML file, you can bind ViewModel to HTML elements. ASP.NET Boilerplates moves this one step further by allowing to define Views as Razor Views: dynamic cshtml files instead of static html files. Thus, you can write C# code to create views. See the tasklist view:

This view is simply designed to work with Twitter Bootstrap. CSS classes are bootstrap's classes. But this is not important. There are two important points here:

First: We can use @L("TaskList") to get a localized string. L method is defined in AbpWebViewPage class (See SimpleTaskSystemWebViewPageBase class that is derived from AbpWebViewPage). You can use L shortcut of LocalizationHelper.GetString(...) in views (See Localization section for details). Since this is a Razor View, we can directly use C# code in the view. Thus, we can create dynamic HTML in the server side. Remember that this View will be loaded only one time since this is a SPA!

Second: We can use fields of the javascript ViewModel using knockout data-bind atribute (like data-bind="foreach: tasks") and other javascript methods (like abp.utils.formatString). Thus, we can create dynamic HTML in the client side. See "click: $parent.changeTaskState", this is used to bind click event of the icon to the changeTaskState function in the javascript ViewModel code. As similar, we're binding change event of the combobox to refreshTasks function. For more information, see knockout.js web site.

New task

"New Task" view is relatively simple. There is a task description and an optional person selection:

canActivate is a special function of Durandal. In this function, you can return true/false to allow/prevent to enter to the page. Durandal also accept a promise. In this case, it waits result of the promise to decide to activate the view or not. Your promise should return true/false. ABP overrides this behaviour to accept promises any other data type beside true/false. Thus, we can directly return promises returned from dynamic javascript proxies of ABP (as shown in canActivate method above).

attached is also another special function of Durandal that is called when your view is attached to DOM (Document Object Model) and safe to manipulate it.

saveTask is used to save given task to the server. It first validates the form and then calls taskService.createTask function (Remember that this function is automatically and dynamically created by ABP and it returns a promise). Here, you see two API calls of ABP. abp.notify.info is used to show notifications after save task to the server. abp.ui.setBusy is used to set a DOM element as busy (shows loading indicator and blocks the UI element, all view in this case). It accepts a promise and cancels busy when promise returned (either fail or success). ABP uses several jQuery plug-ins for that.

Localization

ABP provides a strong and flexible localization system. You can store your localization texts in resource files, XML files or even in a custom source. In this section, I'll show using XML files. Simple Task System project includes XML files in the Localization folder:

It's a simple XML file includes name-value pairs for all localizable texts.
culture attribute defines culture of the file. There is also an XML file for
Turkish (tr) localization in the solution. Localization files should be
registered to ABP in order to be usable in the C# and javascript:

A localization source must be a unique name (SimpleTaskSystem
here). Thus, different sources (stored in different format and data sources) can be used in the application. XmlLocalizationSource also needs a folder (/Localization/SimpleTaskSystem
here) to read localization files.

Then we can get localized texts when we need. In C#, we have two option to get a localizaed text:

It returns the localized text in current language (by using CurrentUICulture of the current thread). There are also overrides to get text in a specific culture. There is a similar API in the javascript to get localized texts:

Javascript API

There are some common functionallity every application needs in client side, in javascript. For example: to show a success notification, to block ui elements, to show a message box and so on. There are many libraries (jQuery plugins) exists for that. But all they have different APIs. ASP.NET Boilerplate defines some common APIs for such tasks. So, if you want to change notification plug-in later, you'll only implement a simple API. Also, jQuery plug-ins can directly implement ABP APIs. Instead of directly call plug-in's notification API, you can call ABP's notification API. Here, I'll explain some of the APIs.

Logging API

When you want to write some simple log in the client, you can use console.log('...') API as you know. But it's not supported by all browsers and your script may be broken. So, you should check it first. Also, you may want to write logs somewhere else. ABP defines safe logging functions:

Also, you can change log level by setting abp.log.level to one of abp.log.levels (ex: abp.log.levels.INFO to do not write debug logs). These functions write logs to console by default. But you can override this behaviour easily.

Notification API

We love to show some fancy auto-disappearing notifications when something happens, like when an item is saved or a problem occured. ABP defines APIs for that:

setBusy can take a promise as second
argument to automatically call clearBusy when promise completed. See newtask ViewModel in the sample project (and in the article) for usage.

Others

Other useful APIs will be added in the future to ABP to standardize common tasks. There are also some utility function for common usage (as abp.utils.formatString that works like string.Format in C#).

NOTE: If you want to implement these APIs, implement they in seperate files and include this seperate js file to your page after abp.js.

More

Module System

ASP.NET Boilerplate is designed to be modular. It provides infrastructure to create common modules those can be used in different applications. A module can depend on other modules. An application is composed by modules. A module is an assembly that includes a module class derived from AbpModule. In the sample application explained in this article, all layers are defined as seperated modules. For example, application layer define a module like that:

///<summary>/// 'Application layer module' for this project.
///</summary>[DependsOn(typeof(SimpleTaskSystemCoreModule))]
publicclass SimpleTaskSystemApplicationModule : AbpModule
{
publicoverridevoid Initialize()
{
//This code is used to register classes to dependency injection system for this assembly using conventions.
IocManager.RegisterAssemblyByConvention(Assembly.GetExecutingAssembly());
//We must declare mappings to be able to use AutoMapper
DtoMappings.Map();
}
}

ASP.NET Boilerplate calls modules PreInitialize, Initialize and PostInitialize methods respectively on applicatin startup. If module A depends on module B, module B is initialized before module A. Exact order of all methods: PreInitialize-B, PreInitialize-A, Initialize-B, Initialize-A, PostInitialize-B and PostInitialize-A. This is true for all dependency graph.

Initialize is the method where dependency injection configuration should be placed. Here, you see this module registers all classes in it's assembly as conventional (see next section). Then it maps classes using AutoMapper library (it's specific to this application). This module also defines dependencies (application layer depends only domain (core) layer of the application).

Dependency injection and conventions

ASP.NET Boilerplate almost makes invisible of using the dependency injection system when you write your application by following best practices and some conventions. It automatically registers all Repositories, Domain Services, Application Services, MVC Controllers and Web API Controllers automatically. For example, you may have a IPersonAppService interface and a PersonAppService class that implements it:

ASP.NET Boilerplate automatically registers it since it implements IApplicationService interface (It's just an empty interface). It's registered as transient (created instance per usage). When you inject (using constructor injection) IPersonAppService interface to a class, a PersonAppService object is created and passed into constructor automatically. See detailed documentation on Dependency Injection and it's implementation in ASP.NET Boilerplate.

About Angularjs & EntityFramework sample

Summary

In this article, I introduced a new application framework: ASP.NET Boilerplate. It's a starting point to develop modern web applications using best practices and most popular tools. Since it's pretty new, there may be some missing concepts. But it does not restrict you. You can get it a start point and buıild your application. It's new and being developed and extended. I'm actively using it in my company in the production.

You can write bug reports, issues and feature requests to the github page (https://github.com/aspnetboilerplate/aspnetboilerplate/issues). Since it's an open source project, you can fork it and send pull requests to contribute to the ABP source code. I want it to be a start point for all we .NET developers, so, it will be good to develop it together.

Share

About the Author

I have started programming at 14 years old using Pascal as hobby. Then I interested in web development (HTML, JavaScript, ASP...) before university.

I graduated from Sakarya University Computer Engineering. At university, I learned C++, Visual Basic.NET, C#, ASP.NET and Java. I partly implemented ARP, IP and TCP protocols in Java as my final term project.

Now, I am working on Windows and web based software development mostly using Microsoft technologies in my own company.

Comments and Discussions

As you said in the "About Namespaces" section: "But I did see the problems and I strongly advice to place related classes/interfaces/enums to same namespace"

Can you please let me know what's the problem? I have read the "The pitfalls of Infrastructure-Driven Packaging", but as what I can see, the reason not to split into different packages(or namespaces) is because the code no longer reveals the model and it'll be harder to understand the single concept.

I wanted to quickly cover off several assumptions before we get started: install (requisites, tools required), configure, an running

quickly. Target will be an “go and ready” sample. Maybe better an real application sample

Mindly notes:

Any good getting started with it, about it? step by step in 10 minutes?

IMHO, better samples for minimize learning curve are real applications with full source code and good patterns and practices

Full source code sample REAL application? not Demo, only real applications?
Like for small to medium applications development, but open source, if you can sharing or maybe another real project or production-

ready application using.

main influences, are full of innovative ideas that can free our minds to explore new techniques, patterns and paradigms.

You want to use technologies that allow for rapid development, constant iteration, maximal efficiency, speed, robustness and more.

You want to be lean and you want to be agile. You want to use technologies that will help you succeed in the short and long term.

In my case I have db already defined so I can't use Id property which is inherited from Entity Class to become PK of my tables and on the same time I need to use repository pattern of boilerplate. So I public [NotMapped] override int Id{ get;set;} and achieved the boilerplate repository functions, inherited Entity etc. but now I have scaffolding problem, I have added dbcontext by using IDBSet. Still I'm unable to create view using model. it gives model configuration error.Looking forward to hear from you.Sohaib.

I saw in the article history that you'd upgraded your sample project quite a few times to the new release of ABP.

Could you please write a section for upgrading the project with ABP?For instance, our projects created now is based on ABP version released today.When ABP upgrades to use new technology and we want to keep our projects up with the new version?What's the best practice for us to write code which is ready for ABP upgrading?

What is missing or I don't know how to find it is declaring the dependencies without needing to reference the module that it depends on (e.g. config file). In my case I need communication between UI (Web) project and Entity Framework project but I don't want to have a reference of web project because that will restrict the ability to be implement with some other UI project. I need to configure some values in web project that EF project could read, for instance should it DropCreateDatabaseIfModelChanges and is it in compilation debug mode, which both would be read from Web.config.

The UserRepository is being injected, I can get the CurrenUser but cannot get any lazy loaded properties here in a Controller. Why? Any ideas to fix this?I read a lot about Castle proxies, Dynamic Proxies but they all too sophisticated for me.

I'm trying to create unit tests with Jasmin to test my angular controllers. However, none of the ABP application services are available because they are generated and loaded dynamically with calling AbpServiceProxies/GetAll API method. This means I cannot reference them with for example:

<referencepath="path-to-my-services.js"/>

I have to mock each of my ABP application service, or copy-paste the return of the mentioned GetAll API method.Is there any other solution for this?

Hi,I'm trying to recreate the sample project (Task) so that I get a better idea how the system works.I've already done with all the core things and services and when my page loads a list of tasks are queried with Ajax successfully. However the data-bind attributes doesn't seem to work at all. What am I missing?Thanks!