AppendixMap.cs 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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.Appendix
  8. {
  9. public class AppendixMap : EntityTypeConfiguration<Core.Domain.Appendix.Appendix>
  10. {
  11. public AppendixMap()
  12. {
  13. ToTable("Appendix");
  14. HasKey(a => a.Id);
  15. HasOptional(a => a.Site)
  16. .WithMany(s => s.Appendices)
  17. .HasForeignKey(a => a.SiteId);
  18. Property(a => a.CustomNumber);
  19. Property(a => a.Lot);
  20. Property(a => a.Comment);
  21. Property(a => a.Value);
  22. Property(a => a.Probability);
  23. Property(a => a.OfferingNumber);
  24. Property(a => a.OfferingDate);
  25. Property(a => a.NegotiationDate);
  26. Property(a => a.NegotiationValue);
  27. Property(a => a.ProtocolExists);
  28. Property(a => a.OrderNumber);
  29. Property(a => a.OrderDate);
  30. HasMany(s => s.Categories)
  31. .WithMany()
  32. .Map(a => a.ToTable("AppendixCategories"));
  33. HasMany(s => s.Deviations)
  34. .WithOptional();
  35. HasMany(s => s.Invoices)
  36. .WithMany()
  37. .Map(a => a.ToTable("AppendixInvoices"));
  38. }
  39. }
  40. }