3

I got the week off from work to learn servicestack and I am in awe of its simplicity, power, and speed.

I am a pluralsight subscriber and I am going through the Jon Somnez course which is great and as far as I can tell is using the new service stack api.

However, the examples in the pluralsight course are extremely simple and as such I am looking for a working example THAT USES the new API. I see that the wiki is up to date and that is very helpful...but I was hoping to find a working implementation that uses the new API and it seems that all of the examples I have downloaded or browsed are using the old API.

IS there a new working example/implementation (vs solution and projects.) that uses the new API yet?

If I can sneak in another question. Is there a recommendation (hopefully in the example project you can point me to) that explains a best practice for structuring your servicestack API project. (DTOs in a folder, services in a folder, response objects in a folder ??)

Thanks.

Seth Spearman
  • 6,710
  • 16
  • 60
  • 105

1 Answers1

3

Update: ServiceStack Live Demo's and Examples are now being published on LiveDemos GitHub Project.


Most of the examples in ServiceStack.Examples has switched over to use the New API and are mostly available to demo on the servicestack.net homepage.

ServiceStack.UseCases contain a number of small single-purposed applications that are focused on how to enable specific features for different use-cases.

The SocialBootstrap API deployed at bootstrapapi.apphb.com is an example of an MVC and ServiceStack website together making with all the available authentication options together.

The Razor Rockstars is an example of a stand-alone ServiceStack application that demonstrates its website and HTML capabilities showing how you can add razor and markdown views to existing services to create a website that enhances existing services. There are 3 versions of Razor Rockstars available:

  1. An ASP.NET Host
  2. A Stand-alone Self-hosted using HttpListener
  3. A Windows Service

Another website that's similar in spirit to Razor Rockstars is the Nortwind Database editor which demonstrates how you can enable a full-featured server-side HTML website to enhance your existing services. It includes a full-writeup of how he developed it and its capabilities on the accompanying blog post.

mythz
  • 141,670
  • 29
  • 246
  • 390
  • mythz...thanks for your answer. amazing work you have done. for the record I have looked at the MovieRest example and the Northwind example, and it seems to me that both of them are using the old api? OnGet instead of Get, RestSErviceBase instead of Service, etc. Can you mention a specific example from the suite that is updated? – Seth Spearman Mar 13 '13 at 16:11
  • Not sure where you're seeing that? as [MoviesService](https://github.com/ServiceStack/ServiceStack.Examples/blob/master/src/ServiceStack.MovieRest/MovieService.cs) and [Northwind](https://github.com/ServiceStack/ServiceStack.Examples/blob/master/src/ServiceStack.Northwind/ServiceStack.Northwind.ServiceInterface/CustomerDetailsService.cs) do inherit from the New APIs **Service** class. Tho they were created before the New API so its more a cosmetic change. Look at [this answer for designing a simple Rest Service](http://stackoverflow.com/a/15235822/85785) using the New API. – mythz Mar 13 '13 at 16:27
  • I downloaded from this link... https://github.com/downloads/ServiceStack/ServiceStack.Examples/ServiceStack.Examples-v3.21.zip and it definitely is using the old API. The link you referred to is up to date. Am I using the wrong download link. Seth – Seth Spearman Mar 13 '13 at 16:58
  • Yes that is a very old snapshot as GitHub no longer allows us to add new downloads and will remove the feature entirely soon. It's best to just clone the GitHub repo and work from that. – mythz Mar 13 '13 at 17:15
  • Cool, Whilst I'm going to start going through and removing any references to `/downloads` and encourage everyone to clone the GitHub project instead. – mythz Mar 13 '13 at 17:51
  • I thought I would add...that you can still use SVN to get GitHub sources. I just did an svn co from https://github.com/ServiceStack/ServiceStack.Examples/trunk and it worked great. (No dvcs goodness for me...yet). – Seth Spearman Mar 13 '13 at 18:23
  • --@mythz, I am going to post data to the service, and the service save the data to DB with entity framework. The response is just a status. Is there such an project example available? –  Apr 24 '14 at 00:46