using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using Vrh.XmlProcessing;
using Vrh.OneReport.Lib.Areas.OneReport.DbModels.Mapping;

namespace Vrh.OneReport.Lib.Areas.OneReport.DbModels
{
    public partial class QueryContext : DbContext
    {
        static QueryContext()
        {
            Database.SetInitializer<QueryContext>(null);
        }

        public QueryContext()
            : base(ConnectionStringStore.Get(APM_CONTEXT_NAME))
        {
        }

        public DbSet<LastSettingsSet> LastSettingsSets { get; set; }
        public DbSet<QuerySettingsSet> QuerySettingsSets { get; set; }

        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            modelBuilder.Configurations.Add(new LastSettingsSetMap());
            modelBuilder.Configurations.Add(new QuerySettingsSetMap());
        }

        public const string APM_CONTEXT_NAME = "Log4Pro_APM_QueryContext";
    }
}
