This article describes the creation of a simple servicestack-based project.
1. Create a new solution
2. There are 4 project after the creation is complete.
ServiceModel is defined by the request DTO and request DTO, Serviceinterface defines the service implementation. The main logic is inside the interface.
1) Open Servicemodel->type, set up a class station.
2) Build the class getstation in the ServiceModel directory. The URL of the service is accessed.
3) Create class Getstationservice. Any in the Serviceinterface directory to accept the Get,post request. Getstation to get data from the database method, omitted.
4) Open Gloabal.asax, you will see the program entry: New AppHost (). Init (); Open the Apphost file. This is where you register for services.
Public AppHost (): Base ("Busservice", typeof (Getstationservices). Assembly) {
}
Publish your service to IIS. It's done.
ServiceStack Introduction (II)