You can use code like this
private IEnumerable GetList(string connectionString, Func
To call like this:
var branchList = GetList("connectionStringName", x => (Branch)x);
You can remove .AsNoTracking() and remove .ToList(), then you will get pure IQueryable which you can query further.