UserMap.cs 915 B

1234567891011121314151617181920212223242526272829303132333435
  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.User
  8. {
  9. public class UserMap : EntityTypeConfiguration<Core.Domain.User.User>
  10. {
  11. public UserMap()
  12. {
  13. ToTable("User");
  14. HasKey(u => u.Id);
  15. Property(u => u.CustomNumber);
  16. Property(u => u.Forename);
  17. Property(u => u.Lastname);
  18. Property(u => u.MailAddress);
  19. Property(u => u.Password);
  20. Ignore(u => u.CurrentRole);
  21. HasMany(c => c.Roles)
  22. .WithMany()
  23. .Map(m => m.ToTable("UserRoles"));
  24. HasMany(c => c.MailNotifications)
  25. .WithMany()
  26. .Map(m => m.ToTable("UserMailNotifications"));
  27. }
  28. }
  29. }