Mapping.cs 836 B

123456789101112131415161718192021222324252627
  1. using Oreo.FileMan.Models;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.ComponentModel.DataAnnotations.Schema;
  5. using System.Data.Entity.Infrastructure.Annotations;
  6. using System.Data.Entity.ModelConfiguration;
  7. using System.Linq;
  8. using System.Text;
  9. using System.Threading.Tasks;
  10. namespace Oreo.FileMan.DatabaseEngine
  11. {
  12. public class FilesMap : EntityTypeConfiguration<Files>
  13. {
  14. public FilesMap()
  15. {
  16. this.Property(o => o.Id).HasColumnAnnotation("Index", new IndexAnnotation(new IndexAttribute() { IsUnique = true }));
  17. }
  18. }
  19. public class DrivesMap : EntityTypeConfiguration<Drives>
  20. {
  21. public DrivesMap()
  22. {
  23. this.Property(o => o.Id).HasColumnAnnotation("Index", new IndexAnnotation(new IndexAttribute() { IsUnique = true }));
  24. }
  25. }
  26. }