You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,
I want to filter out the data from Redis collection via passing the expressions dynamically using where condition.
The list from which I want to filter out the cache data:
var clientlist = new List { "3179471", "123456" };
and the model have the string value like:
x.OwnerId="3179471"
working fine and gives the required result redisCollections.Where(x => clientlst.Contains(x.OwnerId));
Does not giving the result when I am trying to do like this public Expression<Func<CaseDataModel, bool>> GetExpression(List<string> ownerIdList) { var casedata = Expression.Parameter(typeof(CaseDataModel), "p"); var ownerProperty = Expression.Property(casedata, "OwnerId"); var owners = Expression.Constant(ownerIdList); var ownerFilter = Expression.Call(owners, "Contains", null, ownerProperty); return Expression.Lambda<Func<CaseDataModel, bool>>(ownerFilter, casedata); } var query = GetExpression(clientList); redisCollections.Where(query);
I would be grateful for any help on this issue. Thank you in advance!
The text was updated successfully, but these errors were encountered:
Hello,
I want to filter out the data from Redis collection via passing the expressions dynamically using where condition.
The list from which I want to filter out the cache data:
var clientlist = new List { "3179471", "123456" };
and the model have the string value like:
x.OwnerId="3179471"
working fine and gives the required result
redisCollections.Where(x => clientlst.Contains(x.OwnerId));
Does not giving the result when I am trying to do like this
public Expression<Func<CaseDataModel, bool>> GetExpression(List<string> ownerIdList) { var casedata = Expression.Parameter(typeof(CaseDataModel), "p"); var ownerProperty = Expression.Property(casedata, "OwnerId"); var owners = Expression.Constant(ownerIdList); var ownerFilter = Expression.Call(owners, "Contains", null, ownerProperty); return Expression.Lambda<Func<CaseDataModel, bool>>(ownerFilter, casedata); } var query = GetExpression(clientList); redisCollections.Where(query);
I would be grateful for any help on this issue. Thank you in advance!
The text was updated successfully, but these errors were encountered: