I am new to C# and DB, I have a method that finds an employee by code in the DB. I want to make the check generic so that it can be used to check for that employee code in various tables (the user would provide the code and the table). How can I do this?
This is my code :
public static bool checkForEmployeeCode(string SSN)
{
MyEntities ETC = new MyEntities();
var checkSsn = (from Applicant in ETC.Applicants1
where Applicant.SSN == SSN.Trim()
select Applicant).FirstOrDefault();
if (checkSsn != null)
{....
I you have an answer please explain.