// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Collections.Generic; using System.Linq; using System.Reflection; namespace Microsoft.AspNet.Mvc.ReflectedModelBuilder { public class ReflectedActionModel { public ReflectedActionModel([NotNull] MethodInfo actionMethod) { ActionMethod = actionMethod; // CoreCLR returns IEnumerable from GetCustomAttributes - the OfType // is needed to so that the result of ToList() is List Attributes = actionMethod.GetCustomAttributes(inherit: true).OfType().ToList(); Filters = Attributes.OfType().ToList(); HttpMethods = new List(); Parameters = new List(); } public MethodInfo ActionMethod { get; private set; } public string ActionName { get; set; } public List Attributes { get; private set; } public List Filters { get; private set; } public List HttpMethods { get; private set; } public bool IsActionNameMatchRequired { get; set; } public List Parameters { get; private set; } } }