It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical andcannot be reasonably answered in its current form. For help clari
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
开发者_如何学运维
Closed 12 years ago.
customers =
(
from c in xDoc.Descendants("customer")
orderby c.Attribute("CustomerID").Value
select new Customer
{
ID = c.Attribute("CustomerID").Value,
CompanyName = c.Attribute("CompanyName").Value,
ContactName = c.Attribute("ContactName").Value,
ContactTitle = c.Attribute("ContactTitle").Value,
Address = c.Attribute("Address").Value,
City = c.Attribute("City").Value,
State = c.Attribute("State").Value,
ZIPCode = c.Attribute("ZIPCode").Value,
Phone = c.Attribute("Phone").Value
}
).ToList();
Dim customers = (From c In xDoc.Descendants("customer")Order By c.Attribute("CustomerID").Value
Select New Customer() With { _
.ID = c.Attribute("CustomerID").Value, _
.CompanyName = c.Attribute("CompanyName").Value, _
.ContactName = c.Attribute("ContactName").Value, _
.ContactTitle = c.Attribute("ContactTitle").Value, _
.Address = c.Attribute("Address").Value, _
.City = c.Attribute("City").Value, _
.State = c.Attribute("State").Value, _
.ZIPCode = c.Attribute("ZIPCode").Value, _
.Phone = c.Attribute("Phone").Value _
}).ToList()
精彩评论