This repository contains a sample line of business application written in DotVVM, based on the Microsoft sample Northwind database.
-
Go to the
db
folder. -
If you don't have Micrososft SQL Server Express edition installed (
.\SQLEXPRESS
), edit thenorthwind.cmd
file and change the server name. You will have change the connection string in the application too (src/NorthwindStore.DAL/AppDbContext.cs
). -
Run the
northwind.cmd
. It should create the database calledNorthwind
with all the data.
-
Install the DotVVM for Visual Studio extension if you don't have it.
-
Join the DotVVM Business Pack Beta Program to get the beta version.
-
Make sure to set up the DotVVM Private Nuget Feed.
-
Open the solution (
src/NorthwindStore.sln
) in Visual Studio 2017.
The application tries to explain how DotVVM should be used in larger applications.
-
The
DAL
project contains theEntity Framework Core
model describing the SQL database. -
The
BL
project contains the infrastructure for the application logic. It utilizes the Riganti Utils Infrastructure library. From the DotVVM perspective, only the classes in theFacades
andDTO
directories are interesting, because they contain all methods and model classes the application needs. DotVVM doesn't have any specific requirements on the business layer, however it is a good idea to have the application logic and DTO objects in a separate class library project. -
The
App
project contains the application itself.-
The
RegionList
andRegionDetail
pages demonstrate how to do a simple CRUD functionality, by just using the facade. -
The
CategoryList
andCategoryDetail
pages demonstrate how to generalize the CRUD using a generic class and interfaces for facades. -
The
ProductList
andProductDetail
pages shows how to customize the CRUD with combobox selectors, custom controls and modal dialogs. -
The
Default
page shows how to use authentication and authorization. -
Using custom presenters to serve images.
-
And finally, the Application Insights and MiniProfiler integration is demonstrated.
-
The sample uses the following libraries:
- Entity Framework Core
- AutoMapper
- Castle Windsor
- Riganti Utils Infrastructure