Zum Inhalt springen

Route parameter type cannot be parsed (ASP0020)

Dieser Inhalt ist noch nicht in deiner Sprache verfügbar.

Key dotnet.api.unparsable-route-parameter-type · Severity error · Category api

ASP.NET Core analyzer ASP0020. Flags a complex type bound from the route, query or header that has no TryParse. Binding fails at run time.

app.MapGet("/search", ([FromQuery] Filter filter) => Search(filter));
public class Filter { public string Term { get; set; } = ""; }
app.MapGet("/search", ([AsParameters] Filter filter) => Search(filter));
public class Filter { public string Term { get; set; } = ""; }