servicestack

Are these the main differences between RestSharp and ServiceStack's Client Code? [closed]

拟墨画扇 提交于 2019-11-27 11:27:56
I have been unable to make a definitive choice and was hoping that somebody (or a combination of a couple of people) could point out the differences between using RestSharp versus ServiceStack's client services (keeping in mind that I am already using ServiceStack for my service). Here is what I have so far (differences only). The list is fairly small as they are indeed very similar: ServiceStack Pros Fluent Validation from my already created service POCO objects One API for both client and service Code reads better (i.e. Get<>(), Post<>()) Cons Some of my strings must be written out (i.e. If

OData with ServiceStack? [closed]

Deadly 提交于 2019-11-27 11:03:05
I just saw ServiceStack and I am considering building a service with it. Is it possible to serve OData feeds with service stack so that I'd be able to expose IQueryable and query it from the client? Edit ServiceStack has now added Auto Query which is our approach to enabling data-driven services that avoids the pitfalls and anti-patterns promoted by OData . Will ServiceStack support OData. No. Not directly anyway. If anyone sees any value in OData they are free to add the necessary functionality as an optional Plugin - but it will never be built into the ServiceStack core. Poor development

How does ServiceStack handle concurrent calls?

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-27 10:36:47
问题 How does ServiceStack handle concurrent calls? I'm looking for equivalent of ConcurrencyMode.Multiple in WCF. My WCF services have this attribute set: [ServiceBehavior(InstanceContextMode = InstanceContextMode.PerCall, ConcurrencyMode = ConcurrencyMode.Multiple, UseSynchronizationContext = false)] Do I need to enable anything in ServiceStack to get it to use multiple threads for each call? 回答1: ServiceStack doesn't have a configurable concurrency model per AppHost, it is dependent upon the

When to use Requirejs and when to use bundled javascript?

旧街凉风 提交于 2019-11-27 10:27:10
This may be a dumb question for web guys. But I am a little confused over this. Now, I have an application where I am using a couple of Javascript files to perform different tasks. Now, I am using Javascript bundler to combine and minify all the files. So, at runtime there will be only one app.min.js file. Now, Requirejs is used to load modules or files at runtime. So, the question is if I already have all things in one file, then do I need requirejs? Or what is a use case scenario where I can use requirejs and/or bundler? Please let me know if any further details are needed. This is a hotly

How can I use a standard ASP.NET session object within ServiceStack service implementation

邮差的信 提交于 2019-11-27 09:53:18
问题 I'm just getting started with ServiceStack and, as a test case, I am looking to rework an existing service which is built using standard ASP.Net handlers. I've managed to get it all working as I want it but have certain aspects which make use of the ASP.Net Session object. I've tried adding IRequiresSessionState into the service interface: public class SessionTestService : RestServiceBase<SessionTest>, IRequiresSessionState { public override object OnPost(SessionTest request) { // Here I want

When ServiceStack authentication fails, do not redirect?

蓝咒 提交于 2019-11-27 08:28:17
We're building a ServiceStack API which will use Basic authentication. I've currently set up the auth in my AppHost as follows: var authDb = new OrmLiteConnectionFactory("Server=(...);", true, MySqlDialectProvider.Instance); var authRepo = new OrmLiteAuthRepository(authDb); authRepo.CreateMissingTables(); container.Register<ICacheClient>(c => new MemoryCacheClient()); container.Register<IUserAuthRepository>(c => authRepo); Plugins.Add( new AuthFeature(() => new AuthUserSession(), new IAuthProvider[] { new BasicAuthProvider() }) ); When doing a request with no Authorization header or the wrong

ServiceStack and returning a stream

给你一囗甜甜゛ 提交于 2019-11-27 07:54:06
I have just started to use ServiceStack which is an amazing library. However, I have a business requirement where we must return xml and json where the xml must be in specific format. For example we have existing customers that expect xml of the format: <service name="service1" type="audio" .../> so basically a bunch of attributes. I know that ServiceStack uses concepts of DTOs and uses the DataContractSerializer which returns xml elements rather than in the form above with xml attributes. I still want to use the DTOs for requests (passing in application/xml or application/json in the Accept

ServiceStack razor default page

拈花ヽ惹草 提交于 2019-11-27 07:52:44
Say I have 2 pages /NotADefault.cshtml /Views/Default.cshtml Question 1. Now I run it, page A always gets called implicitly as start-up default page no matter what I name it. Page B will only be called when I explicitly call localhost/View/Default. How do I make page B (the one in View folder) my default page? Question 2. I also have NotADefaultService.cs and DefaultService.cs . I give each page a Service class at the back. However, when page A is called NotADefaultService.cs never gets called. Only DefaultService.cs gets called when page B is called... My observation is that only the pages in

Is ResponseStatus needed in ServiceStack?

老子叫甜甜 提交于 2019-11-27 05:57:03
问题 Is ResponseStatus needed? The wiki says that we need to have a ResponseStatus property in our response DTO to handle exception serialization: https://github.com/ServiceStack/ServiceStack/wiki/Validation However it looks like ResponseStatus is generated automatically even if there is no ResponseStatus property in the response DTO. Do we need the ResponseStatus property? 回答1: The Error Handling Docs explains how you can control which Services return a populated ResponseStatus DTO, i.e: Error

What is the best way to run ServiceStack on Linux / Mono?

纵然是瞬间 提交于 2019-11-27 05:52:24
Listed on the ServiceStack website it shows that ServiceStack can run on Mono with either: XSP mod_mono FastCgi Console What are these different configurations and which is preferred for Web Services on Mono? Update for Linux From the v4.5.2 Release ServiceStack now supports .NET Core which offers significant performance and stability improvements over Mono that’s derived from a shared cross-platform code-base and supported by Microsoft's well-resourced, active and responsive team. If you’re currently running ServiceStack on Mono, we strongly recommend upgrading to .NET Core to take advantage