mercredi 23 septembre 2015

Multiple @OneToOne on same object with SQLite.Net.Async Extensions PCL 1.3.0?

Is it possible to have multiple OneToOne relationships within an entity using SQLite.Net.Async Extensions PCL 1.3.0?

Example:

[Table("body")]
public class Body
{
    [OneToOne(CascadeOperations = CascadeOperation.All)]
    [Column ("left")]
    public Hand Left { get; set; }

    [OneToOne(CascadeOperations = CascadeOperation.All)]
    [Column ("right")]
    public Hand Right { get; set; }
}

[Table("hand")]
public class Hand
{
    // In this I do not need a reference back to Body.
}

I have been trying using the following answer:

SQLite-Net Extension both one-to-one and one-to-many relationships between two entities

And with these site as inspiration also:

http://ift.tt/1dAHXdL

http://ift.tt/1WjNRCh

Unfortunately with no luck so far. Is it even possible?

Aucun commentaire:

Enregistrer un commentaire