Skip to content

TodoApp.BlazorWasm.Server: CS1574 unresolved cref for EntityFrameworkQueryableExtensions.AnyAsync in TodoContext.cs #551

Description

@adrianhall

Summary

While fixing #539, building TodoApp.BlazorWasm.Server with -p:GenerateDocumentationFile=true surfaced a remaining CS1574 warning in TodoContext.cs after the missing-using bug from #539 was fixed:

Database/TodoContext.cs(60,84): warning CS1574: XML comment has cref attribute 'AnyAsync{TSource}(IQueryable{TSource})' that could not be resolved

Unlike #539, the type (EntityFrameworkQueryableExtensions) is already in scope via using Microsoft.EntityFrameworkCore; — the problem is that the cref's parameter list doesn't match any actual overload signature. The real extension method is:

public static Task<bool> AnyAsync<TSource>(this IQueryable<TSource> source, CancellationToken cancellationToken = default)

which takes a CancellationToken parameter that the cref omits.

File affected

samples/todoapp-blazor-wasm/TodoApp.BlazorWasm.Server/Database/TodoContext.cs (line ~60)

How to reproduce

dotnet build samples/todoapp-blazor-wasm/TodoApp.BlazorWasm.Server/TodoApp.BlazorWasm.Server.csproj -p:GenerateDocumentationFile=true

Suggested fix

Update the cref to include the CancellationToken parameter, e.g.:

/// <item><description>Checks if the TodoItems table is empty using <see cref="EntityFrameworkQueryableExtensions.AnyAsync{TSource}(IQueryable{TSource}, CancellationToken)"/>.</description></item>

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions