-
Notifications
You must be signed in to change notification settings - Fork 13
Client Providers (Client Side Example)
Ali Yousefi edited this page Nov 30, 2017
·
10 revisions
After create your server side project you must create your client side project for connect to your server.
In the client side you just need your interface service not your service class that have implemented methods. So I think this is better for you if your service interface project be separated from your service class projects because you dont need create your service interfaces again for your client side this will make easy way for you to manage your services when you just add reference from service interface project to your client project.
//your client connector that will be connect to your server
ClientProvider provider = new ClientProvider();
//connect to your server must have full address that your server is listen
provider.Connect("http://localhost:1132/SignalGoTestService");
//register your service interfacce for client
var testServerModel = provider.RegisterClientServiceInterfaceWrapper<ITestServerModel>();
//call server method and return value from your server to client
var result = testServerModel.HelloWorld("ali");
//print your result to console
Console.WriteLine(result.Item1);SignalGo have another way to register your service interface like:
var testServerModel = provider.RegisterClientServiceDynamic<ITestServerModel>();
//or
var testServerModel = provider.RegisterClientServiceDynamic("TestServerModel");