我有以下类:
public class Note : TableServiceEntity
{
public Note( )
{
}
public Note(string pK)
{
PartitionKey = pK,
RowKey = Seq.GetSequence().ToString();
}
public string Description { get; set; }
}
我需要将RowKey设置为序列生成的值。有人能解释一下如何用构造函数做到这一点吗?我得到的是一个语法错误:Virtual member call in constructor
.
public static class Seq
{
static int index;
public static int GetSequence()
{
return index++;
}
}
public class Note : TableServiceEntity
{
public Note(string partitionKey, string rowKey)
: base(partitionKey, Seq.GetSequence().ToString()) { }
}