servicestack

Is it possible to create a cross-database query with ServiceStack ORMLite?

被刻印的时光 ゝ 提交于 2019-12-05 21:52:34
Pretty much summed up in the title. Trying to hit a table in one database and join it to a table in another database on the same server. I would have assumed an attribute for Database that I could decorate the POCO with, but do not see one that would be appropriate. Currently using this syntax: var result = db.Select<Model.Dto>( db.From<Data.Dto1>() .Join<Data.Dto2>(d1, d2) => d1.Id == d2.Id)); There's no specific attribute for specifying an external database but in RDBMS's that support cross-database queries you should be able to use the [Schema] attribute, e.g: [Schema("Server1.Database1.dbo

Service Stack (REST) SOAP and WSDL not working

非 Y 不嫁゛ 提交于 2019-12-05 21:50:10
I implemented ServiceStack Hello World ,every thing is ok,except one important thing. its SOAP11 and SOAP12 and also WSDL not working. when accessing url http://localhost:8082/SOAP11/ for SOAP11 or SOAP12 it says : { "ResponseStatus":{ "ErrorCode":"NotImplementedException", "Message":"The method or operation is not implemented.", "StackTrace":" at ServiceStack.WebHost.Endpoints.Support.EndpointHandlerBase.ProcessRequest(IHttpRequest httpReq, IHttpResponse httpRes, String operationName) in C:\\src\\ServiceStack\\src\\ServiceStack\\WebHost.EndPoints\\Support\\EndpointHandlerBase.cs:line 52\n at

How to get Swagger Plugin working within self hosted servicestack

守給你的承諾、 提交于 2019-12-05 21:40:23
I've re-asked this question with examples provided on github and a drop box download link for anyone that want to run the code themselves : Swagger not working on a self hosted ServiceStack Service I had my servicestack JSON service running inside my website solution, under the '/api/ path, but now I'd like to split out that service stack portion and have it running as a self hosted windows service. My problem is, myself and the other developers find the Swagger plugin very useful for testing purposes, but now that it's self hosted it appears the HTTPHandler is setup only for only handling the

How to get ServiceStack authentication to work? (with iPhone clients)

我怕爱的太早我们不能终老 提交于 2019-12-05 21:36:51
问题 We have hired a contractor who is writing an iPhone app for us, and I'm starting to write the backend service for it with ServiceStack. I'm struggling with authorization in general: what kind of authorization to use and how to implement it. I don't know much about ServiceStack, HTTP and authorization (yet).. I've read this, but I'm probably still doing something wrong. I will use usernames and passwords from an existing legacy database to authenticate (but nothing else - no registering of new

Implementing WebHooks with ServiceStack

强颜欢笑 提交于 2019-12-05 18:09:17
问题 I'm currently working on a REST service allowing to control and monitor some physical devices. The corresponding REST API is largely based on principles and ideas you can find in the following article: "Controlling and Monitoring Devices with REST". The monitored and controlled devices can generate some events to which clients must be able to subscribe. My idea was to implement that part using RESTful WebHooks. So whenever an event arises, my service makes a REST API callback to each

ServiceStack OrmLite How can I achieve automatic setting of foreign key/related properties?

房东的猫 提交于 2019-12-05 17:19:10
I have created the following example to test Foreign Keys and up to this point, it works well. What I would like to be able to do, is use this framework that I built to set the property of the relationship and have it Save the child object when the Parent is saved and automatically set the PrimaryKey and Foreign Key. The DataManager class exposes the Connection public class DataManager { DataManager() { OrmLiteConfig.DialectProvider = SqliteDialect.Provider; ConnectionString = SqliteFileDb; updateTables(); } private void updateTables() { using (var dbConn = OpenDbConnection()) { dbConn

How to use Dapper in ServiceStack

妖精的绣舞 提交于 2019-12-05 16:42:59
问题 Currently, I am using OrmLite for DB operations. I am also planning to use Dapper ORM, but can anyone point me how to integrate DapperORM in ServiceStack. Do I need to implement both IDbConnection and IDbConnectionFactory interfaces with Dapper and plugin into the container. public override void Configure(Container container) { container.Register<IDbConnectionFactory>( c => new OrmLiteConnectionFactory(ConfigurationManager.ConnectionStrings["default"].ConnectionString, SqlServerDialect

Configure ServiceStack Base URI

删除回忆录丶 提交于 2019-12-05 16:39:50
I'm creating a self-hosted REST service using service stack & AppHostHttpListenerBase. I'd like to use a base URI for my services (e.g. "api") like so: http://myserver/api/service1/param http://myserver/api/service2/param How do I do this without defining "api" in each of my routes. In IIS, I can set a virtual directory to isolate the services, but how do I do this when self-hosting? ServiceStack's HttpListener hosts expects to be hosted a the root / path as the normal use-case is to have each self-hosted service available on different custom ports. Since it doesn't currently support hosting

How to get HttpContext in servicestack.net

混江龙づ霸主 提交于 2019-12-05 16:08:24
I am unable to switch to all of service stack's new providers, authentication, etc. So, I am running a hybrid scenario and that works great. To get the current user in service, I do this: private IPrincipal CurrentUser() { var context = HttpContext.Current; if (context != null) { var user = context.User; if (user != null) { if (!user.Identity.IsAuthenticated) return null; return user; } } return null; } Is there an alternative/better way to get the current http context directly from a service? I would prefer to not have to use the HttpContext.Current if I do not have to? paaschpa This is

ServiceStack: Get email from auth session when authenticating with Google

会有一股神秘感。 提交于 2019-12-05 15:51:05
I am authenticating users via GoogleOpenIdOAuthProvider. I need to access the email address of the user that logged in. I have attempted to implement the Using Typed Sessions in ServiceStack code as-is. So, I created a base class that my service inherits from: public abstract class AppServiceBase : Service { //private CustomUserSession userSession; protected CustomUserSession UserSession { get { return base.SessionAs<CustomUserSession>(); } } } public class CustomUserSession : AuthUserSession { public string CustomId { get; set; } } The service has the [Authenticate] attribute on it. In my