mirror of
https://gitee.com/dotnetchina/OpenAuth.Net.git
synced 2025-09-20 10:37:55 +08:00
转移.net core 3.1,为.NET 5做准备
This commit is contained in:
28
Infrastructure/Extensions/ServerExtension.cs
Normal file
28
Infrastructure/Extensions/ServerExtension.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using Infrastructure.Extensions.AutofacManager;
|
||||
using Infrastructure.Provider;
|
||||
|
||||
namespace Infrastructure.Extensions
|
||||
{
|
||||
public static class ServerExtension
|
||||
{
|
||||
/// <summary>
|
||||
/// 返回的路径后面不带/,拼接时需要自己加上/
|
||||
/// </summary>
|
||||
/// <param name="path"></param>
|
||||
/// <returns></returns>
|
||||
public static string MapPath(this string path)
|
||||
{
|
||||
return MapPath(path, false);
|
||||
}
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="path"></param>
|
||||
/// <param name="rootPath">获取wwwroot路径</param>
|
||||
/// <returns></returns>
|
||||
public static string MapPath(this string path,bool rootPath)
|
||||
{
|
||||
return AutofacContainerModule.GetService<IPathProvider>().MapPath(path,rootPath);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user