I’m using Query Entity Records Activity, and passing Argument/Variable to the condition as per the screen shot below. I would like to handle the following case:
In case the Argument/Variable is NULL then I need to retrieve all the records.
I know I can use If-else however I have complex query and using if-else will not be practical.
@hgaber105 You can use the below code into your data table
var results = (from e in YourEntities // Replace with your actual entity collection
where YourArgument == null || e.YourField == YourArgument
select e).ToList();
YourArgument == null => This will check if your Argument is null and query not check the next condition, This should be your first condition to check
I hope @hgaber105 it sove your issue.