scottoffen / grapevine-legacy

Embedding A REST Server In Your Application Should Be Simple
http://scottoffen.github.io/grapevine-legacy/
Apache License 2.0
209 stars 51 forks source link

Loaded Assembly Doesn't Get Routes Scanned #229

Closed seikosantana closed 3 years ago

seikosantana commented 3 years ago

I have a public, non-abstract class that derives from an abstract class. That class has RestResource attribute and has methods returning IHttpContext with RestRoute attribute.

This assembly is loaded by using reflection, and no routes were auto-generated. But, if i create another class in the same assembly, the routes are auto-generated.

I wonder why routes are not autogenerated on the other class.

Not sure that is because the assembly is loaded by reflection, since another class in the same assembly can get the route scanned.

scottoffen commented 3 years ago

If you can provide a code example, maybe I can track that down for you.

seikosantana commented 3 years ago

Sorry i think i found out what's wrong.

My class has no default constructor. But is it possible to specify parameters to construct the RESTResource?

scottoffen commented 3 years ago

Not if you are using Grapevine 4.x or lower. You can do this using Grapevine 5.

seikosantana commented 3 years ago

I see. Thanks.. I'll see if it is hard to migrate.