How to redirect to a different route in Blazor Server-side

In Blazor Client a redirection can be achieved using ``` using Microsoft.AspNetCore.Blazor.Browser.Services; (...) BrowserUriHelper.Instance.NavigateTo("/route") ``` This does however not work in a...

22 Apr at 14:54

EFCore - How to exclude owned objects from automatic loading?

I'm trying to wrap my head around EF Cores owned objects and how i can control when to load certain chunks of data. Basically i'm having a bunch of old legacy tables (some with ~150 columns) and wan...

Simplify Attribute decorator on methods when referencing multiple libraries

This is a minor inconvenience, but it ends up generating a lot of boiler plate code. I'm using multiple libraries (ServiceStack.Net, Json.Net, the DataContractSerializer, etc), and to coerce all possi...

4 Feb at 15:58

Why is `.Select(...).Last()` optimized, but `.Select(...).Last(...)` not?

Consider the following enumerator: ``` var items = (new int[] { 1, 2, 3, 4, 5 }).Select(x => { Console.WriteLine($"inspect {x}"); return x; }); ``` This yields the elements `[1, 2, 3, 4, 5]...

4 Jan at 09:5

Any good way to debug Self Hosted https connection issues?

I am working with a self-hosted servicestack webservice on a Windows 10 machine and I am trying to enable https on it. What I have done so far is this: 1) I have created a wildcard cert using our co...

4 Jan at 00:42

Specify EF Core column/field as read only

I have a SQL Server table with certain fields that are set by the database via default values that, once saved, should **never** been modified again (e.g. `DateCreated`). In the Entity Framework Core ...

How do I create a cookie client side using blazor

I have a login page that goes off to the server gets a bunch of data, then I want to take some of that data and save it into a cookie using Blazor on the client. So To start I have successfully injec...

1 Feb at 12:15

ANCM InProcess startup failed because of invalid runtimeconfig.json

The application is deployed as an (32-bit, .NET Core 2.2) App Service on Azure. It works fine when using the standard `AspNetCoreModule` instead of the newer `AspNetCoreModuleV2` that supports the `In...

3 Jan at 12:3

Collapse Grid Row in WPF

I have created a custom WPF element extended from `RowDefinition` that should collapse rows in a grid when the `Collapsed` property of the element is set to `True`. It does it by using a converter an...

6 Jan at 14:42

Custom bindings in Azure Function not getting resolved

I'm trying to create my own custom binding for Azure Functions. This work is based on 2 wiki articles concerning this feature: [https://github.com/Azure/azure-webjobs-sdk/wiki/Creating-custom-input-an...

20 Jun at 09:12

Group alternate pairs using LINQ

I am trying to group a list of [DTOs](https://en.wikipedia.org/wiki/Data_transfer_object) which contain alternate family pairs to group them in the following format to minimize duplication. Here is t...

3 Jan at 18:12

Azure functions local.settings.json represented in appsettings.json for a ServiceBusTrigger

I currently have an azure function using the ServiceBusTrigger binding ``` [ServiceBusTrigger("%TopicName%", "%SubscripionName%", Connection = "MyConnection")] string catclogueEventMsgs, IL...

Misunderstanding of .NET on overloaded methods with different parameters (Call Ambiguous)

I have a problem with some overloaded methods and I will try to give a simple implementation of it. So here is a class contains two methods below: ``` public class MyRepo<TEntity> { public List<...

2 Jan at 04:40

WARNING in budgets, maximum exceeded for initial

When building my Angular 7 project with --prod, I receive a warning in `budgets`. I have an Angular 7 project. I am trying to build it, but I keep getting the following warning: ``` WARNING in budgets...

14 Oct at 10:13

How is it that a struct containing ValueTuple can satisfy unmanaged constraints, but ValueTuple itself cannot?

Consider the following types: - `(int, int)`- `struct MyStruct { public (int,int) Value; }` A non-generic structure `MyStruct`, which has a managed member `(int,int)` has been evaluated as managed ...

19 Nov at 04:40

Why does order between UseStaticFiles and UseDefaultFiles matter?

I understand that the order of registration for middleware [may matter](https://stackoverflow.com/a/36793808/1525840). However, it's not given that it's necessarily the case. I noticed that needs to...

31 Dec at 15:7

Git fatal: protocol 'https' is not supported

I am going through Github's forking guide: [https://guides.github.com/activities/forking/](https://guides.github.com/activities/forking/) and I am trying to clone the repository onto my computer. Howe...

29 Apr at 12:39

How to PATCH data using System.Net.Http

I have uploaded a file to SharePoint and found out what id it has. Now I need to update some of the other columns on that listitem. The problem is that System.Net.Http.HttpMethod.Patch doesn't exist....

31 Dec at 00:24

Why does stackalloc initialization have inconsistent behavior?

The following code initializes two stackalloc arrays with non-zero values. While array A is properly initialized, array B remains filled with zeroes, contrary to what is expected. By disassembling th...

31 Dec at 06:54

OIDC login fails with 'Correlation failed' - 'cookie not found' while cookie is present

I'm using IdentityServer 4 to provide authentication and autorisation for my web app, using an external login provider (Microsoft). This works fine when I run both IdentityServer and my web app local...

15 Aug at 13:0

extended OrmLiteAuthRepository not binding properly

I extended the class OrmLiteAuthRepository In the app host i inject it into the container. I test it using requiredrole controller and it never calls the methods for my custom security checks. Even t...

30 Dec at 18:6

IdentityServer4 Role Based Authorization for Web API with ASP.NET Core Identity

I am using IdentityServer4 with .Net Core 2.1 and Asp.Net Core Identity. I have two projects in my Solution. - - I want to Protect my Web APIs, I use postman for requesting new tokens, It works an...

How do I get a warning in Visual Studio when async methods don't end in 'Async'?

How can I get Visual Studio to give me a naming warning each time I create an asynchronous method that doesn't end in "Async"? It's the recommended convention for asynchronous methods, but I often fi...

3 Apr at 00:47

How do I check if a type fits the unmanaged constraint in C#?

How do I check if a type `T` fits the `unmanaged` type constraint, such that it could be used in a context like this: `class Foo<T> where T : unmanaged`? My first idea was `typeof(T).IsUnmanaged` or s...

29 Dec at 12:8

Flutter Error: RangeError (index): Invalid value: Not in range 0..2, inclusive: 3

I am using a long list in Flutter. All the items are rendering fine but I also receive the following error: ``` RangeError (index): Invalid value: Not in range 0..2, inclusive: 3 ``` The following is...

4 Jul at 18:34