예제 #1
0
        private static ParameterModel[] CreateParameterModels(CloudStorageAccount account, FunctionInstanceSnapshot snapshot)
        {
            List <ParameterModel> models = new List <ParameterModel>();

            IDictionary <string, FunctionInstanceArgument> parameters    = snapshot.Arguments;
            IDictionary <string, ParameterLog>             parameterLogs = LogAnalysis.GetParameterLogs(account, snapshot);

            foreach (KeyValuePair <string, FunctionInstanceArgument> parameter in parameters)
            {
                string name = parameter.Key;
                FunctionInstanceArgument argument = parameter.Value;
                ParameterLog             log;

                if (parameterLogs != null && parameterLogs.ContainsKey(name))
                {
                    log = parameterLogs[name];
                }
                else
                {
                    log = null;
                }

                LogAnalysis.AddParameterModels(name, argument, log, snapshot, models);
            }

            return(models.ToArray());
        }
예제 #2
0
        private static ParameterModel[] CreateParameterModels(CloudStorageAccount account, FunctionInstanceSnapshot snapshot)
        {
            List <ParameterModel> models = new List <ParameterModel>();

            // It's important that we order any virtual parameters (e.g. Singleton parameters) to the end
            // so they don't interfere with actual function parameter ordering
            var parameters = snapshot.Arguments.OrderBy(p => p.Value.IsVirtualParameter);
            IDictionary <string, ParameterLog> parameterLogs = LogAnalysis.GetParameterLogs(account, snapshot);

            foreach (KeyValuePair <string, FunctionInstanceArgument> parameter in parameters)
            {
                string name = parameter.Key;
                FunctionInstanceArgument argument = parameter.Value;
                ParameterLog             log;

                if (parameterLogs != null && parameterLogs.ContainsKey(name))
                {
                    log = parameterLogs[name];
                }
                else
                {
                    log = null;
                }

                LogAnalysis.AddParameterModels(name, argument, log, snapshot, models);
            }

            return(models.ToArray());
        }