I am trying to check for the existence of a record in a SQL table in a if statement, I was trying to use .Count() but now understand that it won't work as it will return the total amount of all records in the table.
// If the current user does not exist in the Database, then add the user
if (staffdb.Staffs.Single(s => s.Staffname == user).Count() == 0)
{
}
I'm a bit of a novice when it comes to this but I've done a bit of searching the net and can't seem to find anything to go off.