EDIT: This answer is based on the idea that you'll need to do similar things for different entities and different properties elsewhere in your code. If you only need to convert the list of ViewValues to a list of Longs by ID, then stick with your original code. If you want a more reusable solution, however, read on...

I would declare an interface for the projection, e.g.

public interface Function<Arg,Result>
{
public Result apply(Arg arg);
}