I'm using CoolStorage in a project where I have some Many-to-Many relationships. Some of the join tables have extra data on them which describe the relationship.
For example: Table Alpha, Beta, and AlphaBeta.
Many-to-Many relationship between Alpha and Beta is stored in AlphaBeta. Primary key of AlphaBeta is the combination of the keys from Alpha(AlphaID) and Beta(BetaID), which is (AlphaID, BetaID).
But AlphaBeta also has some additional data like 'DisplayOrder INT NOT NULL'
in the data classes, I have the Many-to-Many relationships defined using the [ManyToMany("AlphaBeta", pure=true)] attribute, but how can I access the DisplayOrder for each?
I don't think it matters, but this is a Windows Phone app using SQLite.
If you have additional fields in your link table, you have to set "pure = false" and add a data object for the link table.
Your link data object might look like this:
[MapTo("AlphaBeta")]
public abstract class AlphaBeta : CSObject<AlphaBeta>
{
[ManyToOne]
public abstract Alpha Aplha { get; set; }
[ManyToOne]
public abstract Beta Beta { get; set; }
public abstract int DisplayOrder { get; set; }
}