Hello community.
I'm doing an insert form, and i'm trying to use a LastOrDefault to get the new value, and creating a new one binding it +1 , but i don´t know how to trasnlate this programatically. Could you help me?
//LastOrDefaultpublic ListagemTimesheet CreateNewID(int ID){using (GestaoProjectosEntities lt = new GestaoProjectosEntities()){return lt.ListagemTimesheets.LastOrDefault(a => a.ID == ID);}}//form.CSint idtimesheet = int.Parse(e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["ID"].ToString()); //find for an existing ID
ListagemTimesheet timesheet = listagembll.CreateNewID(idtimesheet); //LastOrDefault //Create a new ID ?
Sachin SinghPosted Jul 19, 2022, 6:29 AM
Rajesh GamiPosted Jul 19, 2022, 5:59 AM
Satya KarkiPosted Dec 19, 2021, 6:06 AM