当前位置:网站首页>Findasync and include LINQ statements - findasync and include LINQ statements
Findasync and include LINQ statements - findasync and include LINQ statements
2022-06-12 06:00:00 【Bustling city 】
problem :
The code I have got so far works fine The code I've got so far works well
public async Task<ActionResult> Details(Guid? id){ if (id == null) { return new HttpStatusCodeResult(HttpStatusCode.BadRequest); } ItemDetailModel model = new ItemDetailModel(); model.Item = await db.Items.FindAsync(id); if (model.Item == null) { return HttpNotFound(); } return View(model);}But I want to include 1 table more and cannot use FindAsync But I want to include more 1 Tables and cannot be used FindAsync
public async Task<ActionResult> Details(Guid? id){ if (id == null) { return new HttpStatusCodeResult(HttpStatusCode.BadRequest); } ItemDetailModel model = new ItemDetailModel(); model.Item = await db.Items.Include(i=>i.ItemVerifications).FindAsync(id); if (model.Item == null) { return HttpNotFound(); } return View(model);}So I am facing this error So I face this mistake
Severity Code Description Project File Line Suppression State Error CS1061 'IQueryable' does not contain a definition for 'FindAsync' and no extension method 'FindAsync' accepting a first argument of type 'IQueryable' could be found (are you missing a using directive or an assembly reference?) The severity code indicates that the project file line suppression status is wrong CS1061“IQueryable” It doesn't contain “FindAsync” The definition of , And can't find an acceptance “IQueryable” Extension method of the first parameter of the type “FindAsync”( Are you missing using Instruction or assembly reference ?)
Any clue how to fix it? Any clue how to solve it ?
Solution :
Reference resources : https://stackoom.com/en/question/2jLc0边栏推荐
- Recursive implementation of exponential, permutation and combination enumerations
- 数据集成框架SeaTunnel学习笔记
- A month's worth of DDD will help you master it
- jpg格式与xml格式文件分离到不同的文件夹
- March 4, 2021
- Golang idea configures the agent to improve the speed of packages downloaded by go get
- Research Report on water sports shoes industry - market status analysis and development prospect forecast
- RTMP streaming +rtmp playback low delay solution in unity environment
- nRF52832自定義服務與特性
- Halcon uses points to fit a plane
猜你喜欢
随机推荐
User login (medium)
前台展示LED数字(计算器上数字类型)
Three years of sharpening a sword: insight into the R & D efficiency of ant financial services
Guns framework multi data source configuration without modifying the configuration file
Halcon 3D 1 Reading 3D data
Login authentication filter
[long time series prediction] the [4] autocorrelation mechanism of aotoformer code explanation
Idea common configuration
数据库实验一:数据定义实验指导
IO to IO multiplexing from traditional network
Select gb28181, RTSP or RTMP for data push?
Front desk display LED number (number type on calculator)
POI, easyexcel framework use
Chapter 8 - structure
Error the main class com xxx. yyy. Application
[gin] gin framework for golang web development
User login [next]
Conversion of Halcon 3D depth map to 3D image
Available RTMP and RTSP test addresses of the public network (updated in March, 2021)
EBook editing and deleting









