servicestack

MonoTouch: Using ServiceStack caused JIT error?

眉间皱痕 提交于 2019-12-11 11:06:54
问题 I am using the MonoTouch build of Service Stack from https://github.com/ServiceStack/ServiceStack/tree/master/release/latest/MonoTouch When run on a iPad, I get a JIT error. I thought MonoTouch took care of that in the build? Attempting to JIT compile method 'ServiceStack.Text.Json.JsonReader`1<Common.AppCategoryEnum>:GetParseFn ()' while running with --aot-only. I use the DLLS: ServiceStack.Common.dll ServiceStack.Interface.dll ServiceStack.Text.dll And only this single call: new

ServiceStack.Text.JsonSerializer.DeserializeFromString<T>() fails to deserialize if string contains \n's

混江龙づ霸主 提交于 2019-12-11 10:55:56
问题 Trying: T obj = JsonSerializer.DeserializeFromString<T>(jsonData); on a string that has several \n 's throughout it. JayRock's library successfully deserializes this like: T obj = (T)JsonConvert.Import(typeof(T), jsonData); Is this a bug, or do I need to manually strip out newlines? 回答1: The problem I ran into wasn't the \n's, but instead was the lack of public properties on my DTO's. RE: Can ServiceStack.Text deserialize JSON to a custom generic type? 回答2: The debugger preview popup shows

ServiceStack - How To Compress Requests From Client

眉间皱痕 提交于 2019-12-11 10:06:35
问题 Does anyone have any examples of how to setup ServiceStack on the client side to automatically compress all requests using GZip? I've found good examples of how to automatically decompress requests on the server side using a Module but nothing for the client side. Thanks! 回答1: ServiceStack's Service Clients automatically sends the Accept-Encoding: gzip,deflate HTTP Header indicating it accepts a GZip or Deflated response. It can be disabled with: client.DisableAutoCompression = true; If the

ServiceStack: Upgrade to 5.4.1 gives me ReflectionTypeLoadException on ServiceStack.Common

好久不见. 提交于 2019-12-11 10:05:35
问题 I was running ServiceStack 5.2.0, until I upgraded due to this answer. After doing that, and running the application again, I now get ReflectionTypeLoadException , when processing the Assembly ServiceStack.Common, Version=5.0.0.0, Culture=neutral, PublicKeyToken=02c12cbda47e6587 . In my code, for some reason irrelevant to this question, I do the following: Type[] typeArray = assembly.GetTypes(); and when I do, I get this error: {"Method 'GetKeyValuePairs' in type 'ServiceStack

ServiceStack Server Sent Events/push notification (SSE)

两盒软妹~` 提交于 2019-12-11 10:02:29
问题 Can anyone guide me as how server sent events works in servicestack framework. I want to get response to load asynchronously. If a response contains a list of items, I want the list of items to populate while the service is processing the list. Suppose, I have a response object, company which contains list of permanent employee and list of contractual employee which comes from two different sources. I want the response object to populate the list of employees which is processed first. I don't

How does ServiceStack Redis function in retrieving data

老子叫甜甜 提交于 2019-12-11 09:49:24
问题 Not sure if it's the best title for the question... maybe someone could rename it for me? My question is regarding performance of reading and combining data in c# ServiceStack wrapper for Redis and how the calls work internally. I will explain two scenarios that will hopefully yield in a final result. One scenario has the list of category id's attached to the Transaction so that the Category can be stored independently. Question : My end goal is to retrieve all transactions that have category

Can I host different ServiceStack services at different URLs

旧城冷巷雨未停 提交于 2019-12-11 09:44:29
问题 When configuring ServiceStack, I have to specify a location (URL) at which my services will be available. E.g. when running side-by-side with WebApi: <location path="svc"> <system.web> <httpHandlers> <add path="*" type="ServiceStack..." verb="*"/> </httpHandlers> </system.web> Now all my ServiceStack-based services will be available at http://server/webapp/svc/{route} . After reading the page about modularizing services into plugins, I was wondering: is it possible to register the service(s)

Change the virtual path for static content

女生的网名这么多〃 提交于 2019-12-11 09:18:38
问题 I'm working on a project that is a self hosted service stack site hosting 2 separate "Plugins". I am trying to set it up so that I can serve up my static content files from the plugin directories so that I can edit them on the fly while debugging and not require a rebuild to copy the chages to the bin directory. I already have this working for the my razor files by adding this: Plugins.Add(new RazorFormat { VirtualPathProvider = new FileSystemVirtualPathProvider(this, "../../../Project1") });

RFC 6749 Authentication with ServiceStack

对着背影说爱祢 提交于 2019-12-11 09:18:09
问题 It looks like ServiceStack only accepts session-based authentication. I was reading through https://github.com/ServiceStack/ServiceStack/wiki/Authentication-and-authorization and I couldn't find anything describing how to do what I want. I also looked at http://enehana.nohea.com/general/customizing-iauthprovider-for-servicestack-net-step-by-step/ but that also is session-based. What I would like to do, is very similar to how WebAPI works with Individual User Accounts. I want to send this to

How can I clear all Instances of type X in ServiceStack Redis Client

旧城冷巷雨未停 提交于 2019-12-11 09:09:53
问题 I want to clear all X instance from Redis Db for testing. But I could not find redisClient.As().CLEAR() method? How can I clear all X instance? I can add X Instances using var client=new PooledRedisClientManager(ConfigurationManager.AppSettings["RedisServer"]).GetClient(); X x=new X(); client.As<X>().Store(x); all x instances are added to Db as urn:X:x.id pattern. 回答1: The IRedisTypedClient implements the generic IBasicPersistenceProvider<T> interface which has a DeleteAll() method. So what