aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.BL/ObservablesContextConfiguration.cs
blob: e3fb7dee4dc6f0a5664b042729c1fa4594508a56 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Data.Entity.Infrastructure;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Tango.BL
{
    public class ObservablesContextConfiguration : DbConfiguration
    {
        public String FolderPath { get; private set; }

        public ObservablesContextConfiguration() : base()
        {
            FolderPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "Twine", "Tango", "EFCache", Path.GetFileNameWithoutExtension(AppDomain.CurrentDomain.FriendlyName));
            Directory.CreateDirectory(FolderPath);
            SetModelStore(new DefaultDbModelStore(FolderPath));
        }
    }
}