private List <itemsinorder> CreateIIOs(int iOrderId) { List <itemsinorder> myIIOs = new List <itemsinorder>(); foreach (product curProduct in bestelling) { itemsinorder exIIO = myIIOs.FirstOrDefault(iio => iio.productId.Equals(curProduct.id)); if (exIIO != null) { exIIO.amount++; } else { itemsinorder myIIO = new itemsinorder(); myIIO.productId = curProduct.id; myIIO.amount = 1; myIIO.orderId = iOrderId; myIIOs.Add(myIIO); } } return(myIIOs); }
private void detach_itemsinorders(itemsinorder entity) { this.SendPropertyChanging(); entity.order = null; }
private void attach_itemsinorders(itemsinorder entity) { this.SendPropertyChanging(); entity.order = this; }
partial void Deleteitemsinorder(itemsinorder instance);
partial void Updateitemsinorder(itemsinorder instance);
partial void Insertitemsinorder(itemsinorder instance);