using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Reflection;

namespace SystemX.Net.Platform.SystemX.Net.XEFCore
{
    public class XEFCore<T> where T : new()
    {
        public T Instance { get; }

        public XEFCore()
        {            
            Instance = new T();
        }

        public void SetConnectionString(string connectionString)
        {
            Type t = typeof(T);
            t.GetProperty("SqlServerConnectionString", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance).SetValue(Instance, connectionString);
        }
    }
}
