Closed rambod17 closed 6 years ago
Can you show the declaration of the Post
class?
[Table.Name("Post")]
class Post
{
[Column.PrimaryKey(AutoIncrement = true)]
public int Id { get; set; }
public string Text { get; set; }
public string LocalPath { get; set; }
public string RemotePath { get; set; }
[Relation.ManyToOne]
public Fallow fallow { get; set; }
}
You need a way to point the Post object to the Fallow object.
So you need a field called FallowId in the Post class, and tell the relation how to link them:
[Table.Name("Post")]
class Post
{
[Column.PrimaryKey(AutoIncrement = true)]
public int Id { get; set; }
public int FallowId {get;set;}
public string Text { get; set; }
public string LocalPath { get; set; }
public string RemotePath { get; set; }
[Relation.ManyToOne(LocalKey="FallowId")]
public Fallow fallow { get; set; }
}
[Table.Name("Following")]
public class Fallow
{
[Column.PrimaryKey(AutoIncrement = true)]
public long Pk { get; set; }
public string ProfilePicture { get; set; }
public string ProfilePictureId { get; set; }
public string UserName { get; set; }
public string FullName { get; set; }
[Relation.OneToMany(ForeignKey="FallowId")]
public IDataSet<Post> Posts;
}
not work
Can you please attach a project that reproduces this?
Can not help me?
As I said, you need to add a field called FallowId in your Post class. The test project you attached doesn't have that.
You are right. Thank you for your quick replay