I was basically wondering if it is possible to optimize this code:
AmountComments = Int32.Parse(r.Attribute("AmountComments").Value)
Ideally I would want to write something like
AmountComments = r.Attribute("AmountComments")
r would be a xml tag of type XElement, which is selected before in a Linq query.
Consider writing an extension method(s) for the type of
.Attribute()One extension method for each type that you’d like out. This way you’d simply be able to: