Skip to content

Filter on foreign key doesn'y work #104

@fabiogravna

Description

@fabiogravna

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions