I have a compare function which has a 3 items to compare.
My problem is how can I get their properties with their corresponding ID
.
[System.Web.Http.HttpGet]
public List<Compares> CompareValues(string ids)
{
var result = new List<Compares>();
if (!string.IsNullOrEmpty(ids))
{
var nodes = ids.Split(',').ToList().TypedContentList();
return nodes.Select(x => new KeyValuePair<int, string>(x.Id, x.GetPropertyValue<string>("title"))).ToList();
/// Error : Cannot implicity convert type 'System.Collections.Generic.List....
}
return result;
}
The full message is as follows:
Cannot implicitly convert type 'System.Collections.Generic.IEnumerable' to 'System.Collections.Generic.List'. An explicit conversion exists (are you missing a cast?)
Appreciate any help.
Thanks in advance.
Jin