这是我第一次为我的Xamarin.Forms应用程序创建一个后端。我按照Azure Portal -> Quick-Start
的说明,创建数据连接,choose c# in step 2
和download the project
。
构建它,现在我想添加一个新表。所以:
public DbSet<Coffee> Coffees{ get; set; }
Value cannot be null. Parameter name : path1.
我该怎么做才能解决这个问题?
对不起,我的英语不好。
祝你今天愉快!
我有同样的问题,Visual Studio开发社区也提到了这个问题:https://developercommunity.visualstudio.com/content/problem/563354/adding-a-new-azure-mobile-apps-table-controller-or.html
同时,您可以通过在代码中创建控制器来解决此问题。我已针对Xamarin Forms应用程序测试了Azure移动应用程序表控制器的以下步骤:
最后发布您的解决方案
配置表控制器需要三个步骤:
- 创建数据传输对象(DTO)类。
- 在Mobile DbContext类中配置表引用。
- 创建一个表控制器。
数据传输对象(DTO)是从EntityData继承的普通C#对象。文档中的一个示例:
public class TodoItem : EntityData
{
public string Text {get; set;}
public bool Complete {get; set;}
}
有关更多信息,请参阅此documentation。