android - SQLite Extensions exception: ManyToOne relationship destination must have Primary Key -
you can see error in title. there table classes:
public class cars : table { [notnull] public string name { get; set; } [foreignkey(typeof(models)), notnull] public int model_out_id { get; set; } [foreignkey(typeof(bodies)), notnull] public int body_out_id { get; set; } [maxlength(50)] public string vin { get; set; } [maxlength(4), notnull] public int year { get; set; } [indexed, notnull] public long created_at { get; set; } = datetime.now.gettimestamp(); [manytoone(cascadeoperations = cascadeoperation.cascaderead)] public models model { get; set; } [manytoone(cascadeoperations = cascadeoperation.cascaderead)] public bodies body { get; set; } [onetomany] public list<carglasses> carglasses { get; set; } public cars() { } } public class models : tablelibrary { [primarykey, notnull] public int out_id { get; set; } [notnull] public string name { get; set; } [foreignkey(typeof(marks)), notnull] public int mark_out_id { get; set; } [indexed, notnull] public int year_from { get; set; } [indexed] public int? year_to { get; set; } [manytoone(cascadeoperations = cascadeoperation.cascaderead), ignore] public marks mark { get; set; } public models() { } }
error occurs here:
inst.getchild(car, "model");
inst
sqlite.net.sqliteconnection
instance
everything worked fine when used library plain code, added pcl reference. can see primarykey exists in models
table. what's wrong code?
here thread on xamarin forums. i've got solution there.
Comments
Post a Comment