示例#1
0
        public static TResult Run <TResult>(MySession session, MyWebService service, Func <TResult> function)
        {
            //Reconnect
            service.Connect(session.Site);
            service.Login(session.User, session.Pass);

            //Execute the webserivce call
            TResult result = function.Invoke();

            //Disconnect
            service.Disconnect();

            return(result);
        }
示例#2
0
        public static TResult Run <TResult>(MySession session, MyWebService service, ICommand <TResult> command)
        {
            //Reconnect
            service.Connect(session.Site);
            service.Login(session.User, session.Pass);

            //Execute the webserivce call
            TResult result = command.Execute();

            //Disconnect
            service.Disconnect();

            return(result);
        }