UserMap.cs 870 B

123456789101112131415161718192021222324252627282930313233
  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.CustomId);
  16. Property(u => u.Forename);
  17. Property(u => u.Lastname);
  18. Property(u => u.MailAddress);
  19. Property(u => u.Password);
  20. HasMany(c => c.Roles)
  21. .WithMany()
  22. .Map(m => m.ToTable("UserRoles"));
  23. HasMany(c => c.MailNotifications)
  24. .WithMany()
  25. .Map(m => m.ToTable("UserMailNotifications"));
  26. }
  27. }
  28. }