Exemplo n.º 1
0
        public List <Method> Serialize(IMethodImpl method, DocumentConfig documentConfig, IRegion region = null)
        {
            List <Method> methods = new List <Method>();

            foreach (var type in method.Types)
            {
                var methodConfig = new MethodConfig(method, this, type, documentConfig, region);

                if (!methodConfig.MethodRequired)
                {
                    continue;
                }

                methods.Add(BuildMethod(methodConfig));

                //Query methods don't require any other request types
                if (methodConfig.MethodType == MethodType.Query || methodConfig.MethodType == MethodType.Watch)
                {
                    break;
                }

                if (methodConfig.NeedsTokenInterfaceOverload)
                {
                    var tokenConfig = methodConfig.GetTokenOverloadConfig();

                    methods.Add(BuildMethod(tokenConfig));
                }
            }

            return(methods);
        }