You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi there,
i googled a lot including chatgpt, none of it is working for me.
I am trying to do a very simple one to many relation between 2 tables, and get the sequence contains no elements exception.
[TableName("ServiceProviders")]
[PrimaryKey("Id")]
[ExplicitColumns]
public class ServiceProvider
{
[Column("ServiceProviderId")]
public int Id { get; set; }
[Reference(ReferenceType.Many, ColumnName = "ServiceProviderId", ReferenceMemberName = "MemberId")]
public List<Test> Tests { get; set; }
}
[TableName("Tests")]
[PrimaryKey("Id", AutoIncrement = true)]
[ExplicitColumns]
public class Test
{
[Column("TestId")]
public int Id { get; }
[Column("MemberId")]
public int MemberId { get; set; }
[Reference(ReferenceType.Foreign, ColumnName = "ServiceProviderId", ReferenceMemberName = "Id")]
public ServiceProvider ServiceProvider { get; set; }
}
I also tried the following without success:
[TableName("ServiceProviders")]
[PrimaryKey("Id")]
[ExplicitColumns]
public class ServiceProvider
{
[Column("ServiceProviderId")]
public int Id { get; set; }
[Reference(ReferenceType.Many, ColumnName = "ServiceProviderId", ReferenceMemberName = "ServiceProvider")]
public List<Test> Tests { get; set; }
}
[TableName("Tests")]
[PrimaryKey("Id", AutoIncrement = true)]
[ExplicitColumns]
public class Test
{
[Column("TestId")]
public int Id { get; }
[Column("MemberId")]
public int MemberId { get; set; }
[Reference(ReferenceType.Foreign, ColumnName = "ServiceProviderId", ReferenceMemberName = "Id")]
public ServiceProvider ServiceProvider { get; set; }
}
what am i missing?
Best,
Dee
The text was updated successfully, but these errors were encountered:
Hi there,
i googled a lot including chatgpt, none of it is working for me.
I am trying to do a very simple one to many relation between 2 tables, and get the sequence contains no elements exception.
I also tried the following without success:
what am i missing?
Best,
Dee
The text was updated successfully, but these errors were encountered: