We have a database and some table in it. This table has Filters column to store filters, available for items of this table. and we have partial filters from client which we need to compare with database ones. For example:
database filter column value:
"ANIMAL":["DOG", "CAT", "PARROT", "SNAKE"]
and from client we receive:
"ANIMAL":["PARROT"]
In our case client's filter suits us because we have ANIMAL
and PARROT
in filter column.
So in usual T-SQL it would be written like something like this:
SELECT * FROM TableWithFilters WHERE Filter LIKE '%"ANIMAL":[%"PARROT"%]%'
But I don't know how can i write this using Entity Framework and if it's at least possible?