I have two objects. I want to sort first object's QuickLinks
property according to second object's QuickLinks
. It should be based on QuickLinkContent.ConfigId
NavigationMenuContent nmc1 = new NavigationMenuContent();
NavigationMenuContent nmc2 = new NavigationMenuContent();
public class NavigationMenuContent
{
public int LanguageID { get; set; }
public QuickLinkContent[] QuickLinks { get; set; }
}
public class QuickLinkContent
{
public Guid ConfigID { get; set; }
public string Name { get; set; }
public string Description { get; set; }
public string Url { get; set; }
public Guid? ServiceProviderID { get; set; }
public SchemeContentFile Document { get; set; }
}
I tried doing it like this:
nmc1.QuickLinks = nmc1.QuickLinks.OrderBy(q => nmc2.QuickLinks.ToList().IndexOf(q.ConfigID));
but getting error :
Cannot convert from System.Guid to QuickLnkContent.