I have a Person class that I save to a table in Azure Table Storage.
I want to query it with one of the following queries:
var query = from getThis in _serviceContext.CreateQuery<PersonForSearch>(_tableName)
where getThis.Name.Contains(searchTerm)
select new Person
{
PartitionKey = getThis.PartitionKey,
RowKey = getThis.RowKey,
Name = getThis.Name
};
OR
CloudTableQuery<Person> query =
(from getThis in _serviceContext.CreateQuery<Person>(_tableName)
where getThis.Name.Contains(searchTerm)
select getThis).AsTableServiceQuery<Person>();
With either one, I get the following error, thrown on the foreach loop I use to loop through the results of the query:
NotImplemented
The requested operation is not implemented on the specified resource.
I thought that perhaps this resulted from the fact that my Person model does not inherit from TableServiceEntity (I refuse to introduce that coupling - so I decorated it with this attribute instead: [DataServiceKey("PartitionKey", "RowKey")] and manually gave it a PartitionKey and RowKey property.
So I tried to create an entity that DID inherit from TableServiceEntity, which would allow me to query this table (as you can see from the queries, the only property I'm worried about is Name).
This new entity is as follows:
class PersonForSearch : TableServiceEntity
{
public string Name { get; set; }
}
However, this hasn't solved the problem. Is this error talking about some other resource than the class I'm using in my query?