I need get the Route UDA only for method without (static methods, property, constructor, destructor), dont know how to do it.

Route[] getRoutes(T)(){
        Route[] routes;
        foreach(int i, m; __traits(allMembers, T) ){
                pragma(msg, m.stringof);
                static foreach(int j, r; getUDAs!(m, Route) ) {
                        routes  ~= r;
                }
        }
        return routes;
}

struct App {
        
        @Route("/index")
        void home(){
                
        }
        
        @Route("/blog")
        void blog(){
                
        }
}

Reply via email to