What does exclamation mark mean before invoking a method in C# 8.0?

I have found a code written in C# seemingly version 8.0. In the code, there is an exclamation mark before invoking a method. What does this part of the code mean, and above all, what are its uses? ``...

7 Dec at 22:14

How to refresh a blazor sub/child component within a main/parent component?

You have a main component and inside the main component you have many sub-components You want to refresh a single subcomponent, rather than the entire screen of the main component, is this possible? ...

C# 8.0 - Can't use default interface implementations

I recently read about C# 8.0 having interface default implementations, so i went into my project and tried it out, but i was met with an error instead. `Target runtime doesn't support default interfac...

6 May at 10:34

Returning a 403 status code in Service Stack

I have a web service using service stack and I'm putting in a blacklist check to stop the processing of requests from a list of the blacklisted IP addresses. How do I return a 403 status code back to...

6 Dec at 12:38

.Net Core 3.0 possible object cycle was detected which is not supported

I have 2 entities that are related as one to many ``` public class Restaurant { public int RestaurantId {get;set;} public string Name {get;set;} public List<Reservation> Reservations {get;se...

"context.Resource as AuthorizationFilterContext" returning null in ASP.NET Core 3.0

I am trying to implement a custom authorization requirement following a tutorial. It seems like `context.Resource` no longer contains `AuthorizationFilterContext` and as a result: ``` var authFilter...

5 Dec at 14:46

HttpClientFactory: Typed HttpClient with additional constructor arguments

With [HttpClientFactory](https://learn.microsoft.com/en-us/aspnet/core/fundamentals/http-requests?view=aspnetcore-3.1#typed-clients) we can configure dependancy injection to create and manage the life...

ImportError: cannot import name 'six' from 'django.utils'

Recently, I upgraded the version of Django framework from `2.0.6` to `3.0` and suddenly after calling `python manage.py shell` command, I got this exception: > ImportError: cannot import name 'six' f...

1 Apr at 12:34

Could not load file or assembly "ChilkatDotNet45.dll" or one of its dependency. ......After deploying in IIS

My asp.net application works fine when run from visual studio, but after deploying in IIS it throws error like : Could not load file or assembly "ChilkatDotNet45.dll" or one of its dependency. An atte...

5 Dec at 10:42

TargetFramework vs. TargetFrameworks (plural)

In the `.csproj` file in my .NET Core projects, there are these 3 lines by default: ``` <PropertyGroup> <TargetFramework>netcoreapp2.2</TargetFramework> </PropertyGroup> ``` Now if I want to targ...

5 Dec at 09:35

How to make ASP.NET Core return XML result?

``` [HttpGet] [HttpPost] public HttpResponseMessage GetXml(string value) { var xml = $"<result><value>{value}</value></result>"; return new HttpResponseMessage { Content = new String...

Template not provided using create-react-app

When I type the `create-react-app my-app` command in my terminal, it appears to work - downloading all libraries successfully etc. At the end of that process however I get a message that a `template w...

5 Dec at 05:12

.NET 4.7.2 Dependency Injection in ASP.NET WebForms Website - Constructor injection not working

We are currently working with an older project (ASP.NET Web Forms Website) and trying to see if we can set up dependency injection for it. Need to emphasize: this is NOT a Web Application project... ...

How to bind object to <select> option in Blazor?

I have the following dropdown menu: ``` public class object { public other_object apple {get; set;} ... public string stuff {get; set;} ... } public class other_object { public s...

4 Dec at 13:21

ASP.NET Core WebSockets

I'm trying to have a WebSocket server up and running on ASP.NET Core. I created an empty web project `dotnet new web` changed the `Program.cs` to: ``` public static void Main(string[] args) { Host...

26 Jan at 07:3

Entity Framework Core 3.0 performance impact for including collection navigation properties (cartesian explosion)

We're facing a major performance problem after upgrading EF Core 2.2 to EF Core 3.0. Imagine a simple data model with a single collection navigation property and hundreds of fields (the reality looks ...

MongoDB connection error: MongoTimeoutError: Server selection timed out after 30000 ms

I am trying to create a fullstack app reading the following tutorial: [https://medium.com/javascript-in-plain-english/full-stack-mongodb-react-node-js-express-js-in-one-simple-app-6cc8ed6de274](https...

6 Dec at 11:32

Is the correct way to cancel a cancellation token used in a task?

I have code that creates a cancellation token ``` public partial class CardsTabViewModel : BaseViewModel { public CancellationTokenSource cts; public async Task OnAppearing() { cts = new Cance...

4 Dec at 02:52

Check if Graph API folder exists

I am using Microsoft Graph API and I am creating a folder like so: ``` var driveItem = new DriveItem { Name = Customer_Name.Text + Customer_LName.Text, Folder = new Folder { }, Ad...

11 May at 18:47

Array and string offset access syntax with curly braces is deprecated

I've just updated my php version to 7.4, and i noticed this error pops up: > Array and string offset access syntax with curly braces is deprecated here is part of my code which is triggering the above...

9 Dec at 13:49

Unable to load System.Threading.Tasks.Extensions

I have a web project build on .net framework 4.5.1. We are trying to added PostgreSQL support for the project. Using Nuget, I have installed 4.0.4 npgsql to the project. Under references, I see the fo...

3 Dec at 12:9

Visual Studio Code PHP Intelephense Keep Showing Not Necessary Error

After the latest update of PHP Intelephense that I get today, the intelephense keep showing an error for an undefined symbol for my route (and other class too), there is no error like this before and ...

3 Dec at 03:42

Blazor in MVC: Component gets rendered, but @onclick not working. Problem with connection

I'm trying to use Blazor in a .net core 3 MVC project. I used a few tutorials to do this, like [https://fizzylogic.nl/2019/08/18/integrating-blazor-in-an-existing-asp-net-core-application/](https://fi...

.NET core 3: Order of serialization for JsonPropertyName (System.Text.Json.Serialization)

While migrating to .NET Core 3 I've switched from Newtonsoft.Json serialization to System.Text.Json.Serialization. Of all the features I want to continue using JsonPropertyName attribute. Newtonsoft...

Unable to track an entity of type because primary key property 'id' is null

After I upgraded to Asp.Net Core 3.0 I am getting the following error for my Identity class when attempting to create a user: > Unable to track an entity 'User' of type because primary key property ...