Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/30.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 错误CS1061“object”不包含的定义,并且找不到接受“object”类型的第一个参数的可访问扩展方法_C#_Asp.net - Fatal编程技术网

C# 错误CS1061“object”不包含的定义,并且找不到接受“object”类型的第一个参数的可访问扩展方法

C# 错误CS1061“object”不包含的定义,并且找不到接受“object”类型的第一个参数的可访问扩展方法,c#,asp.net,C#,Asp.net,目前正在开发一个项目,并且CS1061 C“object”不包含的定义,并且找不到接受“object”类型的第一个参数的可访问扩展方法。是否缺少using指令或程序集引用?。我不能使用出现的任何其他选项,因为使用这些选项没有意义。下面是发生此错误的类 using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using BookPianoLessons.Mode

目前正在开发一个项目,并且CS1061 C“object”不包含的定义,并且找不到接受“object”类型的第一个参数的可访问扩展方法。是否缺少using指令或程序集引用?。我不能使用出现的任何其他选项,因为使用这些选项没有意义。下面是发生此错误的类

using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using BookPianoLessons.Models;
using BookPianoLessons.Models.Catalog;
using Microsoft.AspNetCore.Mvc;
using PianoData;
using PianoData.Models;
using PianoDataService;

namespace BookPianoLessons.Controllers
 {
public class CatalogController : Controller
{
    private PianoAsset _assets; 

    public CatalogController(PianoAsset assets)
    {
        _assets = assets; 
    }
    public IActionResult Index()
    {
        var assetModels = _assets.GetAll();

        var listingResult = assetModels
            .Select(result => new AssetIndexListingModel
     {
                ID = result.ID,
                imageURL = result.imageURL, 
                title = result.title,
                teacher = _assets.GetTeacher(result.ID),
                grades = result.Grades,
                examBoards = result.ExamBoards,

        });
        var model = new AssetIndexModel()
        {
            Assets = listingResult
        };

        return View(model);
         }
     }
 }

你能挑出你在哪一行代码上犯了这个错误吗?如果输入的代码不是打字错误,那么应该是Select和not Select。即使我有大写字母,这仍然是一个错误s@zer0就是这个。选择结果=>newAssetIndexListingModel@ChloeMcMullan你有没有可能提供我自己运行的代码来复制?那我就可以修好了。这个问题似乎与DbContext无关,也不相关,所以您可以创建一些类,用虚假数据填充,然后是抛出错误的LINQ语句。你能挑出你在哪一行代码上出错吗?如果输入的代码不是打字错误,那么应该是Select和not Select。即使我有大写字母,它仍然是一个错误s@zer0就是这个。选择结果=>newAssetIndexListingModel@ChloeMcMullan你能提供代码吗?我能让我自己复制?那我就可以修好了。这个问题似乎与DbContext无关,因此您可以创建一些类,用虚假数据填充,然后由LINQ语句抛出错误。