Quantcast
Channel: ASP.NET Core
Viewing all articles
Browse latest Browse all 9386

Asp.net 2.1 EF DbQuery

$
0
0

Good morning everyone!

Im running up against a wall here...

Im using a VIEW from my database and trying to create a view on VS through scaffolding
Im defining the view on the applicationDbContext like so:

public DbQuery<Samsys_Custos.Models.CUSTOS_EQUIPA> CUSTOS_EQUIPA { get; set; }

and on my controller I do the following:

public async Task<IActionResult> Geral() {
var applicationDbContext = _context.CUSTOS_EQUIPA;
return View(await applicationDbContext.ToListAsync());
} 

when I try to create a view for Geral based on the CUSTOS_EQUIPA model I get the following error:Image

So do I have a way around this? Ijust upgraded my project to Asp.net 2.1 just to take advantage of dbquery and it would help a lot


Viewing all articles
Browse latest Browse all 9386

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>