Handling Model Binding Errors when using [FromBody] in .NET Core 2.1
I am trying to understand how I can intercept and handle model binding errors in .net core. I want to do this: ``` // POST api/values [HttpPost] public void Post([FromBody] Thing value) ...
- Modified
- 11 Mar at 11:7
Separate title string with no spaces into words
I want to find and separate words in a title that has no spaces. Before: > ThisIsAnExampleTitleHELLO-WORLD2019T.E.S.T.(Test)"Test"'Test'[Test] After: > This Is An Example Title HELLO-WORLD 2019 T....
Cannot resolve scoped service
I have problem with understanding source of errors in my code. I try to get throw course about microservices in .net core. After running build solution I get: ``` ------- Project finished: CrossX.Ser...
- Modified
- 10 Mar at 16:18
Servicestack is sending me an error when using GET for Auth
I am getting an error in the JSON JWT Auth. GET Authenticate requests are disabled, to enable set AuthFeature.AllowGetAuthenticateRequests=true This worked a few days ago and I cannot figure out wha...
- Modified
- 9 Mar at 17:58
JSON Web Token Servicestack API
I have configured the JSON Web Token in the following way (Among others). ``` Plugins.Add(new AuthFeature(() => new AuthUserSession(), new IAuthProvider[] { new JwtAuthProvider(appS...
- Modified
- 9 Mar at 07:30
Can optimised builds and JIT compilation create problems when modifying a variable through a Span<T>?
Suppose I use `MemoryMarshal.CreateSpan` to access the bytes of a local value type, for example the following (not very useful) code: ``` using System; using System.Runtime.InteropServices; // names...
- Modified
- 8 Mar at 20:10
Mocking a CloudBlockBlob and have it return a stream
I'm trying to Moq an Azure `CloudBlockBlob` and have it return a `Stream` so that I can test whether my `BlobStorage` repository is handling the output correctly. But somehow the returned stream is a...
- Modified
- 30 Mar at 16:18
appsettings with special characters in .NET Core
I have a small .NET Core console app which has an `appsettings.json` file containing different configuration sections and some of the values contain accents (for example `á` or `ó`). When I parse a g...
ServiceStack - array inside dictionary deserialized to string
I have a `DT0` that has the following property ``` public Dictionary<string,object> Parameters {get;set;} ``` Now the challenge I have is that if I add an array to the `Parameters` it will be dese...
- Modified
- 6 Mar at 13:54
"System.Numeric.Vectors" error when I send int with 4 digits
I'm making a web service with ServiceStack, between its libraries he use System.Numeri.Vectors. I have a rare problem, the WS's request has a property int? (int nullable), everything works perfect unt...
- Modified
- 6 Mar at 12:36
Availability of HttpClientFactory for Azure Functions v2
I want to know if HttpClientFactory or similar is available for Azure Functions v2. Below is what is recommended, but HttpClientFactory or similar is not shown. ``` // Create a single, static HttpC...
- Modified
- 6 Mar at 13:35
Selenium.WebDriver.ChromeDriver - chromedriver.exe is not being publishing for netcore2.2 target framework
I installed nuget package - Selenium.WebDriver.ChromeDriver 2.46.0.. When I publish (through dotnet publish .Net CLI command) .csproject (target framework - netcore2.2) the chromedriver.exe is not bei...
- Modified
- 5 Mar at 18:27
Type system oddity: Enumerable.Cast<int>()
Consider: ``` enum Foo { Bar, Quux, } void Main() { var enumValues = new[] { Foo.Bar, Foo.Quux, }; Console.WriteLine(enumValues.GetType()); // output: Foo[] Console.Write...
Partial updates with PopulateWithNonDefaultValues overwrites null fields in sub classes
I have a class "company" that contains a sub class "address". "Address" contains a field "city" and a field "postalcode". Both nullable (strings). I have an existing company with both fields in the a...
- Modified
- 5 Mar at 09:25
Can you use Nameof, or another technique, to embed a procedure name in a code comment dynamically?
The following comment line becomes inaccurate if the name of SampelSubName gets changed. 'This is a code comment about SampleSubName.
Customize Login Page design for Authentication type : Individual User account ASP.NET core 2.1, MVC, c#
I'm trying to implement OAuth2.0 for my web application. I have done that following [this](https://learn.microsoft.com/en-us/aspnet/core/security/authentication/social/index?view=aspnetcore-2.2) link....
- Modified
- 21 Jan at 23:3
What sort of unit does NetTopologySuite return distances in, and how can I convert it to miles/km?
Whenever I use FreeMapTools to calculate the distance between myself and my friends postcode, it gives me the following: - - [](https://i.stack.imgur.com/D3NNf.png) [](https://i.stack.imgur.com/RNu...
- Modified
- 4 Mar at 20:40
Error 500.19 with 0x8007000d when running ASP.NET Core app in IIS despite AspNetCoreModule being installed
I have an ASP.NET Core app that runs great in IIS Express. Similarly, if I launch the app from the command line via `dotnet run`, everything works smoothly: ``` C:\Code\Sandbox\IisTestApp\IisTestApp...
- Modified
- 16 Jun at 01:24
Parsing a JSON file with .NET core 3.0/System.text.Json
I'm trying to read and parse a large JSON file that cannot fit in memory with the new JSON reader `System.Text.Json` in .NET Core 3.0. The example code from Microsoft takes a `ReadOnlySpan<byte>` as ...
- Modified
- 25 Nov at 23:21
Disable Get Keyword in Servicestack Login
Currently in auth/login, you can use any Get. How do I restrict GET keyword for certain built in services. We had a pentest finding stating that auth/login should not be allowed via the Get keyword ...
- Modified
- 4 Mar at 08:32
RangeError (index): Invalid value: Valid value range is empty: 0
I am trying to fetch a list from API that is two methods fetchImages and fetchCategories. the first time it is showing a red screen error and then after 2 seconds automatically it is loading the list....
Non-nullable string type, how to use with Asp.Net Core options
MS states [Express your design intent more clearly with nullable and non-nullable reference types](https://learn.microsoft.com/en-us/dotnet/csharp/tutorials/nullable-reference-types). My intent is t...
- Modified
- 23 May at 03:31
Resetting Experimental instance of Visual Studio
I'm trying to develop extensions for Visual Studio and I'm going through some articles. One key point of VS extension development is to reset experimental instance of Visual Studio, which I am havin...
- Modified
- 29 Jan at 23:40
How to use query parameters in Nest.js?
I am a freshman in Nest.js. And my code as below ``` @Get('findByFilter/:params') async findByFilter(@Query() query): Promise<Article[]> { } ``` I have used `postman` to test this router [ht...
- Modified
- 3 Mar at 04:2