linq - Query Object's elements in c# -


I have a problem when I try to get series results in Object C.

I returned the Linq query object and I want to get all the elements in C # (server side) ...

I can not do this and I know Why not!

I tried:

  forech (var x in element) {string titolo = x.title.ToString (); }   

and

  dynamic floating = (dynamic) element; String titolo = temp.title.ToString ();   

and others ....

I can see that the object type is:

  {System.Data.Objects. ObjectQuery & lt; & Lt; & Gt; F__AnonymousType26 & lt ;? Integer, string, string, bool, integer, system.linq.IQueryable & lt ;? & Lt; & Gt; F__AnonymousType25 & LT; String & gt; & Gt; & Gt; & Gt; }   

How can I get value of an object?

Thanks a lot!

If you are searching for properties related to an element, then you can do something like this: < /p>

  foreach (element in var item) {foreach (property in property. Gatetype) GetProperties ()} {// property.Name = property name // property.GetValue (element, Empty) - becomes the value of the property (system, object). }}    

Comments

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

memcached - Django cache performance -

java : convert string value to int -