Open LancelotProgrammer opened 5 months ago
Is it possible to apply the filter on a Dictionary<string, object>
I have this code
List<Dictionary<string, object>> products = []; // Product 1 Dictionary<string, object> product1 = new() { { "Department", "Wireless Mouse" }, { "Name", "Razer" }, { "Price", 10 }, { "InStock", 1 }, }; products.Add(product1); // Product 2 Dictionary<string, object> product2 = new() { { "Department", "Wireless Mouse" }, { "Name", "Logitech" }, { "Price", 20 }, { "InStock", 0 }, }; products.Add(product2); return products.BuildQuery(rule).FirstOrDefault();
The code give this error: Instance property 'department' is not defined for type 'System.Collections.Generic.Dictionary`2[System.String,System.Object]' (Parameter 'propertyName')
Is it possible to apply the filter on a Dictionary<string, object>
I have this code
List<Dictionary<string, object>> products = []; // Product 1 Dictionary<string, object> product1 = new() { { "Department", "Wireless Mouse" }, { "Name", "Razer" }, { "Price", 10 }, { "InStock", 1 }, }; products.Add(product1); // Product 2 Dictionary<string, object> product2 = new() { { "Department", "Wireless Mouse" }, { "Name", "Logitech" }, { "Price", 20 }, { "InStock", 0 }, }; products.Add(product2); return products.BuildQuery(rule).FirstOrDefault();
The code give this error: Instance property 'department' is not defined for type 'System.Collections.Generic.Dictionary`2[System.String,System.Object]' (Parameter 'propertyName')