SiteMap.cs 912 B

123456789101112131415161718192021222324252627282930313233343536
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Data.Entity.ModelConfiguration;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. namespace GreenTree.Nachtragsmanagement.Data.Mapping.Site
  8. {
  9. public class SiteMap : EntityTypeConfiguration<Core.Domain.Site.Site>
  10. {
  11. public SiteMap()
  12. {
  13. ToTable("Site");
  14. HasKey(s => s.Id);
  15. Property(s => s.CustomNumber);
  16. Property(s => s.Description);
  17. Property(s => s.Comment);
  18. Property(s => s.Start);
  19. Property(s => s.End);
  20. Property(s => s.Finished);
  21. HasMany(s => s.Users)
  22. .WithMany()
  23. .Map(m => m.ToTable("SiteUsers"));
  24. HasMany(s => s.Appendices)
  25. .WithOptional();
  26. HasMany(s => s.Deviations)
  27. .WithOptional();
  28. }
  29. }
  30. }