Skip to content
Advertisement

ASP.NET MVC: Method-Based LINQ Query of SQL Db as IEnumerable object [closed]

I am trying to query a database for all its record into an IEnumerable object. Here are the relevant codes:

Db Context Snippet

Startup.cs Snippet

Controller Snippet

The Model works and contain the desired data using Microsoft SQL Server Management Studio.

However, _db.CSVMeta contains the following error:

May I check how I can fix this?

Advertisement

Answer

I think it is a typo. In your db context class the property is named CSVMetas but in your controller you are calling _db.CSVMeta. You are missing an s.

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement