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?
C#
//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 ?
Rajesh GamiRank #30 · 41.5K reputationPosted Jul 19, 2022, 1:59 AM EDT
Satya KarkiRank #78 · 24.6K reputationPosted Dec 19, 2021, 1:06 AM EST
Sachin SinghRank #66 · 26.2K reputationPosted Jul 19, 2022, 2:29 AM EDT