Files
Toolkit2/Toolkit.Foundation/IHostBuilderExtensions.cs
T
TheXamlGuy bc55c4649b tidy
2024-04-26 23:05:36 +01:00

19 lines
443 B
C#

using Microsoft.Extensions.Hosting;
namespace Toolkit.Foundation;
public static class IHostBuilderExtensions
{
public static IHostBuilder UseContentRoot(this IHostBuilder hostBuilder,
string contentRoot,
bool createDirectory)
{
if (createDirectory)
{
Directory.CreateDirectory(contentRoot);
}
hostBuilder.UseContentRoot(contentRoot);
return hostBuilder;
}
}