Open
Description
Is there a way to query hstore columns using LINQ ?
I would expect something like this to work:
public class Product
{
public int Id { get; set; }
//This is correctly set as hstore in OnModelCreating
public Dictionary<string, string> Tags { get; set; }
}
ApplicationDbContext db = ...
var prods = db.Products.Where(p => p.Tags["Variant"].Equals("SD")).ToList();
However that WHERE statement is evaluated at client and I want it to be evaluated in db server.
I expect something like this to be generated
select * from "Products" where "Tags" -> 'Variant' = 'SD'
This works so everything is configured correctly.
var prods = db.Products.FromSql("select * from \"Products\" where \"Tags\" -> 'Variant' = 'SD'").ToList();