I have the following table definition
[Table("MyTable")]
public class MyTable: BaseEntity
{
[Required]
public string A{ get; set; }
[Required]
[Column(TypeName = "json")]
public string B{ get; set; }
}
Column B looks like this:
{"Data": [{"Id":"b8a3cbbc-a4d6-4697-8a0b-cb1d15be179d"}]} (aside from Id there are other properties but for brevity I removed them)
In Entity Framework I want to match all MyTable's where the Id in B is a certain value and A has a certain value. I have tried a lot of things and get numerous errors. How can I add to the following code to achieve what I want?
var results =
_repository.Get<MyTable>(_ => _.A == "Something" && _.B = ???);
FromSqlRaw/Interpolatedto "unpack" the JSON data