Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

This is evil, and unnecessary. If you don't want to expose an IQueryable for whatever reason, and you don't want to write separate methods for each query, use static reflection. But please, don't abuse dynamic like this.


It may be unnecessary, but I don't think it's an abuse. As I understand it, frameworks like Rails use idioms like this quite extensively, and enabling code written in static languages to receive dynamic member calls is pretty much the point of having DynamicObject in the .NET framework.

That said, it's probably more relevant if you need to call the repository from DLR languages. And in that case you might as well choose to write the repository class in the DLR language, which will presumably have native support for dynamic method resolution.




Consider applying for YC's Winter 2027 batch! Applications are open till November 2.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: