Ejemplo n.º 1
0
 public void CloneParameters(CodeParameterDeclarationExpressionCollection source, CodeParameterDeclarationExpressionCollection dest)
 {
     dest.Clear();
     foreach (CodeParam param in source)
     {
         dest.Add(CloneParam(param));
     }
 }
        private void RemoveDuplicateParameters(CodeParameterDeclarationExpressionCollection parameters)
        {
            var toKeep = parameters
                         .Cast <CodeParameterDeclarationExpression>()
                         .GroupBy(x => new { x.Name })
                         .SelectMany(x => x.Take(1))
                         .ToArray();

            parameters.Clear();

            foreach (var objToKeep in toKeep)
            {
                parameters.Add(objToKeep);
            }
        }