-
Notifications
You must be signed in to change notification settings - Fork 4
4. Scaffold The Backend
codeplanner edited this page Dec 30, 2014
·
2 revisions
When you are happy with your domain model it is time to generate all the code for repositories and services.
In our sample we only had the Person class, but you will probably have a lot more classes in your domain model in real-life... And the bigger the model the more time you save.
To get all files generated you open up the Package Manager Console and then type
PM> Scaffold Bob.ScaffoldBackend
This command will look for all classes that inherit the PersistentEntity class and generate
- Repository Interface
- Service Interface
- Repository
- Service
- ViewModel
For each class in the model.
The output in the Package Manager Console will show something like this for each class
PM> Scaffold Bob.ScaffoldBackend
Collecting properties for the model, this might take a while
Added Repository at PersonRepository.cs
Added IRepository of Person output at Interfaces\Data\IPersonRepository.cs
Added Service at PersonService.cs
Added IService of Person output at Interfaces\Service\IPersonService.cs
Collecting properties for the model, this might take a while
Name,string Age,int
Added ViewModel for Person ViewModel\PersonViewModel.cs
Next step setup Ninject IoC
