Hi , We want the query result should be assigned with two results based on some condition like following:
var vAudioData = (from xAudioinfo in xResponse.Descendants(ns + "DIDL-Lite").Elements(ns + "item")
if((xAudioinfo.Element(upnp + "artist")!=null)
{
select new RMSMedia
{
strAudioTitle = ((string)xAudioinfo.Element(dc + "title")).Trim()
};
}
else
select new RMSMedia
{
strGen = ((string)xAudioinfo.Element(dc + "Gen")).Trim()
};
The VarAudioData should contain both if and else condition values.
I have added the if condition just to project , what is my needs, m quite sure though that we can not use if and else.
Please help if there are any other approach to accomplish this.
Thanks,
Subhen