there, I want to post Purchase record to controller, My Model contain the following two classes, named Purchase and PurchaseDetails
public partial class Purchase
{
public Purchase()
{
this.PurchaseDetails = new HashSet<PurchaseDetail>();
}
public int purchaseId { get; set; }
public System.DateTime purchaseDate { get; set; }
public int vendorCode { get; set; }
public string vendorName { get; set; }
public int purVoucherNo { get; set; }
public virtual ICollection<PurchaseDetail> PurchaseDetails { get; set; }
}
public partial class PurchaseDetail
{
public int code { get; set; }
public int purchaseDetailsId { get; set; }
public string serialNo { get; set; }
public int productCode { get; set; }
public string productName { get; set; }
public string unitOfMeasure { get; set; }
public int quantity { get; set; }
public decimal purchasePrice { get; set; }
public decimal amount { get; set; }
public virtual Purchase Purchase { get; set; }
}
Now, First i want to dynamically store and show purchase detail data in a table and secondly i want to pass one object of Purchase and More than one objects of PurchaseDetails to Controller. Please Help me. I don't know how to Accomplish this task.