IQueryable<TRecord> query = _context.ServerNames;
generic type parameter is most like not in scope on that line.
And even if it is, you'd be trying to assign a set of
objects to a set of
instances. Unless you have a generic type constraint in place to ensure that
is derived from
, that's not going to work.
Instead, you need to use the correct type:
IQueryable<ServerNames> query = _context.ServerNames;