C#C
C#2y ago
morry329#

RuntimeBinderException: '' does not contain 'Any()'

Would like another set of eyes on this exception.
I am following a YT tutorial to create a CRUD application via ASP.NET. Once I ran the code, this error popped out.

https://pastebin.com/7LqfcshB

Seems to me like this exception points out at those two lines in my cshtml file @if(Model != null && Model.Any()){ (line 26)
and <h3>@ViewData["Title"]</h3> (line 8).

I have added (at)using System.Linq in cshtml file and all over classes with the name of Employee, but the exception persists.
Does anyone have an idea where it went wrong and triggered the exception?

EmployerController.cs
https://pastebin.com/VndL9jjG

cshtml file
https://pastebin.com/9FLYLwZc

EmployerViewModel.cs
https://pastebin.com/cVcw9vyQ

Employees.cs
https://pastebin.com/PWmaiNTC
Pastebin
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Pastebin
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Pastebin
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Pastebin
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Pastebin
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Was this page helpful?