servicestack

Service stack arrayof to be removed

徘徊边缘 提交于 2020-01-15 11:23:12
问题 I have my dto defined as [DataContract(Name = "Tuner", Namespace = "")] public class TunerDto { [DataMember(Name = "TunerName", Order = 1)] public string TunerName { get; set; } } and I am returning an array of theses which gives my XML in the body as: <ArrayOfTuner> <Tuner> <Name>Test1</Name> </Tuner> ... </ArrayOfTuner> Is there a way of replacing ArrayOfTuner with Tuners instead? 回答1: You should wrap your array in a class, so you can add a [CollectionDataContract] attribute to modify the

How do I hide routes I don't control from ServiceStack's SwaggerFeature?

﹥>﹥吖頭↗ 提交于 2020-01-14 14:53:28
问题 In my example, I'm using the ApiKeyAuthProvider and RegistrationFeature, which both add new routes to my metadata. I want to use swagger as our main documentation for these services, but I don't want things like /AssignRoles showing up there. I was exploring the OperationFilter, but I'm having a hard time figuring out what to do there. What can I do to hide these unwanted routes? 回答1: You can add .NET Attributes at runtime to control the visibility of services you don't control with

How do I hide routes I don't control from ServiceStack's SwaggerFeature?

笑着哭i 提交于 2020-01-14 14:53:05
问题 In my example, I'm using the ApiKeyAuthProvider and RegistrationFeature, which both add new routes to my metadata. I want to use swagger as our main documentation for these services, but I don't want things like /AssignRoles showing up there. I was exploring the OperationFilter, but I'm having a hard time figuring out what to do there. What can I do to hide these unwanted routes? 回答1: You can add .NET Attributes at runtime to control the visibility of services you don't control with

Can ServiceStack JsonServiceClient send a get request to https w/self signed certificate?

会有一股神秘感。 提交于 2020-01-14 13:54:07
问题 I making a call to get using JsonServiceClient to serialize my request object. My server is using https and I created a self signed certificate. It would appear that an exception is thrown when the client tries to connect and the server responds that the certificate is not trusted and that the identity of the server has not been verified. In a browser I can ignore this message. How can I get the JsonService client to work with https and a self signed certificate? 回答1: I think this is a

Keep a self hosted servicestack service open as a docker swarm service without using console readline or readkey

你。 提交于 2020-01-14 12:55:09
问题 I have a console application written in C# using servicestack that has the following form: static void Main(string[] args) { //Some service setup code here Console.ReadKey(); } This code works fine when run on windows as a console. The implementation is almost exactly https://github.com/ServiceStack/ServiceStack/wiki/Self-hosting as this is a test project I then compile this project using mono on linux and build into a docker file. I have no problems running up a container based on this image

Keep a self hosted servicestack service open as a docker swarm service without using console readline or readkey

拜拜、爱过 提交于 2020-01-14 12:55:07
问题 I have a console application written in C# using servicestack that has the following form: static void Main(string[] args) { //Some service setup code here Console.ReadKey(); } This code works fine when run on windows as a console. The implementation is almost exactly https://github.com/ServiceStack/ServiceStack/wiki/Self-hosting as this is a test project I then compile this project using mono on linux and build into a docker file. I have no problems running up a container based on this image

How do I iterate across all sessions in ServiceStack?

て烟熏妆下的殇ゞ 提交于 2020-01-14 04:22:06
问题 Our application has companies and uses in each company. Each company has X number of licenses. We are using a typed session class, and that class contains the id of the company along with other user information. I need to add to our authentication process, a check to see if the current login will exceed a company's licenses. I believe that the way to do this is to get a count of all company Ids across all sessions that match the companyId of the user currently trying to log in, and compare

How do I iterate across all sessions in ServiceStack?

橙三吉。 提交于 2020-01-14 04:22:05
问题 Our application has companies and uses in each company. Each company has X number of licenses. We are using a typed session class, and that class contains the id of the company along with other user information. I need to add to our authentication process, a check to see if the current login will exceed a company's licenses. I believe that the way to do this is to get a count of all company Ids across all sessions that match the companyId of the user currently trying to log in, and compare

.NET(C#)有哪些主流的ORM框架

拈花ヽ惹草 提交于 2020-01-14 02:09:13
前言 在以前的一篇文章中,为大家分享了《 什么是ORM?为什么用ORM?浅析ORM的使用及利弊 》。那么,在目前的.NET(C#)的世界里,有哪些主流的ORM,SqlSugar,Dapper,Entity Framework(EF)还是ServiceStack.OrmLite? 或者是你还有更好的ORM推荐呢? 如果有的话,不防也一起分享给大家。 .NET(C#)主流ORM总揽 今天这篇文章分享几款收集的目前.NET(C#)中比较流行的ORM框架,比如(以下框架均为开源框架,托管于github上): SqlSugar (国内) Dos.ORM (国内) Chloe (国内) StackExchange/Dapper (国外) Entity Framework (EF) (国外) NHibernate (国外) ServiceStack/ServiceStack.OrmLite (国外) linq2db (国外) Massive (国外) PetaPoco (国外) SqlSugar SqlSugar是国人开发者开发的一款基于.NET的ORM框架,是可以运行在.NET 4.+ & .NET CORE的高性能、轻量级 ORM框架,众多.NET框架中最容易使用的数据库访问技术。 特点: 开源、免费 国内开发者开发、维护; 支持.NET Core; 支持主流数据库,如:SQL Server

How to set up handlers in RedMQ from events raised in my domain

五迷三道 提交于 2020-01-12 07:26:07
问题 Just getting my head around message queues and Redis MQ, excellent framework. I understand that you have to use .RegisterHandler(...) to determine which handler will process the type of message/event that is in the message queue. So if I have EventA, EventB etc should I have one Service which handles each of those Events, like : public class DomainService : Service { public object Any(EventA eventA) {...} public object Any(EventB eventA) {...} } So these should be only queue/redis list