I have a cross platform app using Sqlite.net. How do I go about declaring a FK? Say I have these tables, with a FK from Area to Location (and a self referencing FK from Area to Area via ParentID), and ignoring the fact that the IDs are Guids, that is a constraint I inherited from the client and cannot change, although I could declare them as strings) :
public class Location
{
[PrimaryKey]
public Guid Id { get; set; }
public string Label { get; set; }
}
public class Area
{
[PrimaryKey]
public Guid Id { get; set; }
// self refrerence FK
public Guid? ParentId { get; set; }
public string Label { get; set; }
// the FK to Loaction
public Guid LocationId { get; set; }
//public ICollection<Area> Children { get; set; }
//public ICollection<Task> Tasks { get; set; }
}
How would I go about declaring the two FKs in Area?
John