C# 移动Azure服务C.NET后端修补程序未更新

C# 移动Azure服务C.NET后端修补程序未更新,c#,.net,azure,mobile,patch,C#,.net,Azure,Mobile,Patch,我已经在C中创建了一个简单的.NET后端移动azure服务。我已经启动了该移动服务,并且运行它目前所做的所有工作都是在一个表上使用您的普通CRUD。我遇到的问题是,补丁/更新不会按它所说的那样做。我可以做我尝试过的一切,选择、插入、删除,但我无法更新数据 当我调试调用UpdateAsync的代码块时,patch.GetEntity。。。。。总是将值设为NULL或调零或day one datetimes,就像它没有传递我要更新的内容的属性值一样。我所拥有的唯一价值就是正确的id。下面我试图去掉一些

我已经在C中创建了一个简单的.NET后端移动azure服务。我已经启动了该移动服务,并且运行它目前所做的所有工作都是在一个表上使用您的普通CRUD。我遇到的问题是,补丁/更新不会按它所说的那样做。我可以做我尝试过的一切,选择、插入、删除,但我无法更新数据

当我调试调用UpdateAsync的代码块时,patch.GetEntity。。。。。总是将值设为NULL或调零或day one datetimes,就像它没有传递我要更新的内容的属性值一样。我所拥有的唯一价值就是正确的id。下面我试图去掉一些我拥有的代码,我使用了Azure网站上前几个教程中的一些代码

我有一个数据对象:

public class AdminLookupDATA: EntityData
{
    public string description { get; set; }
    public int lookuptype { get; set; }
    public int priority { get; set; }
    public bool inactive { get; set; }
    public DateTime createdate { get; set; }
    public DateTime editdate { get; set; }
}
我有一个DTO:

public class AdminLookupDTO
{
    public string id { get; set; }
    public string description { get; set; }
    public int lookuptype { get; set; }
    public int priority { get; set; }
    public bool inactive { get; set; }
    public DateTime createdate { get; set; }
    public DateTime editdate { get; set; }
}
我有一个模型:

public class AdminLookupModel
{
    public string Id { get; set; }
    public string description { get; set; }
    public int lookuptype { get; set; }
    public int priority { get; set; }
    public bool inactive { get; set; }
    public DateTime createdate { get; set; }
    public DateTime editdate { get; set; }
}
我的控制器内的补丁程序:

    public Task<AdminLookupDATA> PatchAdminLookupDATA(string id, Delta<AdminLookupDATA> patch)
    {
         return UpdateAsync(id, patch);
    }
此外,如果我在“试用”部分尝试直接从浏览器运行修补程序功能,我也会遇到同样的问题,因此我在服务项目本身中配置了错误的内容。如有任何建议,将不胜感激

谢谢,
Rob

您的房产名称必须以大写字母开头

否则,配置CamelCasePropertyNamesContractResolver,如下所示:

代码片段

var formatters = GlobalConfiguration.Configuration.Formatters;
var jsonFormatter = formatters.JsonFormatter;
var settings = jsonFormatter.SerializerSettings;
settings.Formatting = Formatting.Indented;
settings.ContractResolver = new CamelCasePropertyNamesContractResolver();

您是否使用AutoMapper将您的DTO正确映射到数据库对象?不要只发布链接如果链接断开,则您的答案无效我也有同样的问题,但GlobalConfiguration似乎不是我的azure移动服务项目中的一个类。