c# - IMobileServiceTable 无法发布
问题描述
我正在尝试在 Azure 表中插入一行,但出现错误:
无法 POST '/tables/Sate_Customer\n
我能够成功地插入同一数据库中的“客户”和“状态”表。顺便说一下,这个表中的 CustomerId 和 StateId 列有一个 FK 约束。
public class State_Customer
{
[JsonProperty(PropertyName = "id")]
public string StateCustomerId { set; get; }
[JsonProperty(PropertyName = "CustomerId")]
public string CustomerId { set; get; }
[JsonProperty(PropertyName = "StateId")]
public string StateId { set; get; }
[JsonProperty(PropertyName = "createdAt")]
[CreatedAt]
public DateTime CreatedAt { set; get; }
[JsonProperty(PropertyName = "updatedAt")]
[UpdatedAt]
public DateTime UpdatedAt { set; get; }
[JsonProperty(PropertyName = "deleted")]
[Deleted]
public bool Deleted { set; get; }
}
public async void InsertStateCustomer()
{
List<string> custIds = new List<string>()
{ "b1f57a2e-aeb4-4709-8b9a-cc5f35c4195f",
"f3a9035a-9869-42b9-a415-a8fa0d689c60"
};
string stId = "899becd5-199e-43b4-a4cc-f8883d0b8102";
foreach (string strCusId in custIds)
{
State_Customer stCust = new State_Customer()
{ CustomerId = strCusId, StateId = stId };
await stateCustomerTable.InsertAsync(stCust);
}
解决方案
推荐阅读
- wordpress - 如果有自定义字段,则隐藏产品或变体
- python - 添加新行而不覆盖现有行
- reporting-services - SSRS 报告没有采用多个值,我可以知道如何解决这个问题吗,我正在使用雪花代码
- python-3.x - selenium.common.exceptions.ElementNotInteractableException:消息:元素不可交互使用 Selenium Python 将文本发送到名字字段
- java - 我的 Maven 插件在想法中总是有触摸选项
- java - 存储库中缺少 org.renjin.cran 库
- dialogflow-es - Google Dialogflow 自定义负载是否在 Telegram 中具有调用功能?
- javascript - API 端点在不等待承诺的情况下返回有什么缺点吗?
- html5-canvas - 如何调试 HTML5 canvas pixi.js 性能?
- typescript - 打字稿:类型“字符串”不能用于索引类型“{ [key: string]: any; }”