Closed mcora closed 11 years ago
Thanks for posting. It'll be fixed in the next release. Also I found your use case with a TableEntityConverter and it'll be public in the upcoming version.
Thanks Dmitry, and nice work! I much prefer your extensions to the standard Azure Storage library, the code is so much cleaner.
Available in the nuget package v0.7.5.
I've upgraded to 0.7.5 but had to revert back to 0.7.2. All queries are throwing Invalid Operation, even for a simple one:
var table = new TableSet
It looks like your POCO's attributes metadata is invalid. InvalidOperationException may occurs in the following cases:
[Ignore]
[Property("CustomName")]
public string MyProperty { get; set; }
Also for further investigation, could you post here exception message and stack trace?
This is a strange one.. I tried it again, and tracked down the root problem to the Query returning 0 elements, when the data is exists. This simple code works perfectly in version 0.7.2, but returns 0 elements in 0.7.5. It does not throw any exceptions:
public class MapFedid
{
[PartitionKey]
public string Context { get; set; }
[RowKey]
public string FederatedId { get; set; }
}
public MapFedid GetMapping(eUserContext context, string fedId)
{
var table = new TableSet<MapFedid>(_tableClient, Tables.MAP_FEDERATED_ID);
var query = table.Where(p => p.Context == context.ToString() && p.FederatedId == fedId);
var results = query.ToList();
return results.First();
}
Thanks a lot for a complete code sample, just one moment: what type of eUserContext? Is it a enumeration or reference type? If it's a reference type, is it has an overloaded ToString method?
Yes, enumeration:
public enum eUserContext
{
Unauthorized,
VIP,
DM,
ADMIN,
}
Available in the nuget package v0.7.6.
Thanks, my integration tests succeed with 0.7.6, so far so good.
I still have a problem with List
public class Foo
{
public string PartKey { get; set; }
public string RowKey { get; set; }
public List<Bar> MyList { get; set; }
}
public class Bar
{
public string SomeProp { get; set; }
}
public clsss FooMap : EntityTypeMap<Foo>
{
this.PartitionKey(p => p.PartKey),
.RowKey(p => p.RowKey),
.Ignore(p => p.MyList);
}
Gives an exception
I would expect type checking to be turned off for properties that are not supposed to be serialized.