Inspired by microservices, a lightweight framework that looks like a rabbit, based on NET Core 2.0 Standard 2 core library
With the continuous development of the website system, the complexity of the architecture will change from MVC->SOA->microservices, from simple to complex, from centralized to distributed. The introduction of the service framework is SOA->microservice process The problem that must be solved. In the face of the increase in services, the deployment of service distribution, the mutual call between services and services, have to use the service framework to solve. Based on NET Core 2.0 Standard 2 development, DotEasy.RPC supports transparent calls from the client to the server, just as simple as an implementation call to an interface.
http://www.cnblogs.com/SteveLee/
for the server and add the code in you Web API Core, implement microservice middleware injection.
app.UseConsulServerExtensions(Configuration,
collection =>
{
collection.AddSingleton<IProxyService, ProxyImpl>();
},
typeof(AuthorizationServerProvider)
);
and in the console application, you can use interface proxy the implement client code.
using (var proxy = ClientProxy.Generate<IProxyService>(new Uri("http://127.0.0.1:8500")))
{
Console.WriteLine($@"{proxy.Sync(1)}");
Console.WriteLine($@"{proxy.Async(1).Result}");
Console.WriteLine($@"{proxy.GetDictionaryAsync().Result["key"]}");
}