// 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;
using Microsoft.AspNet.Mvc.ApplicationModels;
using Microsoft.Framework.Logging;
namespace Microsoft.AspNet.Mvc.Logging
{
///
/// Represents the state of an .
/// Logged as a substructure of
///
public class ActionModelValues : LoggerStructureBase
{
// note: omit the controller as this structure is nested inside the ControllerModelValues it belongs to
public ActionModelValues(ActionModel inner)
{
if (inner != null)
{
ActionName = inner.ActionName;
ActionMethod = inner.ActionMethod;
ApiExplorer = new ApiExplorerModelValues(inner.ApiExplorer);
Parameters = inner.Parameters.Select(p => new ParameterModelValues(p)).ToList();
RouteConstraints = inner.RouteConstraints.Select(
r => new RouteConstraintProviderValues(r)).ToList();
Filters = inner.Filters.Select(f => new FilterValues(f)).ToList();
if (inner.AttributeRouteModel != null)
{
AttributeRouteModel = new AttributeRouteModelValues(inner.AttributeRouteModel);
}
HttpMethods = inner.HttpMethods;
ActionConstraints = inner.ActionConstraints?.Select(a => new ActionConstraintValues(a))?.ToList();
Properties = new Dictionary