I'm not sure this explanation is easy to understand but I will do my best.
I have one table which holds the main details.
One table for saving sub details.
One for saving attachment images and related details.
So views go as,
Main view for main details.
Partial view for sub details.
Partial view for Attachment details.
Details pass to the database correctly other than the attachments.

So If I Click Add it will generate another item list and I can attach another image.
After all, So when I click the send button All the details will be saved to the database but attachments not showing there.
Here is the Controller,
if (appRequest.Purchase!=null){appRequest.Purchase = new List() {new Purchase{PurchasingEmpl = appRequest.PurchasingEmpList,PurchasingItems = appRequest.PurchasingItemsList}};
appRequest.Create_By = int.Parse(((System.Security.Claims.ClaimsIdentity)User.Identity).FindFirst("UserId").Value);
appRequest.Created_Date = DateTime.Now;
appRequest.Modified_By = int.Parse(((System.Security.Claims.ClaimsIdentity)User.Identity).FindFirst("UserId").Value);
appRequest.Modified_Date = DateTime.Now;
appRequest.Status = true;
appRequest.Approval_Status = 1;
db.AppRequest.Add(appRequest);
db.SaveChanges();
PurchasingItemsList is an IList created on the Model.
[NotMapped]
public IList PurchasingItemsList { get; set; }
And this is the sub class
public class PurchasingItems{[Key]public int Id { get; set; }[Required][ForeignKey("Purchase")]public int Purchase_Id { get; set; }public virtual Purchase Purchase { get; set; }public int Supp_Id { get; set; }public int Itm_Description_Id { get; set; }public decimal Unit_Amount { get; set; }public byte[] Attachment { get; set; }public decimal Qty { get; set; }public string Recomandation { get; set; }public bool Status { get; set; }public bool Settled { get; set; } = false;public string PoNo { get; set; }}
So my issue is, when I click send button, all the details will pass to the data tables other than attachments. Need to know a way to upload the attachment also to the data table.Hope my problem is clearly described. Thank you
Here are the data table views

Sachin SinghPosted Sep 7, 2021, 3:55 AM
smc develpmentsPosted Sep 7, 2021, 3:19 AM
Hi Sachin Singh,
Sorry, I forgot to mention that code, I have removed it because mine is not working. Also, I want to know that in the controller where should I put this saving image code?
Here is my code,
In the,
appRequest.PurchasingItemsList
is where the item details is collecting and saving. So image also should save with those data. So can you tell me where should I
enter image saving code.
Thank you.
Sachin SinghPosted Sep 6, 2021, 2:38 PM