C# – OData:无法使用带有’new’属性的Type构建System.Web.Http.OData.Delta

我在ASP.NET Web API 2(而不是Core)中运行一个项目,我有一个像这样的对象:

public class Desktop : EntityData { public Desktop() { } public new Guid Id { get { return Guid.Parse(base.Id); } set { base.Id = value.ToString(); } } ... } public abstract class EntityData { protected EntityData(); public string Id { get; set; } public bool Deleted { get; set; } } 

可以看出,有一个带有new运算符的属性Id

这阻碍了我使用任何现有的构造函数创建一个新的Delta对象:

 Delta delta = new Delta(); Delta delta = new Delta(typeof(Desktop)); Delta delta = new Delta(typeof(Desktop), new string[] { "Id" }); 

实际上构造函数抛出exception,说

已添加具有相同键的项目。

如何成功构建Delta对象?

非常感谢你!

cghersi