2021-07-22 12:29:26 -04:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Text.Json;
|
|
|
|
|
using Microsoft.EntityFrameworkCore;
|
2021-08-13 00:34:47 -04:00
|
|
|
|
using RulesEngine.Data;
|
2021-07-22 12:29:26 -04:00
|
|
|
|
using RulesEngine.Models;
|
|
|
|
|
|
|
|
|
|
namespace DemoApp.EFDataExample
|
|
|
|
|
{
|
2021-08-13 00:34:47 -04:00
|
|
|
|
public class RulesEngineDemoContext : RulesEngineContext
|
2021-07-22 12:29:26 -04:00
|
|
|
|
{
|
|
|
|
|
public string DbPath { get; private set; }
|
|
|
|
|
|
|
|
|
|
public RulesEngineDemoContext()
|
|
|
|
|
{
|
|
|
|
|
var folder = Environment.SpecialFolder.LocalApplicationData;
|
|
|
|
|
var path = Environment.GetFolderPath(folder);
|
|
|
|
|
DbPath = $"{path}{System.IO.Path.DirectorySeparatorChar}RulesEngineDemo.db";
|
|
|
|
|
}
|
|
|
|
|
protected override void OnConfiguring(DbContextOptionsBuilder options)
|
|
|
|
|
=> options.UseSqlite($"Data Source={DbPath}");
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|