Scroll to specified part of page when clicking top navigation link in Blazor
How can I make a simple "jump to" part of already loaded page in Blazor? Like this in HTML: ``` <a href="#contact">Contact us</a> ... <section id="contact"> ``` Ideally I also want to have it smoot...
Next.js: Router.push with state
I'm using next.js for rebuilding an app for server side rendering. I have a button that handles a search request. In the old app, the handler was this one: ``` search = (event) => { event.preven...
- Modified
- 15 Mar at 12:23
Set readonly fields in a constructor local function c#
The following does not compile. ``` public class A { private readonly int i; public A() { void SetI() { i = 10; } SetI(); } } ``` It ...
- Modified
- 15 Mar at 13:26
The POST method is not supported for this route. Supported methods: GET, HEAD. Laravel
I have a problem with my edit page. When I submit I get this error: > The POST method is not supported for this route. Supported methods: GET, HEAD. I have no clue where it comes from as I am prett...
What are Range and Index types in C# 8?
In C# 8, two new types are added to the System namespace: [System.Index](https://learn.microsoft.com/en-us/dotnet/api/system.index) and [System.Range](https://learn.microsoft.com/en-us/dotnet/api/syst...
How to setup ServiceStack ServerEvents with Redis backpane geographically distributed
My situation is this: Site "A" (Romania): multiple apphost (1 per PC) exanging serverevents using Redis Backpane. Site "B" (Turkey): multiple apphost (1 per PC) exanging serverevents using Redis Back...
- Modified
- 15 Mar at 07:59
Tensorflow 2.0 - AttributeError: module 'tensorflow' has no attribute 'Session'
When I am executing the command `sess = tf.Session()` in Tensorflow 2.0 environment, I am getting an error message as below: ``` Traceback (most recent call last): File "<stdin>", line 1, in <module> ...
- Modified
- 20 Jun at 09:12
On double parsing in C#
I have the following code: ``` var d = double.Parse("4796.400000000001"); Console.WriteLine(d.ToString("G17", CultureInfo.InvariantCulture)); ``` If I compile and run this using an x86 configuratio...
Unable to create an object of type '[DBContext's Name]'. For the different patterns supported at design time
I'm following one of Mosh Hamedani Course on ASP.NET MVC in Udemy. I came across one error while designing my Database using code-first (Entity Framework). At first, I got the error of . After resolvi...
- Modified
- 28 Jan at 09:37
How to get unique file identifier from a file
Before you mark this question as duplicate please read what I write. I have checked many questions in a lot of pages for the solution but could not find anything. On my current application I was using...
- Modified
- 15 Mar at 10:35
Unreachable code, but reachable with an exception
This code is part of an application that reads from and writes to an ODBC connected database. It creates a record in the database and then checks if a record has been successfully created, then return...
- Modified
- 23 Mar at 15:18
NullReferenceException with Nullable DateTime despite null check
`GetTodayItemCount()` attempts to get today's item count using `CreatedDtt` in the `Items` model. Because `CreatedDtt` is a Nullable Datetime (`DateTime?`), I use a ternary operator within the `Where`...
- Modified
- 12 Mar at 01:0
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...