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 ?? "",
- };
- }