I have a code that returns me an object of widgets
XDocument loaded = XDocument.Parse( xml );
var widgets = from x in loaded.Descendants( "widget" )
select new
{
URL = x.Descendants( "url" ).First().Value,
Category = x.Descendants( "PortalCategoryId" ).First().Value
};
I am trying to create a method that will return the object widgets and then I need another method where I can cal it from and access the values. I am new to C# and using vs2010
thanks
Anonymous types cannot easily be shared across methods.
You should make a class to store that data.