1

有什么方法可以将完整的日期时间(包含毫秒部分)保存在表存储中?

我正在使用 TableServiceContext 来保存我的实体。

谢谢

4

1 回答 1

1
public class YourEntity : TableEntity
{
    public YourEntity(string partitionName, string id)
    {
        this.PartitionKey = partitionName;
        this.RowKey = id;
    }

    public YourEntity() { }

    private string _date = "";
    public string CustomDate 
    { 
        get
        {
            return _date;
        }
        set
        {
            _date = value;
        }
    }    
}

YourEntity entity = new YourEntity("sample", "1");
entity.CustomDate = DateTime.Now.ToString("dd/MM/yyyy hh:mm:ss.ffffff");
于 2013-12-11T15:47:18.873 回答