I want make a class representing file/folder, which has one or none parent and can contain files/folders. Because My folder is special case of file. My model looks like this:
namespace WPP3.Base.DataModel
{
public class DbFileModel
{
[PrimaryKey]
public string Path { get; set; }
public DateTime DateCreated { get; set; }
public DateTime DateModified { get; set; }
public string DisplayName { get; set; }
public bool isFile { get; set; }
[ForeignKey(typeof(DbFileModel))]
public string ParentID { get; set; }
[OneToMany(null, null, CascadeOperations = CascadeOperation.All)]
public List<DbFileModel> Files { get; set; }
[ManyToOne(null, null, CascadeOperations = CascadeOperation.All)]
public DbFileModel ParentFile { get; set; }
}
}
But when I am trying to use this class, SQLite-NetExtension throws this exception: "DbFileModel.Files: OneToMany inverse relationship shouldn't be List or Array".
Can you advise how make that class using SQLiteNetExtensions?
Thank you very much :-)