I want to retrieve a user with a specific role. The table has a List of roles serialized to the Roles field (ie: not using the separate roles table).
What is the best way to query the table using ORMLite to retrieve users with a specific role. I have the following code, but it retrieves the entire users table. Looking at the SQL trace, the query doesn’t contain any filters.
var users = db.Select<UserAuth>().Where(u => u.Roles.Contains(RoleType.AccountManager.ToString()));
By default Roles and Permissions are blobbed with the UserAuth and the only way to inspect a blobbed field is to deserialize it on the client, i.e. you can’t search a blob field with a server-side SQL query.