Is there is a way to search in List<Dictionary<string, object>> with a non specific string, like the LIKE OPERATION(%) in SQL and return the new List<Dictionary<string, object>>
I found this stuff, but it uses a specific string to search. Search for a value in List<Dictionary<string, object>>
For example, I have a list Dictionary like this:
List<Dictionary<string, object>> userList = new List<Dictionary<string, object>>(){
new Dictionary<string, object>() {
{"Id", 1},
{"Name", "John"}
},
new Dictionary<string, object>() {
{"Id", 2},
{"Name", "Foo"}
},
new Dictionary<string, object>() {
{"Id", 3},
{"Name", "Admin"}
},
new Dictionary<string, object>() {
{"Id", 4},
{"Name", "AdminAccount"}
},
}
If the user want to search a string "Jo", then he/she can get the first list with "John" name. But if the search string is "Admin", then first two last Dictionary will return.
Actually, this is achievable using loop. But I want to learn how to use LINQ to make my codes shorter.