I want check the 2 combinations if no combinations exisits I need to do insert
My Code
combinations:
Category Name, Category Type:
Music , Album
Music, Single and etc..
Here I need to check if there is no existing combination then I need to add to cartcollection
Entity_CategoryCollection cartCollection = new Entity_CategoryCollection();
if (cartCollection.Count == 0)
{
cartCollection.Add(category);
}
else
{
for (int j = 0; j < cartCollection.Count; j++)
{
if (cartCollection[j].CategoryName != category.CategoryName)
{
cartCollection.Add(category);
}
if (cartCollection[j].CategoryName == category.CategoryName)
{
//Here I want to loop all the cart type from the entity class
Member
20 Points
74 Posts
Combination Logic In C#
Dec 10, 2014 08:15 AM|Renuka V|LINK
Hi,
please help
I want check the 2 combinations if no combinations exisits I need to do insert
My Code
combinations:
Category Name, Category Type:
Music , Album
Music, Single and etc..
Here I need to check if there is no existing combination then I need to add to cartcollection
Entity_CategoryCollection cartCollection = new Entity_CategoryCollection();
if (cartCollection.Count == 0)
{
cartCollection.Add(category);
}
else
{
for (int j = 0; j < cartCollection.Count; j++)
{
if (cartCollection[j].CategoryName != category.CategoryName)
{
cartCollection.Add(category);
}
if (cartCollection[j].CategoryName == category.CategoryName)
{
//Here I want to loop all the cart type from the entity class
}
}
}
Star
9052 Points
2255 Posts
Re: Combination Logic In C#
Dec 10, 2014 09:18 AM|Siva Krishna Macha|LINK
Hi,
Try something similar to below - assuming the property name is CartType both the sides:
cartCollection[j].CartType == category.CartType
Thanks & Regards,
Siva