1

関連エンティティにリンクされた 2 つのエンティティがあります。コードでは、これらの 1 つまたはすべてを一度に簡単に挿入できます。しかし、フロントエンドでは、ユーザーがデータを入力できるようにするために FormViews を使用しています。住所を挿入するとき、同じフォームビューに施設と住所がない限り、施設を同時に挿入することをどのように知らせるのですか?

Public Class facility

  <Key()> _
  Public Property facility_id As Integer
  Public Property facility_present_use As String
  Public Property facility_prior_use As String
  Public Property facility_occupied As Boolean
  Public Property facility_size As Double
  Public Property facility_floors As Integer
  Public Property facility_age As Integer
  Public Property facility_single_residence As Boolean
  Public Property facility_number_of_units As Integer      

  Public Overridable Property facility_address As ICollection(Of facility_address) = New HashSet(Of facility_address)

End Class

Public Class address

  <Key()> _
  Public Property address_id As Integer
  Public Property address_name As String
  Public Property address_address_1 As String
  Public Property address_address_2 As String
  Public Property address_city As String
  Public Property address_state As Integer?
  Public Property address_zip As String
  Public Property address_contact_first_name As String
  Public Property address_contact_last_name As String
  Public Property address_phone_area As String
  Public Property address_phone As String

  Public Overridable Property lu_state As lu_state
  Public Overridable Property facility_address As ICollection(Of facility_address) = New HashSet(Of facility_address)

End Class

Public Class facility_address

  <Key()> _
  Public Property facility_address_id As Integer
  Public Property address_type As Integer
  Public Property facility_id As Integer
  Public Property address_id As Integer

  Public Overridable Property lu_address_type As lu_address_type
  Public Overridable Property facility As facility
  Public Overridable Property address As address
End Class
4

0 に答える 0