I have written linq as below, here tableName is dynamic as parameter and select all records in table. And also each table have different column name but this column have same data type in each table.
public List<AccidentNotified> GetParticularLookUp(string tableName)
{
List<AccidentNotified> ManageLookUpList = new List<AccidentNotified>();
using (var cases = new ApiRassiEntities())
{
var lookupvalues = (from accident in cases.AccidentNotifiedByLUs
select accident );
ManageLookUpList = lookupvalues.ToList();
}
return ManageLookUpList;
}
here i have to use like below method,
using (var cases = new ApiRassiEntities())
{
var lookupvalues = (from accident in cases.[tableName]
select accident );
}
So please give your suggestion.Thanks in advance