We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Value of Primary Key in the documentation

In the page:
https://ej2.syncfusion.com/aspnetmvc/documentation/schedule/data-binding/?no-cache=1#using-custom-adaptor

you suggest this code for the primary key:

 int intMax = db.ScheduleEventDatas.ToList().Count > 0 ? db.ScheduleEventDatas.ToList().Max(p => p.Id) : 1;
...
  Id = intMax + 1,
this solution is not performant. I suggest this code:
int intMax = db.ScheduleEventDatas.Select(x => x.Id).DefaultIfEmpty(0).Max();

1 Reply

KK Karthigeyan Krishnamurthi Syncfusion Team March 12, 2019 07:21 AM UTC

Hi  Francesco,   
   
Thank you for contacting Syncfusion support. 
 
We will refresh the UG with your valuable suggestion on or before March 19, 2019. 
 
Regards, 
Karthi 


Loader.
Up arrow icon