I have a Model called SalesItemModel
which has properties such as SaleItemId, SalesID, ProductID, Quantity, and UnitPrice
. I pull list from database using SalesItemService.ListSalesItemsDataBySaleID(salesID)
.
public class SalesItemModel
{
public int SalesItemID { get; set; }
public int SalesID { get; set; }
public int ProductID { get; set; }
public string ProductName { get; set; }
public Nullable<decimal> UnitPrice { get; set; }
public double Quantity { get; set; }
}
Pulling Sales Items:
var salesItem = SalesItemService.ListSalesItemsDataBySaleID(SalesID);
And I want to access quantity and product ID of every row of the returned list to edit data on stock table using those data.
question from:
https://stackoverflow.com/questions/66058852/how-to-use-access-all-rows-of-type-listt-in-c-sharp-net-framework 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…