Brett Brett - 9 days ago 5
C# Question

Azure Table Storage - Why are my bool and string properties being stored, but my int and double properties are not?

This sounds like it should be a simple issue, but I am having difficulty singling it out.

I have a

TableEntity
class that I am trying to write to
Azure Table Storage
:

public class MyEntity : TableEntity
{
public MyEntity(string imageId, string featureId)
{
this.PartitionKey = imageId;
this.RowKey = featureId;
}

public string Container { get; set; }
public bool FeatureEnabled { get; set; }
public int data;
public PointF Point;
public double X;
public double Y;

}


I understand that my
Point
property will not be saved to Table Storage. But when I insert this entity, the
Container
property and
FeatureEnabled
both get stored, but nothing else?

How can this be?
int
and
double
are said to be supported, so what could I be doing wrong here?

Answer

The Container and FeatureEnabled are Properties of the class. The others are simply Fields. TableEntity will only search for and automatically save Properties (of the supported types).

So make data, x, and y into properties by providing get; set; in the same way as the ones that do work.

Comments