1
0

17 lines
495 B
C#

using Microsoft.EntityFrameworkCore;
namespace Flawless.Server.Services;
public class RepositoryContext : DbContext
{
private readonly string RepositoryPath;
public RepositoryContext(IConfiguration config, DbContextOptions<RepositoryContext> options) : base(options)
{
RepositoryPath = Path.Combine(config["LocalStoragePath"] ?? "./Data", "Repository");
if (!Directory.Exists(RepositoryPath))
Directory.CreateDirectory(RepositoryPath);
}
}