Guest User

Untitled

a guest
Jun 20th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. public interface IProductPrices
  2. {
  3. int ProductId { get; set; }
  4. string ProductCode { get; set; }
  5. List<IProductPrice> Prices { get; set; }
  6. }
  7.  
  8. public interface IProductPrice
  9. {
  10. int ProductId { get; set; }
  11. string PriceKey { get; }
  12. double Price { get; set; }
  13. int Id { get; set; }
  14. }
  15.  
  16. //productPrices is of type IProductPrices
  17. //temp is of type IProductPrice
  18.  
  19. ........
  20. var finalPriceList = new List<ABC.Model.ProductPrice>();
  21. foreach (var item in productPrices)
  22. {
  23. foreach (var temp in item.Prices)
  24. {
  25. var prodPrice = new ABC.Model.ProductPrice()
  26. {
  27. Price = temp.Price,
  28. ProductCode = temp.ProductCode
  29. };
  30. finalPriceList.Add(prodPrice);
  31. }
  32. }
  33. .....
  34.  
  35. foreach (var temp in item.Prices)
Add Comment
Please, Sign In to add comment