servicestack

Returning Raw Json in ElasticSearch NEST query

不羁岁月 提交于 2019-12-19 02:26:34
问题 I'm doing a small research about a client for elastic search in .net and I found that NEST is one of the most supported solutions for this matter. I was looking at Nest's docummentation and I couldn´t find a way to output a raw json from a query and avoid the serialization into an object, because I'm using angularJs in the front end I don´t want to overload the process of sending the information to the client with some unnecessary steps. ......and also I'd like to know how can I overrdide the

POST to ServiceStack Service and retrieve Location Header

冷暖自知 提交于 2019-12-19 02:25:08
问题 I am trying to POST to my ServiceStack service and retrieve the Location header from the response of my CREATED entity. I am not sure whether using IReturn is valid but I am not sure how to access the Response headers from my client. Can someone help me understand how to interact with the HttpResult properly? There is a test case at the bottom of the code to demonstrate what I want to do. Here's the codz: public class ServiceStackSpike { public class AppHost : AppHostHttpListenerBase { public

ServiceStack no server-side async support

风流意气都作罢 提交于 2019-12-18 17:13:45
问题 A buddy of mine told me in the past he had looked at ServiceStack. Said it looked good but that it had no async support so in his book, it's not an option to use this framework (no good if no async) and I have to sorta agree. Unless ServiceStack has added async, not sure if this is a good choice for me. It makes me wonder a) is stackoverflow truly using this if there is no async? b) if yes to a, then it obviously must be a highly customized version of it that probably DOES have async? I am

Get HttpResult using the JsonServiceClient

与世无争的帅哥 提交于 2019-12-18 17:02:31
问题 I am returning HttpResult from one of the rest service methods using servicestack's new API. Is there a way to get the HttpResult using the JsonServiceClient? For ex: JSonServiceClient.Send<HttpResult>("DELETE","person", new { PersonID = 30 }); I want to inspect the header information from the httpresult. Thanks. 回答1: There's no such thing as a HttpResult client response from a ServiceStack web service. You use a HttpResult to customize the HTTP Response that's returned from your service, e.g

Can't get Visual Studio 2013 browser link working with static html

拟墨画扇 提交于 2019-12-18 16:52:23
问题 I've been having trouble getting Visual Studio's browser link functionality to work consistently. The projects I've tried it in have all used Service Stack and Angular. I've added the handler in the system.webservice section but still nothing. <handlers> <add name="Browser Link for HTML" path="*.html" verb="*" type="System.Web.StaticFileHandler, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" resourceType="File" preCondition="integratedMode" /> </handlers> 回答1:

Do not serialize Entity Framework class references in JSON (ServiceStack.Text library)

自古美人都是妖i 提交于 2019-12-18 13:38:03
问题 As most of the people I've also ran into a problem of circular reference error when serializing (terrible) EF objects to JSON. Doing db.Detach(efObject) helps - but I still get garbage like "EntityKey" outputted. So I was wondering if there is an option (through JsConfig?) to tell serializer to ignore Properties either through name (EntityKey) or through type (EntityReference<T> or EntityCollection<T>)? Or will I be forced to ditch EF alltogether and switch to something better (I do not want

Alternative to servicestack.redis [closed]

梦想与她 提交于 2019-12-18 12:44:46
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 4 years ago . I did an package manager update-package command to update our project to the latest binaries. I almost published it because it passed all the tests until luckily I had found a problem that needed some more debugging. My mouth fell open when I suddenly saw this exception message: The free-quota limit on '6000

How to advance the session timeout in ServiceStack

[亡魂溺海] 提交于 2019-12-18 12:27:22
问题 The authentication, repository and caching providers in ServiceStack provide a simple way to add login sessions to a web application with almost no additional code. I have found that the session timeout for an authentication provider can be configured, for example: new CredentialsAuthProvider { SessionExpiry = TimeSpan.FromMinutes(10) } This provides an expiry from the point of login. If we are developing a secure system that must log a user out after a short time then we would change this

How can I override the XML serialization format on a type by type basis in servicestack

a 夏天 提交于 2019-12-18 09:24:34
问题 I have a type that requires custom XML serialization & deserialization that I want to use as a property on my requestDto For JSON i can use JsConfig.SerializeFn, is there a similar hook for XML? 回答1: ServiceStack uses .NET's XML DataContract serializer under the hood. It is not customizable beyond what is offered by the underlying .NET's Framework implementation. In order to support custom requests you can override the default request handling. ServiceStack's Serialization and Deserialization

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

♀尐吖头ヾ 提交于 2019-12-18 05:27:12
问题 ServiceStack has delivered on EVERYTHING I've thrown at it, except the SAAS (Multi-tenant) use case where single API instance is using several databases of the same schema, one per tenant. These databases, because of legal reasons need to be housed in separate instances. So, my question is this, "Is it possible to change the connection per Request based on meta from a filter? My question is somewhat similar to this one, but with the added twist that each database is the same. Thank you,