Example #1
0
        public static WebsocketMessage Data(string key, object data)
        {
            var query = new WebsocketMessage();

            query.AddData(key, data);
            return(query);
        }
Example #2
0
        public static WebsocketMessage Request(string controller, string action, string eventName)
        {
            var query = new WebsocketMessage();

            if (string.IsNullOrWhiteSpace(controller))
            {
                throw new ArgumentNullException(nameof(controller));
            }

            if (string.IsNullOrWhiteSpace(action))
            {
                throw new ArgumentNullException(nameof(action));
            }

            query.AddData("action", new[] { controller, action });
            query.AddData("meta", Data("event", eventName));
            return(query);
        }