This repository has been archived by the owner on Dec 14, 2018. It is now read-only.
/
ApplicationModel.cs
44 lines (38 loc) · 1.87 KB
/
ApplicationModel.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// Copyright (c) .NET Foundation. 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.Diagnostics;
using Microsoft.AspNetCore.Mvc.Filters;
namespace Microsoft.AspNetCore.Mvc.ApplicationModels
{
[DebuggerDisplay("ApplicationModel: Controllers: {Controllers.Count}, Filters: {Filters.Count}")]
public class ApplicationModel : IPropertyModel, IFilterModel, IApiExplorerModel
{
public ApplicationModel()
{
ApiExplorer = new ApiExplorerModel();
Controllers = new List<ControllerModel>();
Filters = new List<IFilterMetadata>();
Properties = new Dictionary<object, object>();
}
/// <summary>
/// Gets or sets the <see cref="ApiExplorerModel"/> for the application.
/// </summary>
/// <remarks>
/// <see cref="ApplicationModel.ApiExplorer"/> allows configuration of default settings
/// for ApiExplorer that apply to all actions unless overridden by
/// <see cref="ControllerModel.ApiExplorer"/> or <see cref="ActionModel.ApiExplorer"/>.
///
/// If using <see cref="ApplicationModel.ApiExplorer"/> to set <see cref="ApiExplorerModel.IsVisible"/> to
/// <c>true</c>, this setting will only be honored for actions which use attribute routing.
/// </remarks>
public ApiExplorerModel ApiExplorer { get; set; }
public IList<ControllerModel> Controllers { get; }
public IList<IFilterMetadata> Filters { get; }
/// <summary>
/// Gets a set of properties associated with all actions.
/// These properties will be copied to <see cref="Abstractions.ActionDescriptor.Properties"/>.
/// </summary>
public IDictionary<object, object> Properties { get; }
}
}