Questions tagged [servicestack]

ServiceStack is Fast, Simple and Versatile message-based Web Services and MQ Framework for .NET and .NET Core

ServiceStack is a simple, fast, versatile and highly-productive full-featured Web and Web Services Framework that's thoughtfully-architected to reduce artificial complexity and promote remote services best-practices with a message-based design that allows for maximum re-use that can leverage an integrated Service Gateway for the creation of loosely-coupled Modularized Service Architectures. ServiceStack Services are consumable via an array of built-in fast data formats (inc. JSON, XML, CSV, JSV, ProtoBuf, MsgPack and Wire as well as XSD/WSDL for SOAP endpoints and Rabbit MQ, Redis MQ, Azure Service Bus and Amazon SQS MQ hosts.

Its design and simplicity focus offers an unparalleled suite of productivity features that can be declaratively enabled without code, from creating fully queryable Web API's with just a single Typed Request DTO with Auto Query supporting every major RDBMS to the built-in support for Auto Batched Requests or effortlessly enabling rich HTTP Caching and Encrypted Messaging for all your existing services via Plugins.

Your same Services also serve as the Controller in ServiceStack's Smart Razor Views reducing the effort to serve both Web and Single Page Apps as well as Rich Desktop and Mobile Clients that are able to deliver instant interactive experiences using ServiceStack's real-time Server Events.

ServiceStack Services also maximize productivity for consumers providing an instant end-to-end typed API without code-gen enabling the most productive development experience for developing .NET to .NET Web Services.

ServiceStack Links

ServiceStack Examples and Live Demos

ServiceStack Downloads

5244 questions
22
votes
3 answers

How to retrieve auto-incremented Id in ServiceStack OrmLite?

For a table that has an identity: [AutoIncrement] public int Id { get; set;} When inserting a new row into the database, what is the best way to retrieve the Id of the object? For example: db.Insert<> (new User()); The value of the Id is…
Dylan
  • 1,919
  • 3
  • 27
  • 51
21
votes
3 answers

How to get Swagger to send API key as a http instead of in the URL

I am using swagger with servicestack but I am getting a 401 unauthorised error from my /resources URL becuase it requires an API key. Unless I'm mistaken, according to the documentation I should set supportHeaderParams to true as well as the…
Rob Bird
  • 3,764
  • 2
  • 28
  • 38
21
votes
3 answers

Getting ServiceStack to retain type information

I'm using ServiceStack to serialize and deserialize some objects to JSON. Consider this example: public class Container { public Animal Animal { get; set; } } public class Animal { } public class Dog : Animal { public void Speak() {…
larspars
  • 1,640
  • 1
  • 15
  • 30
21
votes
3 answers

ServiceStack default format

I would like to set ServiceStack's default format to JSON, as opposed to the HTML formatted response it normally returns when a service is accessed from a browser. I know this can be specified on each request by sending a ?format=json parameter or…
Jarrod
  • 1,415
  • 2
  • 14
  • 22
20
votes
1 answer

Servicestack - architecture & reusing POCOs for everything

I refer to ServiceStack documentation reg use of POCOs: Since it promotes clean, re-usable code, ServiceStack has always encouraged the use of code-first POCO's for just about everything. i.e. the same POCO can be used: In Request and Response…
Mark
  • 2,175
  • 20
  • 23
20
votes
4 answers

ServiceStack.NET Windows Authentication (NTLM) in ASP.NET MVC

How to implement Windows Authentication in a ServiceStack project build on ASP.NET MVC4? I started with a global Request-Filter added in the AppHost: private void ConfigureAuth(Funq.Container container) { this.RequestFilters.Add((httpReq,…
MVCible
  • 391
  • 3
  • 14
19
votes
1 answer

How to get ServiceStack to format Guids with dashes when using JSON?

Using ServiceStack to return a simple User object from a Post. The user object is pretty simple: public class User { public Guid Id { get; set; } public string Username { get; set; } } The post method: public override object OnPost(User…
19
votes
5 answers

How to register multiple IDbConnectionFactory instances using Funq in ServiceStack.net

How would you go about registering diferent IDbConnectionFactory instances in Funq and then access them directly within your services? Do named instances somehow come into play here? Is this the best approach to take when using different…
Jeff Mitchell
  • 1,459
  • 1
  • 17
  • 33
19
votes
3 answers

Disabling ASP.NET HttpHandler response caching

Background I'm in the midst of comparing the performance of NancyFx and ServiceStack.NET running under IIS 7 (testing on a Windows 7 host). Both are insanely fast - testing locally each framework processes over 10,000+ req/sec, with ServiceStack…
Kevin Pullin
  • 13,122
  • 3
  • 24
  • 33
19
votes
2 answers

use SignalR inside Service Stack REST API service

Is it possible to use SignalR inside of a service stack project? We currently are using service stack for our REST web API. We have been pleased overall with its architecture, flexibility, etc. Now we are exploring ways to communicate back with our…
JDBet
  • 253
  • 2
  • 5
19
votes
1 answer

How can I extend ServiceStack Authentication

I'm using ServiceStack Authentication with ServiceStack.OrmLite (SqlServer). I have different User types like Student, Teacher, Principal.. All user types will have relation with other Db Tables. What is the best practise to implement it? A) Add…
Oguz Karadenizli
  • 3,449
  • 6
  • 38
  • 73
18
votes
2 answers

How can I prevent race conditions using Redis?

I used Only Redis as my DB, and my client is ServiceStack.Redis. The thing is, if two concurrent request need to update one key, then it can be a race condition. For example A: int a = Get key MULTI a = a - 100 Set key a EXEC B: int a =…
Allan Yang
  • 181
  • 1
  • 1
  • 4
18
votes
3 answers

ServiceStack - Is there a way to force all serialized Dates to use a specific DateTimeKind?

I have a POCO like this: public class BlogEntry { public string Title { get; set; } public DateTime Date { get; set; } } Most of the time it's being hydrated from Entity Framework, but it can and will be used outside of Entity…
ryan1234
  • 7,237
  • 6
  • 25
  • 36
18
votes
3 answers

Redis IOException: "Existing connection forcibly closed by remote host" using ServiceStack C# client

We have the following setup: Redis 2.6 on Ubuntu Linux 12.04LTE on a RackspaceCloud 8GB instance with the following settings: daemonize yes pidfile /var/run/redis_6379.pid port 6379 timeout 300 loglevel notice logfile…
Bernardo
  • 1,030
  • 1
  • 12
  • 22
18
votes
2 answers

ServiceStack How to call my service from code

how can i call my own service? I have a service that use other services to compose information. I want to call other services within the code of this service. How can I do that?
Tom
  • 15,781
  • 14
  • 69
  • 111