UserMap.cs 693 B

12345678910111213141516171819202122232425262728
  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. HasMany(c => c.Roles)
  20. .WithMany()
  21. .Map(m => m.ToTable("UserRoles"));
  22. }
  23. }
  24. }