servicestack

How to use SSL with HttpListener with an mkbundle'd Mono app

浪尽此生 提交于 2019-12-06 05:12:07
问题 I have a .NET application built with Mono, that I've bundled into a native (Linux) executable using mkbundle . This is so that end users don't need to mess around and install Mono themselves. The application uses ServiceStack, which under the hood uses HttpListener . I need the web services to be exposed over an SSL-enabled HTTP endpoint. Normally, you would run something like httpcfg -add -port 1234 -p12 MyCert.pfx -pwd "MyPass" during configuration (all this really does is copy the

Populating POCO's with ServiceStack.OrmLite

别来无恙 提交于 2019-12-06 05:01:01
Consider the following domain model: class Customer { int id {get;set} string Name {get;set} List<Contact> Contacts {get;set} } class Contact { int id {get;set} string FullName {get;set} List<PhoneNumber> {get;set} } class PhoneNumber { int id {get;set} PhoneType Type {get;set} string Number {get;set} } Customer, Contact & PhoneNumbers are separate entities in our DB. Any Suggestions as to how to populate a full customer with all its linked contacts and the contacts phone numbers in the most efficient way using ORMLite and/or Dapper, with consideration of calls to the db and cpu cycles to map

Service Stack FOSS Exception

自作多情 提交于 2019-12-06 04:18:55
问题 Recently I began development on a Service Stack open source project. Yesterday I passed the 10-free operation limit: The free-quota limit on '10 ServiceStack Operations' has been reached. Please see https://servicestack.net to upgrade to a commercial license I am working under an assumption that there is an exception for open source projects: FOSS Exception It may be that my interpretation of this license is incorrect. In simple terms, how does the FOSS exception work for open source projects

Create table with custom name dynamically and insert with custom table name

一世执手 提交于 2019-12-06 04:07:07
问题 I want to create the table with custom name but I cannot find the sample code. I notice the only way to create table is by generic type like db.CreateTable(). May I know if there is a way to create the table name dynamically instead of using Alias? The reason is because sometime we want to store the same object type into different tables like 2015_january_activity, 2015_february_activity. Apart from this, the db.Insert also very limited to object type. Is there anyway to insert by passing in

ServiceStack: Adding routes dynamically

Deadly 提交于 2019-12-06 03:55:57
问题 I have not tried this yet, but I would like each module (Silverlight) to register its own routes, rather then adding it in application start. Can routes be added to AppHost after application start, or do they all have to be immediatelly registered during Configure step? I am thinking to scan all assemblies at the startup and provide AppHost with all assemblies that implement service stack services, but let each module add its own routes (have not figured out yet exact mechanism. Before I go

Why doesn't the ServiceStack Razor FileSystemWatcher work on Mono + Mac OS X?

女生的网名这么多〃 提交于 2019-12-06 03:22:21
ServiceStack's new support for Razor v2 uses a FileSystemWatcher to detect changes to tracked view files and mark them as invalid so they'll be recompiled at the next request. This is great for debugging as it lets you edit your views and not rebuild/restart your project. On Mono (currently running 3.0.10) on my Mac OS X (Mountain Lion) there is apparently a Mono bug where the FileSystemWatcher doesn't raise Changed events for file changes. Furthermore, it also doesn't raise any events for files in a subdirectory, even if IncludeSubdirectories is set to true. After investigating and testing

Broadcast rabbitMq messages with ServiceStack

不想你离开。 提交于 2019-12-06 02:51:38
Is there way to make method myMessageService.CreateMessageQueueClient().Publish(myMessage); broadcast messages to all receivers? The problem is, that RegisterHandler<T> internally uses the type of T to build the queue name it listens to. So the only chance you have is to go off the track with the following solution by utilizing a custom fanout exchange to multiple queues: var fanoutExchangeName = string.Concat(QueueNames.Exchange, ".", ExchangeType.Fanout); At some point of your system you have to ensure the exchange with the following code: var rabbitMqServer = new RabbitMqServer(); var

How to write a ServiceStack plugin which needs both request and response Dtos

馋奶兔 提交于 2019-12-06 02:48:04
问题 I need to service localized data. All response Dtos which are localized share the same properties. I.e. I defined an interface ( ILocalizedDto ) to mark those Dtos. On the request side, there is a ILocalizedRequest for requests which demand localization. Using IPlugin I already managed to implement the required feature. However I am quite sure that the implementation is not thread safe and additionally I don't know if I could use IHttpRequest.GetHashCode() as identifier for one request

How to use a custom JSON Serializer in Servicestack?

流过昼夜 提交于 2019-12-06 01:02:53
问题 I am wondering how you can use a custom JSON Serializer in ServiceStack. I am aware of the JsConfig.SerializeFn/DeSerializeFn but these seem to always 'JSON.stringify' the result of my custom Serializer. I like to replace Serialization for the whole DTO. The endresult should be something like {"Name":"Greg"} and not "{\"Name\":\"Greg\"}" Is that possible? 回答1: In terms of other hooks in ServiceStack's JSON Serializers there's also JsConfig<T>.RawSerializeFn and JsConfig<T>.RawDeserializeFn

ServiceStack: how to deal with errors?

血红的双手。 提交于 2019-12-05 22:48:43
问题 I'm using ServiceStack with great results so far, except that dealing with errors is seemingly tricky. If something goes wrong during serialization of a message (because I forgot to add a default constructor to the message for example) all the client gets back is a message that the server had an internal error and a status code of 500. Adding a listener to the HttpApplication.Error event in the Global.asax doesn't work as it never gets hit. Neither does Application_Error . Not only is this