servicestack

Does ServiceStack support binary responses?

孤者浪人 提交于 2019-11-26 22:31:42
Is there any mechanism in ServiceStack services to return streaming/large binary data? WCF's MTOM support is awkward but effective in returning large amounts of data without text conversion overhead. mythz From a birds-eye view ServiceStack can return any of: Any DTO object -> serialized to Response ContentType HttpResult, HttpError, CompressedResult (IHttpResult) for Customized HTTP response The following types are not converted and get written directly to the Response Stream: String Stream IStreamWriter byte[] - with the application/octet-stream Content Type. Details In addition to returning

Is it possible to serve HTML pages with ServiceStack?

和自甴很熟 提交于 2019-11-26 22:31:17
问题 I'm evaluating ServiceStack for use in a Windows Service to host REST services. So far, it's excellent and way outperforms WCF. Not to mention its much easier to use. The Windows Services mentioned above need to be able to provide a simple HTML page to serve as a "dashboard". ServiceStack would of course be used to provide json data for the dashboard, but what about serving the dashboard page, along with images and js? Would this be possible? I would rather not host full-blown ASP.Net and

Reconnecting to Servicestack session in an asp.net MVC4 application

拜拜、爱过 提交于 2019-11-26 21:56:51
问题 I have an asp.net mvc4 web application that is consuming data data from an API written in C# and hosted on a Linux machine w/ Apache / mod_mono The client application is written in C#/asp.net - It runs on a different web server, also Linux / Apache / mod_mono. I'm not sure if those details are important in this case, but I figured any background may help. The question leading up to this one: AppHostBase instance not set - Helped me gain quite a bit more understanding of how this all fits

Preventing StackOverflowException while serializing Entity Framework object graph into Json

守給你的承諾、 提交于 2019-11-26 20:46:25
问题 I want to serialize an Entity Framework Self-Tracking Entities full object graph (parent + children in one to many relationships) into Json. For serializing I use ServiceStack.JsonSerializer . This is how my database looks like (for simplicity, I dropped all irrelevant fields): I fetch a full profile graph in this way: public Profile GetUserProfile(Guid userID) { using (var db = new AcmeEntities()) { return db.Profiles.Include("ProfileImages").Single(p => p.UserId == userId); } } The problem

ServiceStack vs ASP.Net Web API

牧云@^-^@ 提交于 2019-11-26 19:10:41
I want to write a new REST style API and have looked at ServiceStack and quite like it. However, I have seen that Microsoft has released the ASP.Net Web API project as part of the new MVC 4 beta. Has anyone looked at the new Web API project? Can you give any pros/cons of each system? mythz They have very similar use-cases, as the lead maintainer for the ServiceStack project I have a good insight into ServiceStack's advantages and the many natural benefits of its message-based design . ServiceStack has been around since 2008 as an OSS-run project from its inception with a single goal of

Should ServiceStack be the service layer in an MVC application or should it call the service layer?

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-26 18:28:11
I'm creating an MVC website and also intend to create a web API for use both within the website and potentially by third parties. From the MVC controllers I'll be calling into a service layer which will contain business logic, act on domain models, perform validation, make infrastructure external service calls etc. The service layer in turn will call into repositories for any database interactions. Now, I like the look of ServiceStack and intend on using it for the Web API - it seems more mature than the ASP.NET MVC 4 Web API . My question is, should I have the ServiceStack API call into my

ServiceStack CORS Feature

谁说胖子不能爱 提交于 2019-11-26 18:27:08
问题 Using the new Service implementation, do I have to provide an Options method for all of my services? Using the old ServiceBase approach, which all my services currently use, OPTIONS returns OK without the Access-Control-Allow-Origin header. Here's an example: https://github.com/JonCanning/SSCors HelloService uses Service GoodbyeService uses ServiceBase 回答1: Because ServiceStack's Old API enforced an interface-based API it only supported GET, POST, PUT, DELETE, PATCH requests. Handling OPTION

Servicestack - architecture & reusing POCOs for everything

不打扰是莪最后的温柔 提交于 2019-11-26 16:00:51
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 DTO's (on client and server) In JSON, JSV and CSV Text Serializers As the data model in OrmLite, db4o and NHibernate As the entities stored in Redis As blobs stored in Caches and Sessions Dropped and executed in MQ's services" I love servicestack & how easy it is to write web services with it. I am trying to understand how best to setup my project & not

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

拜拜、爱过 提交于 2019-11-26 15:35:39
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 5 years ago . 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

OData with ServiceStack? [closed]

风格不统一 提交于 2019-11-26 15:24:24
问题 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? 回答1: 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