20 lines
542 B
C#
20 lines
542 B
C#
using System.IO;
|
|
using AVSCartonShipmentVerifier.Configuration;
|
|
|
|
namespace AVSCartonShipmentVerifier.ScanHistory;
|
|
|
|
public static class ScanHistoryPath
|
|
{
|
|
public static string EnsureDirectoryAndGetConnectionString(ScanHistoryOptions options)
|
|
{
|
|
var fullPath = Path.GetFullPath(options.DatabasePath);
|
|
var directory = Path.GetDirectoryName(fullPath);
|
|
if (!string.IsNullOrWhiteSpace(directory))
|
|
{
|
|
Directory.CreateDirectory(directory);
|
|
}
|
|
|
|
return $"Data Source={fullPath}";
|
|
}
|
|
}
|