mirror of https://github.com/abpframework/abp.git
5 changed files with 53 additions and 11 deletions
@ -0,0 +1,31 @@ |
|||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Linq; |
||||
|
using System.Threading.Tasks; |
||||
|
|
||||
|
namespace Volo.Blogging |
||||
|
{ |
||||
|
public class BloggingUrlOptions |
||||
|
{ |
||||
|
private string _routePrefix = "blog"; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// Default value: "blog";
|
||||
|
/// </summary>
|
||||
|
public string RoutePrefix |
||||
|
{ |
||||
|
get => GetFormattedRoutePrefix(); |
||||
|
set => _routePrefix = value; |
||||
|
} |
||||
|
|
||||
|
private string GetFormattedRoutePrefix() |
||||
|
{ |
||||
|
if (string.IsNullOrWhiteSpace(_routePrefix)) |
||||
|
{ |
||||
|
return "/"; |
||||
|
} |
||||
|
|
||||
|
return _routePrefix.EnsureEndsWith('/').EnsureStartsWith('/'); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
Loading…
Reference in new issue