private void WriteFieldMask(StringBuilder builder, IMessage value) { System.Collections.Generic.IList <string> paths = (System.Collections.Generic.IList <string>)value.Descriptor.Fields[FieldMask.PathsFieldNumber].Accessor.GetValue(value); //System.Collections.Generic.IEnumerable<string> theEyeEnumerable = paths.Cast<string>(); //System.Collections.Generic.IEnumerable<string> theSelected = theEyeEnumerable.Select(JsonFormatter.ToCamelCase); List <string> whatever = new List <string>(); foreach (string something in paths.Cast <string>()) { whatever.Add(ToCamelCase(something)); } //System.Collections.Generic.List<string> whatever = new System.Collections.Generic.List<string>(); //foreach(string something in paths.Cast<string>().Select(JsonFormatter.ToCamelCase).ToArray<string>()) whatever.Add(something); this.AppendEscapedString(builder, string.Join(",", whatever.ToArray())); }