Note that there are some explanatory texts on larger screens.

plurals
  1. POParent and Child object in SimpleRepository
    primarykey
    data
    text
    <p>How would it work in Subsonic's SimpleReporitory if I wanted to be able to have a 1 to many relationship between objects?</p> <p>Would I have to create a bridge object and then build my parent object at runtime, or is this support built in?</p> <p>What I am looking for is the folowing:</p> <p>Adam's Example Shop...</p> <pre> Public Class Shop Private m_id As Integer Private m_Name As String Private m_Employees As List(Of Employee) Public Property Id() As Integer Get Return m_id End Get Set(ByVal value As Integer) m_id = value End Set End Property Public Property Name() As String Get Return m_Name End Get Set(ByVal value As String) m_Name = value End Set End Property Public Property Employees() As List(Of Employee) Get Return m_Employees End Get Set(ByVal value As List(Of Employee)) m_Employees = value End Set End Property End Class Public Class Employee Private m_id As Integer Private m_Name As String Public Property Id() As Integer Get Return m_id End Get Set(ByVal value As Integer) m_id = value End Set End Property Public Property Name() As String Get Return m_Name End Get Set(ByVal value As String) m_Name = value End Set End Property End Class</pre> <p>Main bits:</p> <pre> Dim repo As New SimpleRepository("SubSonicObjectTest", SimpleRepositoryOptions.RunMigrations) Dim emplyee1 As New Employee emplyee1.Name = "Martin" Dim emplyee2 As New Employee emplyee2.Name = "Adam" Dim shop As New Shop shop.Name = "Sub Sonic Store" shop.Employees = New List(Of Employee) shop.Employees.Add(emplyee1) shop.Employees.Add(emplyee2) repo.Add(Of Shop)(shop) </pre> <p>I think this should create 3 tables:</p> <p>Shops<br> Employees<br> ShopsToEmployees (or some other naming convention) </p> <p>But I only get a Channels table!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload