All fields

“Model Binding & Validation” in Information Technology

20 questions across 1 technology.

Information Technology

20 questions in 1 technology

#QuestionTechnologyTopicLevel
1How do you share validation logic between a Blazor form (using EditForm and DataAnnotationsValidator) and a corresponding ASP.NET Core Web API's model validation? ASP.NET Core › Blazor Integration with ASP.NET CoreASP.NET CoreBlazor Integration with ASP.NET CoreIntermediate
2How does model binding work differently between controllers (using [FromBody], [FromQuery] attributes) and minimal APIs (using parameter inference)? ASP.NET Core › Controllers vs Minimal APIsASP.NET CoreControllers vs Minimal APIsIntermediate
3How do you implement equivalent cross-cutting concerns (like automatic model validation) in minimal APIs that [ApiController] provides automatically for controllers? ASP.NET Core › Controllers vs Minimal APIsASP.NET CoreControllers vs Minimal APIsAdvanced
4How does exception handling middleware interact with model validation errors, and why do they typically produce two entirely separate error response paths? ASP.NET Core › Error HandlingASP.NET CoreError HandlingAdvanced
5What HTTP status code and response should be returned when an upload fails validation (wrong type, too large, missing file)? ASP.NET Core › File Uploads & Streaming Large FilesASP.NET CoreFile Uploads & Streaming Large FilesBeginner
6How would you implement a custom route constraint (IRouteConstraint) for a domain-specific validation pattern, like a product SKU format? ASP.NET Core › Endpoint Metadata, Route Constraints & TemplatesASP.NET CoreEndpoint Metadata, Route Constraints & TemplatesAdvanced
7What is a route template in ASP.NET Core, and how do route parameters like {id} work within one? ASP.NET Core › Endpoint Metadata, Route Constraints & TemplatesASP.NET CoreEndpoint Metadata, Route Constraints & TemplatesBeginner
8How do you accept a file upload in an ASP.NET Core controller action using IFormFile? ASP.NET Core › File Uploads & Streaming Large FilesASP.NET CoreFile Uploads & Streaming Large FilesBeginner
9How do you customize example values shown in Swagger UI for request and response bodies? ASP.NET Core › API Documentation with Swagger/OpenAPIASP.NET CoreAPI Documentation with Swagger/OpenAPIIntermediate
10What features do controllers provide out of the box that minimal APIs don't have native equivalents for? ASP.NET Core › Controllers vs Minimal APIsASP.NET CoreControllers vs Minimal APIsIntermediate
11How do route constraints (like {id:int} or {id:guid}) restrict which requests match a given route, and why are they useful? ASP.NET Core › Endpoint Metadata, Route Constraints & TemplatesASP.NET CoreEndpoint Metadata, Route Constraints & TemplatesIntermediate
12How do you define optional route parameters, and what's the difference between an optional parameter and one with a default value? ASP.NET Core › Endpoint Metadata, Route Constraints & TemplatesASP.NET CoreEndpoint Metadata, Route Constraints & TemplatesIntermediate
13How do complex/composite route segments (combining literal text and a parameter in the same segment, like {fileName}.{extension}) work? ASP.NET Core › Endpoint Metadata, Route Constraints & TemplatesASP.NET CoreEndpoint Metadata, Route Constraints & TemplatesIntermediate
14What role does the [ApiController] attribute play in automatically handling certain error scenarios without explicit exception handling code? ASP.NET Core › Error HandlingASP.NET CoreError HandlingIntermediate
15How do you accept and process multiple files uploaded in a single request? ASP.NET Core › File Uploads & Streaming Large FilesASP.NET CoreFile Uploads & Streaming Large FilesIntermediate
16How does IEndpointFilter provide similar cross-cutting functionality for minimal APIs that MVC filters provide for controllers? ASP.NET Core › FiltersASP.NET CoreFiltersIntermediate
17How would you unit test a custom action filter's logic in isolation, without needing a full HTTP request pipeline? ASP.NET Core › FiltersASP.NET CoreFiltersIntermediate
18How does content negotiation handle the request body (input formatters) differently from the response body (output formatters)? ASP.NET Core › Content Negotiation & Output FormattersASP.NET CoreContent Negotiation & Output FormattersAdvanced
19How would you implement a catch-all route parameter to handle a variable-depth URL path, like a file browser or wiki-style page hierarchy? ASP.NET Core › Endpoint Metadata, Route Constraints & TemplatesASP.NET CoreEndpoint Metadata, Route Constraints & TemplatesAdvanced
20How do you generate a URL for a named route or endpoint programmatically, rather than hardcoding URL strings throughout the application (like in a Location header for a 201 Created response)? ASP.NET Core › Endpoint Metadata, Route Constraints & TemplatesASP.NET CoreEndpoint Metadata, Route Constraints & TemplatesAdvanced