I am using asp.net mvc 4 and in my page I have a list of payments:
id | status| customerid
1 | 1 | 2
code:
<tr>
<td>
@Html.DisplayFor(modelItem => item.id)
</td>
<td>
@{
var status = ((status)(modelItem => item.StatusId)).toString();
}
</td>
<td>
@Html.DisplayFor(modelItem => item.CustomerId)
</td>
</tr>
I have defined an enum in my controller:
enum status { Pending = 1, Paid = 2 };
How can I display the text ie Pending instead of the id 1 on my razorpage? I am gettting an error now:
Cannot convert lambda expression to type 'MyApp.Models.status' because it is not a delegate type