SQLite データベースと SQLite-Net Exensions を使用して、同じテーブルに 2 つの外部キーを追加し、毎回外部キーの 1 つを空にすることができるかどうかを知りたいです。
私の構造は次のとおりです。
[Table("Picture")]
public class Picture
{
[PrimaryKey]
public int Id { get; set; }
public string Name { get; set; }
[ForeignKey(typeof(Contact))] // => Allow Null ?
public string TokenContact { get; set; }
[ForeignKey(typeof(Profile))] // Allow Null ?
public string TokenProfile { get; set; }
}
[Table("Contact")]
public class Contact
{
[PrimaryKey]
public string Token {get;set;}
[OneToMany]
public ObservableCollection<Picture> CollectionPicture {get; set;}
}
[Table("Profile")]
public class Profile:Contact
{
// Some other properties...
}
アドバイスありがとうございます!