Reputation: 265
Querying for an specific entity having e.RowKey.ToLower() throws an exception
CustomerEntity customerEntity = (from e in serviceContext.CreateQuery<CustomerEntity>("Customer")
where e.RowKey.ToLower() == firstName.ToLower()
select e).FirstOrDefault();
Basically i want to check for case insensitive username..Azure table is managed by our partner so i can not instruct them to enter the User entry into table in lower case.
I need to handle this in code.
REgards, Vivek
Upvotes: 1
Views: 846
Reputation: 9414
ToLower() isn't valid as part of the filter expression because Table Storage doesn't support that as an operation.
You have two options:
Upvotes: 3
Reputation: 6133
You're getting an exception because the ToLower()
method is not a supported method in Azure.
I think you could do the comparison this way instead
where e.RowKey.Equals(username, StringComparison.InvariantCultureIgnoreCase);
It should accomplish what you're trying to do, but it uses the supported Equals()
method instead.
Upvotes: 0