Please specify a Many to One replationship between AttendanceRecord entity and Users
public class AttendanceRecord
{
[PrimaryKey, AutoIncrement]
public int ID { get; set; }
[ForeignKey(typeof(Users))]
public int UserID { get; set; }
public DateTime InDate { get; set; }
public double InLatitude { get; set; }
public double InLongitude { get; set; }
public DateTime OutDate { get; set; }
public double OutLatitude { get; set; }
public double OutLongitude { get; set; }
public bool IsIsSynchronize { get; set;}
[ManyToOne] // Many to one relationship with Users
public Users Users { get; set; }
}
Also, run the below command and check if ForeignKey support is enabled on the SQLite instance you are using.
sqlite> PRAGMA foreign_keys;
If not enabled, you will have to enable it manually by issuing the below command
sqlite> PRAGMA foreign_keys = ON;
--
If you found this Answer helpful, please “Accept Answer” and Up-Vote for the same which might be beneficial to other community members reading this thread.