Hi,
I've stumbled upon one following issue: I have two tables connected in one to many relationship. This is ContentElement and Language - Content can have one Language, Language can be assigned to many ContentElements.
The relationship I'm interested in is from Content to Language.
In database, tables are named ContentElements and Languages to make it sound a bit better when making queries.
public class ContentElement
{
public int ContentElementId {get;set;}
public Language Language {get;set;}
}
public class Language
{
public string LanguageId {get;set;}
public string Name {get;set;}
}
With this, I can do query:
List<ContentElement> e = db.ContentElements.All().WithLanguages();
But it won't populate Language property with instance of an object. However, if I will rename it to Languages then it will.
I'm using Simple.Data v. 0.18.3.1 with Simple.Data.PostgreSql - latest version from github (unfortunately not available as NuGet package, author seems to handle it with some delay).
Is this problem from using PostgreSql? Is there any way I can work around this issue simply? Having single-element property with plural name seems dirty. Ideally I would like to name this property DefaultLanguage but that's the trade off I'm willing to accept to have some fun with this pretty awesome library.
Hi, I've stumbled upon one following issue: I have two tables connected in one to many relationship. This is ContentElement and Language - Content can have one Language, Language can be assigned to many ContentElements. The relationship I'm interested in is from Content to Language. In database, tables are named ContentElements and Languages to make it sound a bit better when making queries.
Classes:
With this, I can do query:
But it won't populate
Language
property with instance of an object. However, if I will rename it toLanguages
then it will.I'm using Simple.Data v. 0.18.3.1 with Simple.Data.PostgreSql - latest version from github (unfortunately not available as NuGet package, author seems to handle it with some delay).
Is this problem from using PostgreSql? Is there any way I can work around this issue simply? Having single-element property with plural name seems dirty. Ideally I would like to name this property
DefaultLanguage
but that's the trade off I'm willing to accept to have some fun with this pretty awesome library.