locked
Correct query from table storage RRS feed

  • Question

  • Hello.

    Can someone help me to do correct select query from Azure Table storage

    The query is symple itself

    MyEntity en = (from e in serviceContext.CreateQuery<MyEntity>(tablename)                                             where e.RowKey == email.ToLower()                                             select e).FirstOrDefault();

    The question is how to e.RowKey convert ToLower()? This action is not performed on Azure  by default
    Friday, July 13, 2012 9:11 PM

Answers

  • Hi vitaliyalfa,

    You could try to query it like this:

    where e.RowKey.Equals(email, StringComparison.InvariantCultureIgnoreCase);

    If it doesn´t work, what you could do is:

    Option A) make sure you always save your RowKey values in Lowered case (for example), so that when you need to filter it you don't run on this case-sensitivity issue.

    Option B) store a numeric value on your RowKey instead, if possible.

    Hope this helps!


    Cheers, Carlos Sardo





    Friday, July 13, 2012 9:36 PM

All replies

  • Hi vitaliyalfa,

    You could try to query it like this:

    where e.RowKey.Equals(email, StringComparison.InvariantCultureIgnoreCase);

    If it doesn´t work, what you could do is:

    Option A) make sure you always save your RowKey values in Lowered case (for example), so that when you need to filter it you don't run on this case-sensitivity issue.

    Option B) store a numeric value on your RowKey instead, if possible.

    Hope this helps!


    Cheers, Carlos Sardo





    Friday, July 13, 2012 9:36 PM
  • where e.RowKey.Equals(email, StringComparison.InvariantCultureIgnoreCase);
    Thanks. It works  fine
    Saturday, July 14, 2012 9:15 PM