예제 #1
0
        public IEnumerable <ApplicationControllerMethodMetadata> Build(ApplicationControllerMetadata applicationControllerMetadata, Type type)
        {
            var result = new List <ApplicationControllerMethodMetadata>();

            foreach (var methodInfo in type.GetMethods())
            {
                result.Add(new ApplicationControllerMethodMetadata(applicationControllerMetadata, methodInfo.Name, methodInfo,
                                                                   methodInfo.CustomAttributes.Select(x => x.AttributeType).ToList()));
            }

            return(result);
        }
예제 #2
0
        public IEnumerable <ApplicationControllerMetadata> Build()
        {
            var applicationControllerMetadatas = new List <ApplicationControllerMetadata>();

            foreach (var type in _applicationMetadataProvider.MvcAssemblyTypes.Where(x => _namingConventionManager.IsController(x)))
            {
                var applicationControllerMetadata = new ApplicationControllerMetadata(type.Name);
                applicationControllerMetadatas.Add(applicationControllerMetadata);
                var applicationControllerMethodMetadatas = _applicationControllerMethodMetadataBuilder.Build(applicationControllerMetadata, type);
                applicationControllerMetadata.ApplicationControllerMethods.AddRange(applicationControllerMethodMetadatas);
            }

            return(applicationControllerMetadatas);
        }