Check whether the allow anonymous is on or not in ASP.NET Core

I need a way to check if "allow anonymous" is on/off in the controller action. Whether it comes from controller attribute, action attribute > [AllowAnonymous] or it is set as filter in the MvcOptions ...

Change variables in appsettings when deploying with github actions

I am trying to deploy an app with github actions. I linked my azure account to my github repository and the following actions has been created: ``` name: Build and deploy ASP.Net Core app to Azure We...

PocoDynamo - use existing table

Suppose I have a already existing table in DynamoDB, how do I register it with PocoDynamo The type "SomeTable" points to different tables in prod and stg environments. Is there a way to register the ...

ServiceStack: OpenApi import in Azure Api Management Gateway

We are running a Dotnet Core 2.2 service using ServiceStack 5.7, and need to throttle it. So we want to put it behind a Azure Api Management Gateway (apim) - it runs in a Azure App Service. We have e...

C# - what does the unary ^ do?

I have checked out some code and I got an error ('invalid expression term "^"' to be exact) in the line ``` // choices is a regular array return choices[^1]; ``` I have never seen a unary caret ope...

3 Mar at 08:8

How to get acess token from ServiceStack API

I'm using the service stack core 4 with Identity template, [https://github.com/NetCoreTemplates/mvcidentity](https://github.com/NetCoreTemplates/mvcidentity), and have added the following: ``` new Cr...

3 Mar at 03:32

ServiceStack CORS setup fails due to response to pre-flight doesn't pass access control check

We're trying to set up ServiceStack and CORS within our test environment. Currently there is no IIS security set up (anonymous). When trying to connect from the client (React) the request is rejecte...

3 Mar at 19:34

Blazor Navigation: Update URL without changing reloading page

I use URL parameters for page state in my app. How can i change the URL without actually navigating? Thanks! (using blazor server side)

2 Mar at 18:37

Servicestack Gateway.Send does not work with POST

I have this service method ``` public async Task Post(DeviceEndpointInsertTemp request) { //Some AYNC Code } ``` I call it like this ``` var model = new DeviceEndpoint...

1 Mar at 21:43

How to serialize a dynamic object to a JSON string in dotnet core?

I am passing a JSON payload to an API Controller, and one of the fields is dynamic because the field needs to be passed again as a JSON string to another API. The dotnet core 3.1 middle layer shouldn...

In .NET Core 3.1, the RequestCookieCollection can no longer be used to create cookies in unit tests

I have just upgraded from .NET Core 2.2 to 3.1. I have tests to confirm that extension methods I've added to `HttpContext.Request` are working. I was previously able to do things like: ``` var contex...

How can I attach to a specific process in Visual Studio Code

When I debug my .net core project in VSC I'm asked for a process Id to attach to. This shows a long list of running processes where I either type or scroll to find a specific process. How can I attach...

Error 401 'INVALID_KEY_TYPE' with FireBase and c#

I am implementing c # with FireBase, it sends me error 401 'INVALID_KEY_TYPE' ``` private static Uri FireBasePushNotificationsURL = new Uri("https://fcm.googleapis.com/fcm/send"); private stat...

14 Feb at 19:53

Enable API Response Compression (gzip) on ServiceStack 5.8.1

We have a ServiceStack 5.8.1 API running in Azure that uses EF Core to run queries against an Azure SQL database that is returning 500,000+ records. Calling the API methods returns a JSON representat...

27 Feb at 19:12

Cannot Load Assemblies For .Net Standard library (System.Text.Json)

I am writing a .Net Standard 2.0 library that will be used by a binary PowerShell module. The library will be basically an API client with a lot of classes for dealing with the JSON responses. Prior t...

ASP.NET Core 3.1 JWT signature invalid when using AddJwtBearer()

`AddJwtBearer()` I'm trying to generate and verify a JWT with an asymmetric RSA algo. I can generate the JWT just fine using this demo code ``` [HttpPost("[action]")] [Authorize] [ValidateAntiForgery...

.NET Core Console App as a Windows Service

I currently have a pretty big console app running with ASP.NET Core. I have been tasked with now making this work on one of our servers as a Window Service. I have everything ready to make it run as a...

What does "is { }" mean?

I see the following code sometimes, and have no idea what the expression is actually testing. ``` public static void Something(string[] value) { if (value is { }) { DoSomethingElse(); ...

26 Feb at 15:38

How to bind to element from collection/list in Blazor?

I want to bind values to elements from my list in a loop but I cannot find the good solution. ``` <EditForm Model="@dailyReport" OnValidSubmit="@SubmitDailyReport"> <p> <label>Coun...

20 Jun at 09:12

SqliteException: SQLite Error 1: 'too many SQL variables'

When using `db.SaveAll(collection)` and a Sqlite database it seems to trigger the below error if the collection is too large: > SqliteException: SQLite Error 1: 'too many SQL variables'. The collect...

26 Feb at 05:0

System.Text.Json - Deserialize nested object as string

I'm trying to use the `System.Text.Json.JsonSerializer` to deserialize the model partially, so one of the properties is read as string that contains the original JSON. ``` public class SomeModel { ...

DotnetCore - SharpApp - Parcel Template Server Issue

I have been working with SharpApp by ServiceStack, I read the documentation to start with parcel-web template. [https://github.com/NetCoreTemplates/parcel-webapp](https://github.com/NetCoreTemplates/p...

25 Feb at 12:32

C# Blazor: How to use @typeparam in Code behind? (with workaround)

In a Blazor file you can use `@typeparam MyType` to use . For example: ``` @typeparam MyType <SomeHtml /> @code { [Parameter] public List<MyType> MyList{ get; set; } } ``` So you can c...

7 Jun at 16:40

Teams UpdateActivity events difference when you test in newly created teams

We have a Teams bot that posts messages in MS Teams. The first activity of a new conversation is always an adaptive card and once in a while, we update that with a new card. This worked OK until I mad...

11 May at 11:27

C#8 nullable : string.IsNullOrEmpty is not understood by compiler as helping for guarding against null

I am using C# 8 with .NET framework 4.8 I'm currently guarding against a potential string that can be null with `IsNullOrWhitespace` (same problem with `IsNullOrEmpty`) , but the compiler is still co...