servicestack

When to use Requirejs and when to use bundled javascript?

…衆ロ難τιáo~ 提交于 2019-11-26 15:10:31
问题 This may be a dumb question for web guys. But I am a little confused over this. Now, I have an application where I am using a couple of Javascript files to perform different tasks. Now, I am using Javascript bundler to combine and minify all the files. So, at runtime there will be only one app.min.js file. Now, Requirejs is used to load modules or files at runtime. So, the question is if I already have all things in one file, then do I need requirejs? Or what is a use case scenario where I

When ServiceStack authentication fails, do not redirect?

∥☆過路亽.° 提交于 2019-11-26 14:09:08
问题 We're building a ServiceStack API which will use Basic authentication. I've currently set up the auth in my AppHost as follows: var authDb = new OrmLiteConnectionFactory("Server=(...);", true, MySqlDialectProvider.Instance); var authRepo = new OrmLiteAuthRepository(authDb); authRepo.CreateMissingTables(); container.Register<ICacheClient>(c => new MemoryCacheClient()); container.Register<IUserAuthRepository>(c => authRepo); Plugins.Add( new AuthFeature(() => new AuthUserSession(), new

ServiceStack and returning a stream

谁都会走 提交于 2019-11-26 13:53:54
问题 I have just started to use ServiceStack which is an amazing library. However, I have a business requirement where we must return xml and json where the xml must be in specific format. For example we have existing customers that expect xml of the format: <service name="service1" type="audio" .../> so basically a bunch of attributes. I know that ServiceStack uses concepts of DTOs and uses the DataContractSerializer which returns xml elements rather than in the form above with xml attributes. I

ServiceStack razor default page

♀尐吖头ヾ 提交于 2019-11-26 13:51:49
问题 Say I have 2 pages /NotADefault.cshtml /Views/Default.cshtml Question 1. Now I run it, page A always gets called implicitly as start-up default page no matter what I name it. Page B will only be called when I explicitly call localhost/View/Default. How do I make page B (the one in View folder) my default page? Question 2. I also have NotADefaultService.cs and DefaultService.cs . I give each page a Service class at the back. However, when page A is called NotADefaultService.cs never gets

servicestack REST API and CORS

十年热恋 提交于 2019-11-26 12:53:28
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 mythz 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: CorsFeature(allowedOrigins:"*", allowedMethods:"GET, POST, PUT, DELETE, OPTIONS", allowedHeaders:"Content-Type

How can I extend ServiceStack Authentication

。_饼干妹妹 提交于 2019-11-26 12:19:33
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,StudentId] mutual-reference D) Extend XService, XFeature or ?? PS: How about to add Owner and Type

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

与世无争的帅哥 提交于 2019-11-26 12:07:58
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, or do we need to integrate documentation from both aspects separately to get the full picture?. I'm just

How to omit Get only properties in servicestack json serializer?

只愿长相守 提交于 2019-11-26 10:36:21
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 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 { get; set; } public string Name { get; set; } [IgnoreDataMember] public string IsIgnored { get; set; } }

ServiceStack: RESTful Resource Versioning

 ̄綄美尐妖づ 提交于 2019-11-26 07:56:53
问题 I\'ve taken a read to the Advantages of message based web services article and am wondering if there is there a recommended style/practice to versioning Restful resources in ServiceStack? The different versions could render different responses or have different input parameters in the Request DTO. I\'m leaning toward a URL type versioning (i.e /v1/movies/{Id}), but I have seen other practices that set the version in the HTTP headers (i.e Content-Type: application/vnd.company.myapp-v2). I\'m

ServiceStack vs ASP.Net Web API [closed]

我怕爱的太早我们不能终老 提交于 2019-11-26 06:50:18
问题 I want to write a new REST style API and have looked at ServiceStack and quite like it. However, I have seen that Microsoft has released the ASP.Net Web API project as part of the new MVC 4 beta. Has anyone looked at the new Web API project? Can you give any pros/cons of each system? 回答1: They have very similar use-cases, as the lead maintainer for the ServiceStack project I have a good insight into ServiceStack's advantages and the many natural benefits of its message-based design.