Blame view

Vrh.Web.OneReport.Lib/DbModels/Mapping/LastSettingsSetMap.cs 1.13 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
37
38
  using System;
  using System.Collections.Generic;
  using System.Data.Entity.ModelConfiguration;
  using System.Linq;
  using System.Text;
  using System.Threading.Tasks;
  
  namespace Vrh.OneReport.Lib.Areas.OneReport.DbModels.Mapping
  {
      public class LastSettingsSetMap : EntityTypeConfiguration<LastSettingsSet>
      {
          public LastSettingsSetMap()
          {
              // Primary Key
              this.HasKey(t => t.Id);
  
              // Properties
              this.Property(t => t.User)
                  .IsRequired();
  
              this.Property(t => t.Query)
                  .IsRequired();
  
              // Table & Column Mappings
              this.ToTable("LastSettingsSet");
              this.Property(t => t.User).HasColumnName("User");
              this.Property(t => t.Query).HasColumnName("Query");
              this.Property(t => t.Id).HasColumnName("Id");
              this.Property(t => t.QuerySettings_Id).HasColumnName("QuerySettings_Id");
  
              // Relationships
              this.HasOptional(t => t.QuerySettingsSet)
                  .WithMany(t => t.LastSettingsSets)
                  .HasForeignKey(d => d.QuerySettings_Id);
  
          }
      }
  }