Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 8th, 2012  |  syntax: None  |  size: 0.40 KB  |  hits: 11  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Code First mapping
  2. Class Department
  3.     Property DepartID As Integer = 0
  4.     Property DepartName As String
  5. End Class
  6.        
  7. Class Employee
  8.     Property EmployeeID As Integer
  9.     Property DepartID As Integer
  10.  
  11.     ' Navigational Property
  12.     Overridable Property Depart As Department
  13. End Class
  14.        
  15. .HasRequired(Function(e) e.Depart).WithMany.HasForeignKey(Function(e) e.DepartID).WillCascadeOnDelete(False)