我发现了一个我无法理解的问题,就是为什么在实例化和填充完MobileServiceCollection属性之后就不能访问它。Intellisense甚至不注册为类的属性
有问题的类:"Microsoft.WindowsAzure.MobileServices.MobileServiceCollection“
实例化
private MobileServiceCollection<UserOnSite, UserOnSite> items;人口
items = await userSiteTable.ToCollectionAsync();问题
items.Item(id)Item属性没有作为Intellisense选项列出,当我尝试使用它时会给出以下错误
'Microsoft.WindowsAzure.MobileServices.MobileServiceCollectionite.Windows.UserOnSite,PrelimOnSiteOffSite.Windows.UserOnSite>‘不>包含'Item’的定义,也没有扩展方法'Item‘接受类型为>'Microsoft.WindowsAzure.MobileServices.MobileServiceCollectionite.Windows.UserOnSite,PrelimOnSiteOffSite.Windows.UserOnSite>的>第一个参数的方法>(您是缺少使用指令还是程序集引用?)
根据这一点,MSDN页面项绝对是一个属性,我的用法与以前在数组/列表等方面的查找是一致的。
发布于 2015-04-16 02:16:02
public class Collection<T> : IList<T>, ICollection<T>, IList, ICollection, IReadOnlyList<T>, IReadOnlyCollection<T>, IEnumerable<T>, IEnumerable
protected IList<T> Items { get; }Items是MobileServiceCollection继承的集合类中的受保护成员。不能通过MobileServiceCollection实例访问它,只能在MobileServiceCollection类中访问。
https://stackoverflow.com/questions/29617852
复制相似问题