© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
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()){
@if(Model != null && Model.Any()){
(line 26)
and
<h3>@ViewData["Title"]</h3>
<h3>@ViewData["Title"]</h3>
(line 8).

I have added (at)
using System.Linq 
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
RuntimeBinderException: 'System.Collections.Generic.List
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
using Microsoft.AspNetCore.Mvc;using Mitarbeiter.DBContexts;using M...
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
@using System.Linq;@Model List Fo - Pastebin.com
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
using System.ComponentModel;using System.Linq;namespace Mitarbeiter...
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
using System.ComponentModel.DataAnnotations;using System.ComponentM...
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.
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

❔ Program does not contain static 'Main'
C#CC# / help
3y ago
✅ Rider Program does not contain Static Main
C#CC# / help
2y ago
Does blazor webassembly not contain a "backend" server?
C#CC# / help
14mo ago
❔ FreeImage does not contain a definition for GetBitmap
C#CC# / help
3y ago