// 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.AspNetCore.Mvc.ApplicationModels; namespace Microsoft.AspNetCore.Mvc.RazorPages { /// /// Provides configuration for RazorPages. /// public class RazorPagesOptions { private string _root = "/Pages"; /// /// Gets a list of instances that will be applied to /// the when discovering Razor Pages. /// public IList Conventions { get; } = new List(); /// /// Application relative path used as the root of discovery for Razor Page files. /// Defaults to the /Pages directory under application root. /// public string RootDirectory { get => _root; set { if (string.IsNullOrEmpty(value)) { throw new ArgumentException(Resources.ArgumentCannotBeNullOrEmpty, nameof(value)); } if (value[0] != '/') { throw new ArgumentException(Resources.PathMustBeAnAppRelativePath, nameof(value)); } _root = value; } } } }