Sys_Announcement_Mapping.cs 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. //------------------------------------------------------------------------------
  2. // <auto-generated>
  3. // This code was generated from a template.
  4. //
  5. // Manual changes to this file may cause unexpected behavior in your application.
  6. // Manual changes to this file will be overwritten if the code is regenerated.
  7. // </auto-generated>
  8. //------------------------------------------------------------------------------
  9. namespace EMIS.Entities
  10. {
  11. #pragma warning disable 1573
  12. using System;
  13. using System.Collections.Generic;
  14. using System.ComponentModel.DataAnnotations;
  15. using System.Data.Common;
  16. using System.Data.Entity;
  17. using System.Data.Entity.ModelConfiguration;
  18. using System.Data.Entity.Infrastructure;
  19. using System.ComponentModel.DataAnnotations.Schema;
  20. internal partial class Sys_Announcement_Mapping : EntityTypeConfiguration<Sys_Announcement>
  21. {
  22. public Sys_Announcement_Mapping()
  23. {
  24. this.HasKey(t => t.AnnouncementID);
  25. this.ToTable("Sys_Announcement");
  26. this.Property(t => t.AnnouncementID).HasColumnName("AnnouncementID");
  27. this.Property(t => t.AnnouncementTypeID).HasColumnName("AnnouncementTypeID");
  28. this.Property(t => t.Title).HasColumnName("Title").HasMaxLength(100);
  29. this.Property(t => t.Content).HasColumnName("Content");
  30. this.Property(t => t.StartTime).HasColumnName("StartTime");
  31. this.Property(t => t.EndTime).HasColumnName("EndTime");
  32. this.Property(t => t.IsTop).HasColumnName("IsTop");
  33. this.Property(t => t.RecordStatus).HasColumnName("RecordStatus");
  34. this.Property(t => t.CreateTime).HasColumnName("CreateTime");
  35. this.Property(t => t.CreateUserID).HasColumnName("CreateUserID");
  36. this.Property(t => t.ModifyUserID).HasColumnName("ModifyUserID");
  37. this.Property(t => t.ModifyTime).HasColumnName("ModifyTime");
  38. this.HasOptional(t => t.Sys_AnnouncementType).WithMany(t => t.Sys_Announcement).HasForeignKey(d => d.AnnouncementTypeID);
  39. this.HasMany(t => t.Sys_Role).WithMany(t => t.Sys_Announcement)
  40. .Map(m =>
  41. {
  42. m.ToTable("Sys_Announcement_Sys_Role");
  43. m.MapLeftKey("AnnouncementID");
  44. m.MapRightKey("RoleID");
  45. });
  46. this.HasMany(t => t.Sys_User).WithMany(t => t.Sys_Announcement)
  47. .Map(m =>
  48. {
  49. m.ToTable("Sys_Announcement_Sys_User");
  50. m.MapLeftKey("AnnouncementID");
  51. m.MapRightKey("UserID");
  52. });
  53. }
  54. }
  55. }