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/PWmaiNTCPastebin
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.
0 Replies