【发布时间】:2019-08-05 02:40:04
【问题描述】:
第一步
public class Catalog
{
public int CatalogId { get; set; }
public string CatalogName { get; set; }
public DateTime? StartDate { get; set; }
public DateTime? EndDate { get; set; }
public bool IsDeleted { get; set; }
}
模型的第二步
public class Catalogs : Catalog { }
public class GetCatalogResponse
{
public Catalogs Catalogs { get; set; }
}
第三步
var resp = new Models.GetCatalogResponse();
在这种情况下,我无法将目录字段加载到 var resp
【问题讨论】:
-
您需要初始化并为这些参数分配一些值才能访问。我真的没有得到,你想用它做什么。你可以看看dotnetfiddle.net/UJRnLP
标签: c# asp.net-web-api asp.net-core asp.net-web-api2