Dear I have a problem that I was looking for I did not find a solution, I have the following tables in sql server 2008
and I have an application in Visual studio 2017, from WinForms WEB, with my connection to my database through CODE FIRST FROM DATABASE, so I automatically create the classes etc,
Now I have a form where I input data from the car, and by means of a FileUpload multiple, I upload several images,
What I already have echo is to have a LIST with all the routes of the images of the FILEUPLOAD, so my idea is to create the car with all its data and followed by that to make an insert in the table images with all the routes of my list but I do not know how to recover the ID of the car previously created, I hope someone enlightens me, thank you already
I insert them by means of the following syntax
var auto = new Automovil { Anio = titulo6 };
db.Automovil.Add(auto);
db.SaveChanges();
So then when creating the image, how do I know what ID the previous Automobile created?