SiteMap.cs 880 B

12345678910111213141516171819202122232425262728293031323334
  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.Department);
  18. Property(s => s.Comment);
  19. Property(s => s.Start);
  20. Property(s => s.End);
  21. Property(s => s.Finished);
  22. HasMany(s => s.Users)
  23. .WithMany()
  24. .Map(m => m.ToTable("SiteUsers"));
  25. HasMany(s => s.Appendices)
  26. .WithOptional();
  27. }
  28. }
  29. }