Advertisement
Guest User

Untitled

a guest
Aug 25th, 2016
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. public MovimientoMap()
  2. {
  3. ToTable("Movimientos");
  4. HasKey(c => c.MovimientoId);
  5. Property(c => c.MovimientoId).HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity);
  6. Property(c => c.MovimientoId).HasColumnOrder(0);
  7.  
  8. HasRequired(c=>c.TipoOperacion).WithMany(c=>c.Movimientos).HasForeignKey(c=>c.TipoOperacionId)
  9. .WillCascadeOnDelete(false);
  10. Property(c => c.TipoOperacionId).HasColumnOrder(1);
  11. Property(c => c.FechaMovimiento).HasColumnOrder(2);
  12.  
  13. Map<MovimientoCompra>(c => c.Requires("Type")
  14. .HasValue("C")
  15. .HasColumnType("char")
  16. .HasMaxLength(1));
  17.  
  18. Map<MovimientoVenta>(c => c.Requires("Type")
  19. .HasValue("V"));
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement