开发者

How to pass the linq returned xml data to another function?

开发者 https://www.devze.com 2023-04-09 23:04 出处:网络
var serviceLine = from ServiceLine in DataXML.Descendants(\"Serviceline\") select new { ServiceLineName = ServiceLine.Attribute(\"Name\").Value,
var serviceLine = from ServiceLine in DataXML.Descendants("Serviceline")
                              select new
                              {
                                  ServiceLineName = ServiceLine.Attribute("Name").Value,
                                  EntityName = ServiceLine.Attribute("Entity").Value,
                                  SiteLevelName = ServiceLine.Attribute("SiteLevel").Value,
                                  FolderName = ServiceLine.Descendants("Folder"),
                                  ItemName = ServiceLine.Descendants("Item")
                              };

i need to pass the serviceline as paramenter to another method, there i need to use the query returned result. so how can i pass the return. what type i need to use to pass the ret开发者_如何转开发urned data.


  1. Create you own type.
  2. Use Tuple
  3. Return object, in calling method use dynamic to access properties.
0

精彩评论

暂无评论...
验证码 换一张
取 消