LogMap.cs 1022 B

12345678910111213141516171819202122232425262728293031323334353637
  1. using GreenTree.Nachtragsmanagement.Core.Domain.Logging;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Data.Entity.ModelConfiguration;
  5. using System.Linq;
  6. using System.Text;
  7. using System.Threading.Tasks;
  8. namespace GreenTree.Nachtragsmanagement.Data.Mapping.Logging
  9. {
  10. public class LogMap : EntityTypeConfiguration<Log>
  11. {
  12. public LogMap()
  13. {
  14. ToTable("Log");
  15. HasKey(l => l.Id);
  16. Property(l => l.CreatedOnUtc);
  17. Property(l => l.FullMessage);
  18. Property(l => l.LogLevelId);
  19. Property(l => l.EntityId);
  20. Property(l => l.EntityType);
  21. Property(l => l.ShortMessage);
  22. Property(l => l.IpAddress);
  23. Property(l => l.PageUrl);
  24. Property(l => l.ReferrerUrl);
  25. Ignore(l => l.LogLevel);
  26. HasOptional(l => l.User)
  27. .WithMany()
  28. .HasForeignKey(l => l.UserId)
  29. .WillCascadeOnDelete(true);
  30. }
  31. }
  32. }