Mon problème est que si je veux créer deux tables avec une relation [OneToMany]
entre ces deux.Sqlite.net ne crée pas les attributs de Sqlite.net Extension
public class Order : BusinessEntity
{
[PrimaryKey]
public Guid Id{ get; set; }
[MaxLength(20)]
public string Title{ get; set;}
[MaxLength(20)]
public string Location{ get; set; }
public DateTime OrderGenerated{ get; set; }
[OneToMany(CascadeOperations=CascadeOperation.All)]
public List<OrderPos> Positions{ get; set; }
}
[Table("OrderPos")]
public class OrderPos : BusinessEntity
{
[PrimaryKey]
public Guid Id{ get; set; }
[ForeignKey(typeof(Order)), ManyToOne]
public Guid OrderId{ get; set; }
[MaxLength(20)]
public string MaterialNr{ get; set; }
[MaxLength(10)]
public string State{ get; set; }
public int Amount{ get; set; }
}
La table OrderPos a été créé sans foreignkey et si je reçois une exception à la méthode InsertOrUpdateAllWithChildren
.
Devrais-je utiliser une autre classe dérivée de SqliteConnection
?
Cordialement, Thomas