core-admin icon indicating copy to clipboard operation
core-admin copied to clipboard

Filter on foreign key doesn'y work

Open fabiogravina opened this issue 2 years ago • 0 comments

I'have a table with a foreign key that is correctly displayed using the ToString override. But i cannot filter on that column. here is ma code : ` public class Carrello { [Key] [DatabaseGenerated(DatabaseGeneratedOption.Identity)] public int Id { get; set; }

 public string? Note { get; set; }

 [Display(AutoGenerateField = false)]
 public int StatoCarrelloId { get; set; }

 [ForeignKey("StatoCarrelloId")]
 public StatoCarrello StatoCarrello { get; set; }

}

public class StatoCarrello { [Key] [DatabaseGenerated(DatabaseGeneratedOption.Identity)] public int Id { get; set; }

 public string Name { get; set; } = string.Empty;

 public override string ToString()
 {
     return Name ?? String.Empty;
 }

} `

If I try filtering on StatoCarrello nothing append. As you can see it is visible on the toolbar link

image

Thanks Regards

fabiogravina avatar Feb 16 '24 14:02 fabiogravina