I have 2 nested list Need to merge together ı try everthing using linq query ı try join and union ı didnt complete the query..Is there a way merge these the way i need?
public class BaseFilter
{
public string Name { get; set; }
public int ID { get; set; }
}
public class Filter
{
public string Name { get; set; }
public int DetailId { get; set; }
public List<BaseFilter> Values { get; set; }
}
I have 2 Filter list like :
List 1: List2:
Clour : Colour:
Red Red
Blue
Size: Size:
XL L
M
S
I want to merge list2 with one without duplicate record
Like : ist 1:
Clour :
Red
Blue
Size:
XL
M
S
L
Edit to understand the question better
My assumption is, you have table structure like (following two columns):
Details DetailsValue
Size {S,M,L}
Colour {Green,blue}
PerfumeSize {50ml,100ml}
Type {EDP,EDT}
Another similar table is there, now you want to merge them, without any value repetition, correct ?
Another list Details DetailsValue
Size {S}
Colour {Red}
PerfumeSize {50ml,150ml}
Type {EDP}
expect result:
Details DetailsValue
Size {S,M,L}
Colour {Green,blue,red}
PerfumeSize {50ml,100ml,150ml}
Type {EDP,EDT}