Skip to content

OneToMany relationship #27

@initreem

Description

@initreem

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions