Exemplo n.º 1
0
 public override bool TryInvokeMember(InvokeMemberBinder binder, object[] args, out object result)
 {
     result = this.SendDataNoParam(binder.Name, ServiceName, binder.MethodToParameters(x => ClientSerializationHelper.SerializeObject(x), args).ToArray());
     return(true);
 }
Exemplo n.º 2
0
        public override bool TryInvokeMember(InvokeMemberBinder binder, object[] args, out object result)
        {
            Type type = ReturnTypes[binder.Name];

            if (type == typeof(void))
            {
                this.SendDataNoParam(binder.Name, ServiceName, binder.MethodToParameters(x => ClientSerializationHelper.SerializeObject(x), args).ToArray());
                result = null;
            }
            else
            {
                string data = this.SendDataNoParam(binder.Name, ServiceName, binder.MethodToParameters(x => ClientSerializationHelper.SerializeObject(x), args).ToArray()).ToString();
                result = Newtonsoft.Json.JsonConvert.DeserializeObject(data, type);
            }
            return(true);
        }