@Modelはタスクをどのように使用するのですか?@Modelがタスクの場合@Modelにアクセスする
レイザー:
@model Task<AreBuraas.Core.v1.Models.Category>
<article class="panel panel-primary">
<section class="panel-heading">
<h1>
@Model.Name
</h1>
<h3>
@Model.Description
</h3>
</section>
<section class="panel-body">
her kommer content!
</section>
</article>
コントローラー:
public IActionResult Display(int id)
{
return View(_data.GetCategory(id));
}
エラー:
'Task' does not contain a definition for 'Name' and no extension method 'Name' accepting a first argument of type 'Task' could be found (are you missing a using directive or an assembly reference?)
@Model.Name
'Task' does not contain a definition for 'Description' and no extension method 'Description' accepting a first argument of type 'Task' could be found (are you missing a using directive or an assembly reference?)
@Model.Description
OKはい、ありがとう! – TheRuler