// 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;
namespace Microsoft.AspNet.Mvc.Razor
{
///
/// Specifies the contracts for a view location expander that is used by instances to
/// determine search paths for a view.
///
///
/// Individual s are invoked in two steps:
/// (1) is invoked and each expander
/// adds values that it would later consume as part of
/// .
/// The populated values are used to determine a cache key - if all values are identical to the last time
/// was invoked, the cached result
/// is used as the view location.
/// (2) If no result was found in the cache or if a view was not found at the cached location,
/// is invoked to determine
/// all potential paths for a view.
///
public interface IViewLocationExpander
{
///
/// Invoked by a to determine the values that would be consumed by this instance
/// of . The calculated values are used to determine if the view location
/// has changed since the last time it was located.
///
/// The for the current view location
/// expansion operation.
void PopulateValues(ViewLocationExpanderContext context);
///
/// Invoked by a to determine potential locations for a view.
///
/// The for the current view location
/// expansion operation.
/// The sequence of view locations to expand.
/// A list of expanded view locations.
IEnumerable ExpandViewLocations(ViewLocationExpanderContext context,
IEnumerable viewLocations);
}
}