我是 .NET 和 windows azure 的菜鸟,并尝试遵循本教程:http: //msdn.microsoft.com/en-us/wazplatformtrainingcourse_introtowindowsazurelabvs2010_topic2.aspx
当我尝试如下声明 IQueryable 属性时:
public IQueryable<C1_Schema> C1_Schema
{
get
{
return this.CreateQuery<C1_Schema>("C1_Schema");
}
}
我得到一个错误:错误预期类,委托,枚举,接口,结构
这是我声明属性的类
public IQueryable<C1_Schema> C1_Schema
{
get
{
return this.CreateQuery<C1_Schema>("C1_Schema");
}
}
public class context : Microsoft.WindowsAzure.StorageClient.TableServiceContext
{
public context(string baseAddress, Microsoft.WindowsAzure.StorageCredentials credentials)
: base(baseAddress, credentials)
{ }
}
C1_Schema 类:
public class C1_Schema : Microsoft.WindowsAzure.StorageClient.TableServiceEntity
{
public String fname { get; set; }
public String lname { get; set; }
public double salary { get; set;}
public C1_Schema()
{
PartitionKey = DateTime.UtcNow.ToString("MMddyyyy");
// Row key allows sorting, so we make sure the rows come back in time order.
RowKey = string.Format("{0:10}_{1}", DateTime.MaxValue.Ticks - DateTime.Now.Ticks, Guid.NewGuid());
}
}
我感谢您的帮助。