Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OneToMany relationship #27

Open
cstehreem opened this issue May 1, 2020 · 0 comments
Open

OneToMany relationship #27

cstehreem opened this issue May 1, 2020 · 0 comments

Comments

@cstehreem
Copy link

cstehreem commented May 1, 2020

Is it possible to map relationships to classes? Here are my Models:

public class Word
{
    [PrimaryKey] [AutoIncrement] public int id { get; set; }
    public string normal_form { get; set; }
    public IList<Word_Orth> variants { get; set; }
}
public class Word_Orth
{
    [PrimaryKey] [AutoIncrement] public int id { get; set; }
    public int word_id { get; set; }
    public string orthogonal_form { get; set; }
}

One word can have many orthogonal forms. I want to be able to fetch words together with their orthogonal forms in a list. Is this possible?

My current query is SELECT * from Word inner join Word_Orth on Word_Orth.word_id == Word.id but it fetches multiple instances of Word and null in variants.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant