I'd like to add a value to a struct
if (!existISDNteilnehmer(split))
{
isdnObjs.Add(new ISDN() { name = split, number = "",
channels = new List<string>()});
}
ISDN? actualISDN = getISDN(split);
if (index < ISDN_teilnehmer.Count())
{
var numbers =
from num in xISDN.XPathSelectElements("//member[name='number']")
where num.IsAfter(xISDN) &&
num.IsBefore(ISDN_teilnehmer.ElementAt(index))
select num;
foreach (var nums in numbers)
{
if (nums.Element("name").Value == "number")
{
var nummer = nums.XPathSelectElements("value");
var part_nummer =
from n in nummer
select n.Value;
//string temp = part_nummer;
actualISDN.Value.number = part_nummer;
}
}
Everything is read out correctly and the correct number is stored in part_nummer
.
Now I want to add the number to the list with actualISDN.Value.number = part_nummer
but I get an error that says it cannot be implicitly converted
.
Where am I going wrong?