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; }
}
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