Hi
I am geting above error on return statement
C#
public int UpdateStudentBreak(StudentsBreak student)
{
try
{
context.SubmitChanges();
return student.StudentId;
}
catch (Exception ex)
{
return 0;
}
}Thanks

Amit MohantyRank #112 · 20K reputationPosted Apr 5, 2023, 8:42 AM EDT
Try this
public int UpdateStudentBreak(StudentsBreak student) { try { context.SubmitChanges(); return student.StudentId ?? 0; } catch (Exception ex) { return 0; } }