This will not work at compile-time. Using dynamic stuff you can make it work of course.
A simple solution is not to use an anonymous type but a custom-made DTO class. Such a DTO class only takes very few lines and is easy to maintain. Usually this is a good solution.