// 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; namespace Microsoft.AspNet.Mvc.Razor { /// /// Represents the results of locating a . /// public class RazorPageResult { /// /// Initializes a new instance of for a successful discovery. /// /// The name of the page that was located. /// The located . public RazorPageResult(string name, IRazorPage page) { if (name == null) { throw new ArgumentNullException(nameof(name)); } if (page == null) { throw new ArgumentNullException(nameof(page)); } Name = name; Page = page; } /// /// Initializes a new instance of for an unsuccessful discovery. /// /// The name of the page that was located. /// The locations that were searched. public RazorPageResult(string name, IEnumerable searchedLocations) { if (name == null) { throw new ArgumentNullException(nameof(name)); } if (searchedLocations == null) { throw new ArgumentNullException(nameof(searchedLocations)); } Name = name; SearchedLocations = searchedLocations; } /// /// Gets the name of the page being located. /// /// This property maps to the name parameter of /// . public string Name { get; } /// /// Gets the if found. /// /// This property is null if the page was not found. public IRazorPage Page { get; } /// /// Gets the locations that were searched when could not be located. /// /// This property is null if the page was found. public IEnumerable SearchedLocations { get; } } }