Server Error in '/' Application.

Compilation Error

Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: CS1061: 'PublishedContentType' does not contain a definition for 'FirstOrDefault' and no extension method 'FirstOrDefault' accepting a first argument of type 'PublishedContentType' could be found (are you missing a using directive or an assembly reference?)

Source Error:


Line 29:         count++;
Line 30:         IContent myContent = ApplicationContext.Current.Services.ContentService.GetById(Convert.ToInt32(grandchild.Id));
Line 31:         var link = grandchild.ContentType.FirstOrDefault() as Link;
Line 32: 
Line 33:         var currentTagJson = myContent.GetValue<string>("contentType");

Source File: C:\inetpub\wwwroot\NBCSports\Web\Views\Genre.cshtml    Line: 31






Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.7.3535.0