From 8f24643bbfa7b24aa0eb6135a34508cee5a9f14c Mon Sep 17 00:00:00 2001 From: Matt Ferderer Date: Thu, 27 Oct 2022 15:30:37 -0500 Subject: [PATCH] Fix variable name typo (#27394) * Fix variable name typo * Fixes #27396 --- .../min-api-filters/7samples/todo/Program.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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); });