41 lines
1.4 KiB
C#
41 lines
1.4 KiB
C#
// 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;
|
|
using System.Collections.Generic;
|
|
using Microsoft.AspNet.Mvc.Abstractions;
|
|
|
|
namespace Microsoft.AspNet.Mvc.Infrastructure
|
|
{
|
|
/// <summary>
|
|
/// A cached collection of <see cref="ActionDescriptor" />.
|
|
/// </summary>
|
|
public class ActionDescriptorsCollection
|
|
{
|
|
/// <summary>
|
|
/// Initializes a new instance of the <see cref="ActionDescriptorsCollection"/>.
|
|
/// </summary>
|
|
/// <param name="items">The result of action discovery</param>
|
|
/// <param name="version">The unique version of discovered actions.</param>
|
|
public ActionDescriptorsCollection(IReadOnlyList<ActionDescriptor> items, int version)
|
|
{
|
|
if (items == null)
|
|
{
|
|
throw new ArgumentNullException(nameof(items));
|
|
}
|
|
|
|
Items = items;
|
|
Version = version;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Returns the cached <see cref="IReadOnlyList{ActionDescriptor}"/>.
|
|
/// </summary>
|
|
public IReadOnlyList<ActionDescriptor> Items { get; private set; }
|
|
|
|
/// <summary>
|
|
/// Returns the unique version of the currently cached items.
|
|
/// </summary>
|
|
public int Version { get; private set; }
|
|
}
|
|
} |