Guest User

Untitled

a guest
Jun 26th, 2018
231
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.83 KB | None | 0 0
  1. foreach ( var product in listInSql)
  2.             {
  3.                 product.listGroup.Reverse();
  4.                 foreach (List<string> category in product.listGroup)
  5.                 {
  6.                         var itemCategory = listCategoryInSote.SingleOrDefault(x => x.idCategory == category.ElementAt(2));
  7.                         if (String.IsNullOrEmpty(category[2]))//kategorie po id nie ma
  8.                          {
  9.  
  10.                             ///DODANIE WAROTSCI
  11.  
  12.                          {
  13.                       category[2] = parentId;//Dodaje do aktualnego produktu a potrzebuje do wszystkich
  14.                       var listInSql =   listInSql.Where(S => S.listGroup.ElementAt[0] = category[0])
  15.                      .Select(S => { S.listGroup.ElementAt[2] = category[2]; return S; }).ToList();
  16.                         parentId = parentId;
  17.                 }
  18.             }
Advertisement
Add Comment
Please, Sign In to add comment