One is used to declare the strong type that the model is, and the other is used to access the model itself.
The following says that the strong type used for the model is UniBlue.Models.KYC
.
@model UniBlue.Models.KYC
This basically declares the 'variable' Model
as that type. It's akin to doing the following:
UniBlue.Models.KYC Model;
Model
is a variable, @model
is a keyword saying what type Model
will be.
Your error is because you've declared Model
as KYC, but KYC is not enumerable. You're using it in a foreach
expecting an IEnumerable<UniBlue.Models.KYC>
which is not the case.
If your model is truly a list, then use
@model IEnumerable<UniBlue.Models.KYC>
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…