hi
i create MVC project and wrote below codes:
but below error occure:
public bool Delete(int id)
{
try
{
Student deleted_student = db.Students.Where(p => p.Id == id).Single();
db.Students.Remove(deleted_student);
return Convert.ToBoolean(db.SaveChanges());
}
catch (Exception)
{
return false;
}
}
public Student Find(int id)
{
try
{
return db.Students.Where(p => p.Id == id).Single();
}
catch (Exception)
{
return null;
}
what should I do?
best regards
neda