Fix variable name typo (#27394)

* Fix variable name typo

* Fixes #27396
pull/27408/head
Matt Ferderer 2022-10-27 15:30:37 -05:00 committed by GitHub
parent 084b9bc640
commit 8f24643bbf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 5 deletions

View File

@ -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<Todo>(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);
});