Blame view

Vrh.Web.OneReport.Lib/DbModels/QueryContext.cs 1 KB
ab9f2fbe   Schwirg László   Add project files.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
  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";
      }
  }