diff --git a/aspnetcore/fundamentals/minimal-apis/min-api-filters/7samples/todo/Program.cs b/aspnetcore/fundamentals/minimal-apis/min-api-filters/7samples/todo/Program.cs index e11d1fc145..d603c642a0 100644 --- a/aspnetcore/fundamentals/minimal-apis/min-api-filters/7samples/todo/Program.cs +++ b/aspnetcore/fundamentals/minimal-apis/min-api-filters/7samples/todo/Program.cs @@ -108,23 +108,23 @@ app.MapPut("/todoitems/{id}", async (Todo inputTodo, int id, TodoDb db) => await db.SaveChangesAsync(); return Results.NoContent(); -}).AddEndpointFilterFactory(async (filterFactoryContext, next) => +}).AddEndpointFilterFactory((filterFactoryContext, next) => { - var parameters = context.MethodInfo.GetParameters(); + var parameters = filterFactoryContext.MethodInfo.GetParameters(); if (parameters.Length >= 1 && parameters[0].ParameterType == typeof(Todo)) { return async invocationContext => { var todoParam = invocationContext.GetArgument(0); - var validationError = Utilities.IsValid(tdparam); + var validationError = Utilities.IsValid(todoParam); if (!string.IsNullOrEmpty(validationError)) { return Results.Problem(validationError); } - return await next(invocationContextContext); - } + return await next(invocationContext); + }; } return invocationContext => next(invocationContext); });