S
shapper
Hello,
I have the following code:
return _resources.Root.Elements("Resource").Select(r => new
Resource {
Id = (Int32)r.Element("Id"),
Constraints =
_resourcesConstraints.Root.Elements("ResourceConstraint")
.Where(rc => rc.Element("ResourceId").Value ==
r.Element("Id").Value)
.ToDictionary(rc => (Int32)rc.Element("ConstraintId"), rc =>
(String)rc.Element("Value")),
});
I want to change the Constraints property from IDictionary to
IList<Constraint>.
Each constraint object has 2 properties: Id and Value.
So I need to change the code line:
..ToDictionary(rc => (Int32)rc.Element("ConstraintId"), rc =>
(String)rc.Element("Value")),
ToList > and create a List of Constraint filling the Id and Value of
the constraint the same way.
How can I do this?
Thank You,
Miguel
I have the following code:
return _resources.Root.Elements("Resource").Select(r => new
Resource {
Id = (Int32)r.Element("Id"),
Constraints =
_resourcesConstraints.Root.Elements("ResourceConstraint")
.Where(rc => rc.Element("ResourceId").Value ==
r.Element("Id").Value)
.ToDictionary(rc => (Int32)rc.Element("ConstraintId"), rc =>
(String)rc.Element("Value")),
});
I want to change the Constraints property from IDictionary to
IList<Constraint>.
Each constraint object has 2 properties: Id and Value.
So I need to change the code line:
..ToDictionary(rc => (Int32)rc.Element("ConstraintId"), rc =>
(String)rc.Element("Value")),
ToList > and create a List of Constraint filling the Id and Value of
the constraint the same way.
How can I do this?
Thank You,
Miguel