// 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;
using System.Collections.Generic;
using System.Linq;
using Microsoft.AspNet.Mvc.ApplicationModels;
using Microsoft.Framework.Logging;
namespace Microsoft.AspNet.Mvc.Logging
{
///
/// Logging representation of the state of a . Logged during controller discovery.
///
public class ControllerModelValues : ReflectionBasedLogValues
{
public ControllerModelValues(ControllerModel inner)
{
if (inner != null)
{
ControllerName = inner.ControllerName;
ControllerType = inner.ControllerType.AsType();
ApiExplorer = new ApiExplorerModelValues(inner.ApiExplorer);
Actions = inner.Actions.Select(a => new ActionModelValues(a)).ToList();
Attributes = inner.Attributes.Select(a => a.GetType()).ToList();
Filters = inner.Filters.Select(f => new FilterValues(f)).ToList();
ActionConstraints = inner.ActionConstraints?.Select(a => new ActionConstraintValues(a))?.ToList();
RouteConstraints = inner.RouteConstraints.Select(
r => new RouteConstraintProviderValues(r)).ToList();
AttributeRoutes = inner.AttributeRoutes.Select(
a => new AttributeRouteModelValues(a)).ToList();
Properties = new Dictionary