我有一个实体CallTrackerLog
,其中有许多Clients
,其中有一个Advices
。我正在尝试为advice
[HttpPost("{callTrackerId}/{clientId}/advice")]
public IActionResult CreateCTClientAdvice(int callTrackerId, int clientId,
[FromBody] CallTrackerClientAdvice newAdvice)
{
if (newAdvice == null)
return BadRequest();
if (!ModelState.IsValid)
return BadRequest(ModelState);
var ctFromStore = _context.CallTrackers
.Include(log => log.CallTrackerClients)
.ThenInclude(log => log.CallTrackerClientAdvice)
.FirstOrDefault(ct => ct.CallTrackerId == callTrackerId);
var ctAdviceFromStore ctFromStore.CallTrackerClients.CallTrackerClientAdvice
.FirstOrDefault(c => c.CallTrackerClientId == clientId);
// ... add to db
return Ok();
}
问题是我无法使用CallTrackerClientAdvice
访问.FirstOrDefault(ct => ct.CallTrackerClientId == clientId)
- 它给了我一个红色下划线,即使我认为我已将其加载到上面。
错误:
为什么我无法访问CallTrackerClientAdvice
?
答案 0 :(得分:1)
我怀疑你想要的是:
"2014-03"