is it possible that i have 2 condition inside of foreach ? see my code below.
- public ActionResult Add(OrderFormModel model, int[] DynamicTextBox, string[] DynamicTextBox2){
- foreach (int textBoxValue in DynamicTextBox && string textBoxValue2 in DynamicTextBox2)
- {
- var getMaxId = _orderService.GetAll().OrderByDescending(x => x.Id).FirstOrDefault();
- var order = new Order
- {
- ClientId = model.ClientId,
- StateId = model.StateId,
- CityId = model.CityId,
- TownId = model.TownId,
- Postcode = model.Postcode,
- Deposit = textBoxValue,
- TrackingNumber = textBoxValue2,
- Address = model.Address,
- DatePosted = Convert.ToDateTime(model.DatePosted),
- DeliveryDate = Convert.ToDateTime(model.DeliveryDate),
- Quantity = 1,
- Status = "Lined-up",
- DateDelivered = null,
- Notes = model.Notes ?? "",
- };
- }

Rajanikant HawaldarRank #110 · 20.4K reputationPosted Oct 21, 2019, 5:44 AM EDT
Denmark PusoRank #7,130 · 248 reputationPosted Oct 21, 2019, 6:17 PM EDT
Rajanikant Hawaldar
Mageshwaran RRank #411 · 6.1K reputationPosted Nov 13, 2019, 3:04 PM EST