Sponsored

Showing posts with label .NET Core. Show all posts
Showing posts with label .NET Core. Show all posts

Wednesday, February 3, 2021

.NET Web API: Confusing 404 Response to OPTIONS Request for CORS pre-flight

Problem: when a Angular applications sends an OPTIONS request to its own backend to satisfy CORS preflight policy it unexpectedly receives a 404 response from a .NET Core Web API application that effectively blocks an actual data data request from executing correctly. If you have ever experienced this problem, continue reading to understand what the problem is and how to fix it. 

Friday, November 27, 2020

.NET Core OData: How to Construct a DateTime Filter

Say, we need to construct a query to an OData endpoint that filters records by DateTime values. Over the years as OData standard had been evolving there have been various different ways to work with DateTime columns depending on OData version and an implementation of an actual OData service that could have been based on various different frameworks. This being said, it's likely, that a single universal way of constructing a DateTime based filter clause for OData services might not exist. Take this under consideration, and note that the solution presented below had only been tested with OData services that are built with .NET Web API Odata v4.