Hello,
I am getting a anonymous type from Linq Query inside a function.
How can I return the obtained values and use them outside the
function?
Do I need to create a new class?
Here is my code:
Public Shared Function GetStats() As ??????????????????
Dim database As New CodeDataContext
Dim statistics = database.Tags.Select( _
Function(t) New With { _
Key .Total = database.Tags.Count(), _
Key .Linked = database.Tags.Where( _
Function(tag) _
tag.FilesTags.Any() OrElse _
tag.ArticlesTags.Any()).Count() _
}).FirstOrDefault()
Return statistics ???????????????????
End Function
Thanks,
Miguel
Alexey Smirnov - 06 Mar 2008 19:38 GMT
> Hello,
>
[quoted text clipped - 24 lines]
> Thanks,
> Miguel
Maybe you can use an Object data type?
shapper - 06 Mar 2008 20:32 GMT
> > Hello,
>
[quoted text clipped - 26 lines]
>
> Maybe you can use an Object data type?
Yes, but the type properties are not recognized by my editor outside
the function ...
... maybe I will create a class and return that class.
Thanks,
Miguel