servicestack

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

自作多情 提交于 2019-11-26 06:25:12
问题 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

Servicestack - architecture & reusing POCOs for everything

流过昼夜 提交于 2019-11-26 06:00:03
问题 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 &

ServiceStack new service side by side ASP.NET MVC website

拟墨画扇 提交于 2019-11-26 03:59:35
In the examples for ServiceStack I don't see a single application that is ASP.NET MVC website first and then made ServiceStack service second. Let's take a very simple ASP.NET MVC web application that renders products through Views. It uses controllers, views, models and viewmodels. Let's say we have a model of Product which gets persisted into a document DB. Let's assume we have a viewmodel of ProductViewModel which gets mapped from Product and display within MVC Razor View/PartialView. so this is a web side of things..now let's assume we want to add a service returning products to various

ServiceStack Request DTO design

牧云@^-^@ 提交于 2019-11-26 03:27:35
I am a .Net developer used to develop web application on Microsoft Technologies. I am trying to educate myself to understand REST approach for web services. So far i am loving the ServiceStack framework. But sometimes i find myself to write services in a fashion that i am used to with WCF. So I have a question which bugs me. I have 2 request DTO's so 2 services like these: [Route("/bookinglimit", "GET")] [Authenticate] public class GetBookingLimit : IReturn<GetBookingLimitResponse> { public int Id { get; set; } } public class GetBookingLimitResponse { public int Id { get; set; } public int

servicestack REST API and CORS

纵然是瞬间 提交于 2019-11-26 03:07:21
问题 Anyone know if the servicestack framework can be used to create CORS REST services? I\'ve been banging my haed against the WCF REST stuff for days now - utterly useless. Thanks 回答1: Using the CorsFeature plugin Enabling Global CORS support We now have a CorsFeature which wraps CORS headers into the Plugin below to make it much easier to add CORS support to your ServiceStack services. Commonly this is now all that's needed: Plugins.Add(new CorsFeature()); Which uses the default values:

How can I extend ServiceStack Authentication

左心房为你撑大大i 提交于 2019-11-26 02:56:17
问题 I\'m using ServiceStack Authentication with ServiceStack.OrmLite (SqlServer). I have different User types like Student, Teacher, Principal.. All user types will have relation with other Db Tables. What is the best practise to implement it? A) Add necessary fields to UserAuth table and make Black Magic.(After creation of UserAuth add necessary extra informations to table Manually) B) Student:UserAuth (All fields in UserAuth will be cloned) C) Student.UserAuthId, UserAuth.Meta[UserType.Student

ServiceStack.Net Redis: Storing Related Objects vs. Related Object Ids

巧了我就是萌 提交于 2019-11-26 02:51:57
问题 My team has decided to work with Redis via the ServiceStack.net Redis Client as an underlying repository for a new high-volume website we\'re working on. I\'m not really sure where to look for documentation for this question (either for general Redis docs or specific ServiceStack.Net docs or both) - is there actually a definitive source for documentation on how to implement a Redis via ServiceStack.Net that includes all you need to know about both Redis concepts and ServiceStack.Net concepts,

How to omit Get only properties in servicestack json serializer?

一个人想着一个人 提交于 2019-11-26 02:14:35
问题 I have an object which I am de-serializing using ToJson<>() method from ServiceStack.Text namespace. How to omit all the GET only propeties during serialization? Is there any attribute like [Ignore] or something that I can decorate my properties with, so that they can be omitted? Thanks 回答1: ServiceStack's Text serializers follows .NET's DataContract serializer behavior, which means you can ignore data members by using the opt-out [IgnoreDataMember] attribute public class Poco { public int Id

ServiceStack new service side by side ASP.NET MVC website

为君一笑 提交于 2019-11-26 01:14:42
问题 In the examples for ServiceStack I don\'t see a single application that is ASP.NET MVC website first and then made ServiceStack service second. Let\'s take a very simple ASP.NET MVC web application that renders products through Views. It uses controllers, views, models and viewmodels. Let\'s say we have a model of Product which gets persisted into a document DB. Let\'s assume we have a viewmodel of ProductViewModel which gets mapped from Product and display within MVC Razor View/PartialView.

ServiceStack Request DTO design

纵然是瞬间 提交于 2019-11-26 01:13:37
问题 I am a .Net developer used to develop web application on Microsoft Technologies. I am trying to educate myself to understand REST approach for web services. So far i am loving the ServiceStack framework. But sometimes i find myself to write services in a fashion that i am used to with WCF. So I have a question which bugs me. I have 2 request DTO\'s so 2 services like these: [Route(\"/bookinglimit\", \"GET\")] [Authenticate] public class GetBookingLimit : IReturn<GetBookingLimitResponse> {