Azure.Data.Tables 使用 F# 序列化

Azure.Data.Tables serialization using F#

我按照这篇文章从 Azure 数据中移动数据 table。这是我的类型的副本:

type GameId(x, y, z, q, r) =
    let mutable etag = x
    let mutable partitionKey = y
    let mutable rowKey = z
    let mutable timeStamp = q
    let mutable id = r
    interface ITableEntity with
        member this.ETag with get() = etag and set(v) = etag <- v
        member this.PartitionKey with get() = partitionKey and set(v) = partitionKey <- v
        member this.RowKey with get() = rowKey and set(v) = rowKey <- v
        member this.Timestamp with get() = timeStamp and set(v) = timeStamp <- v
    member this.Id with get() = id and set(v) = id <- v
    new() = GameId(ETag(),null,null,Nullable<DateTimeOffset>(),null)

当我 运行 它时,我得到 0 个数据填充数据结构。

我需要做什么才能获取要填充的数据

我正在关注这个 blog。通过使用它,我可以 add 数据和 retrieve 来自 Azure Data Table.

的数据

如果您尝试自定义模型属性,它会自动序列化。使用 [IgnoreDataMember] 属性装饰模型 属性 将在序列化时忽略它,并且 [DataMember(Name = "some_new_name")] 将重命名 属性.

参考here了解更多信息