2
0
mirror of https://github.com/esiur/esiur-dotnet.git synced 2025-06-26 21:13:13 +00:00
This commit is contained in:
2022-08-25 02:19:42 +03:00
parent acc2a546cf
commit ca859b3433
5 changed files with 8 additions and 32 deletions

View File

@ -55,10 +55,6 @@ namespace Test
static async Task Main(string[] args)
{
var ppp = GetOrderedProperties(typeof(MyChildResource)).ToArray();
var childMethods = typeof(MyChildResource).GetMembers( BindingFlags.Public | BindingFlags.DeclaredOnly | BindingFlags.Instance);
var parentMethods = typeof(MyResource).GetMethods(BindingFlags.Public | BindingFlags.DeclaredOnly | BindingFlags.Instance);
// Create stores to keep objects.
var system = await Warehouse.Put("sys", new MemoryStore());
var server = await Warehouse.Put("sys/server", new DistributedServer());
@ -106,12 +102,10 @@ namespace Test
private static async void TestClient(IResource local)
{
var con = await Warehouse.Get<DistributedConnection>("iip://localhost", new { AutoReconnect = true });
//dynamic remote = await Warehouse.Get<IResource>("iip://localhost/sys/service", new { AutoReconnect = true });
//var con = remote.Connection as DistributedConnection;
dynamic remote = await con.Get("sys/service");
var pcall = await con.Call("Hello", "whats up ?", DateTime.UtcNow);
@ -229,26 +223,6 @@ namespace Test
public static IEnumerable<PropertyInfo> GetOrderedProperties(Type type)
{
Dictionary<Type, int> lookup = new Dictionary<Type, int>();
int count = 0;
lookup[type] = count++;
Type parent = type.BaseType;
while (parent != null)
{
lookup[parent] = count;
count++;
parent = parent.BaseType;
}
return type.GetProperties()
.OrderByDescending(prop => lookup[prop.DeclaringType]);
}
}