public void ShouldSaveAndRetrieveCustomEntity() { var account = CloudConfiguration.GetStorageAccount("DataConnectionString"); var key = Guid.NewGuid().ToString(); var customEntity = new CustomEntity() { PartitionKey = "CustomEntity", RowKey = key, Id = 5, Name = "five" }; var udfAzureTable = new UDFAzureTable(account, TableName); udfAzureTable.Save(customEntity); var storedEntity = udfAzureTable.BuildQueryFor(customEntity.GetType()) .Where(e => e.PartitionKey.Equals("CustomEntity") && e.RowKey.Equals(key)) .FirstOrDefault(); Assert.IsNotNull(storedEntity); Assert.AreEqual(customEntity.ToString(), storedEntity.ToString()); }
public static string ToStr(this CustomEntity entity) { return($"Name={entity.Name}, Desc={entity.Description}, Type={entity.GetType()}, OwningEntityId={entity.OwningEntityId}, IsCustomEntity={!NotCustomEntityTheOwningEntity(entity)}"); }