c# - IEnumerable from object which is IEnumrable -
I have a way that takes relates to one of those rules when the value is Of course, if the value is throw an exception Any ideas, how can I get rid of it? something like Although I think this bill may fit: (object value) and it's
string with some difficult rules
IEnumerable . In this case, I have to process each item on the following:
public string convert (object value) {var valuetype = value.GetType (); If (value-typeGateInterface ("ILIT")! = Null) {var e = (INMONABLE; Lt; Object & gt;) value; Return E.Count () == 0? "": E. Selection (o = & gt; Convert (o)). Total ("", (c, s) => c + s);
list & lt; String & gt; , for example, line
var e = (IEnumerable & lt; Object & gt;) value;
Unable to remove type of object 'System.Collections.Generic.List`1 [System.String]' to type For 'System.Collections.Generic.IEnumerable`1 [System.Object]'.
var e = ((IEnumerable) value) .Cast & lt; Object & gt; ()
convert public static string (object value) {if (value is string) Return value. Toasting (); Var data = value as IEnumerable; If (Data == empty) return string. Empty; // I think you forgot this one var e = data Cast & lt; Object & gt; (); Return E.Count () == 0? String Empty: E. Selection (o = & gt; Convert (o)). Total ("", (c, s) => c + s); }
Comments
Post a Comment