Configuring abstract base class without creating table in EF Core
I have added `DateCreated`, `UserCreated`, `DateModified` and `UserModified` fields to each entity by creating a `BaseEntity.cs` class. My requirement is to generate single table which is having all t...
- Modified
- 22 May at 04:17
Is there a good example of handling ServiceStack validation errors in an ASP.NET Core MVC controller?
The question is self explanatory. Basically I want the api ton act as the service/business layer. All logic should be handled here with validation errors and othe messages being returned back and ha...
- Modified
- 5 Jan at 01:57
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...
- Modified
- 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...
- Modified
- 4 Jan at 15:26
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...
- Modified
- 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]...
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...
- Modified
- 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 ...
- Modified
- 5 May at 18:38
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...
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...
- Modified
- 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...
- Modified
- 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...
- Modified
- 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...
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...
- Modified
- 14 Nov at 11:31
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<...
- Modified
- 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...
- Modified
- 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 ...
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...
- Modified
- 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...
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....
- Modified
- 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...
- Modified
- 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...
- Modified
- 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...
- Modified
- 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...
- Modified
- 8 Dec at 14:26
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...
- Modified
- 3 Apr at 00:47