예제 #1
0
파일: Router.cs 프로젝트: bberak/Appy
        protected virtual void LoadUrlRoutes(Assembly assembly)
        {
            foreach (var method in assembly.FindMethodsWithAttribute<UrlAttribute>())
            {
                UrlRoute route = new UrlRoute { Method = method };

                foreach (var attr in method.GetAttributes<UrlAttribute>())
                {
                    route.Attributes.Add(attr);
                }

                UrlRoutes.Add(route);
            }
        }
예제 #2
0
파일: Router.cs 프로젝트: bberak/Appy
        protected virtual void LoadExceptionRoutes(Assembly assembly)
        {
            foreach (var method in assembly.FindMethodsWithAttribute<CatchesAttribute>())
            {
                ExceptionRoute route = new ExceptionRoute { Method = method };

                foreach (var attr in method.GetAttributes<CatchesAttribute>())
                {
                    route.Attributes.Add(attr);
                }

                ExceptionRoutes.Add(route);
            }
        }