Questions

Filtering AutoQuery Results to Only Display Table Rows that Match Data in the Users Session

I'm working on a project that want's to control data access in a multi-tenant system. I've got a table set up which has a row on it that says what tenant the object applies to. Let's call this propert...

What are the advantages of using `lock` over `SemaphoreSlim`?

I'm late to the party, but I recently learned about [`SemaphoreSlim`][1]: I used to use [`lock`][2] for synchronous locking, and a `busy` boolean for asynchronous locking. Now I just use `SemaphoreSli...

Why is the Enumerable.Any(Func<TSource, bool> predicate) slow compared to a foreach with an if statement when searching a List<T>

Something has piqued my curiosity recently.. is the `Enumerable.Any(Func<TSource, bool> predicate)` method than manual foreach, I've been messing with some benchmarks and thought of this. I'm check...

27 Nov at 17:4

Use AuthFeature but disable SessionFeature?

I have a ServiceStack service that is always sent a JWT every request, so it seems to me that I do not need a persistent session whatsoever. How can I disable the SessionFeature yet keep the JwtAuthPr...

18 Nov at 01:33

Why does Microsoft have both Avalonia UI and .NET MAUI?

.Net Conf is currently underway and I learnt about something called Avalonia UI. (I use .NET MAUI) After doing some research, Avalonia UI was primarily a desktop UI framework that now supports Android...

5 May at 14:55

Could not load file or assembly 'System.Runtime, Version=7.0.0.0...' - After installing .NET Core 7 'dotnet watch run' not working

After the .Net 7.0 update, when I use `dotnet watch run` I get this error: > Unhandled exception. System.IO.FileNotFoundException: Could not load file or assembly 'System.Runtime, Version=7.0.0.0, Cul...

21 Nov at 11:6

SDK Resolver Failure - Net 7 - Net 6

Just downloaded and installed SDK Net 7.0.100 and it broke existing applications and they won't load any more in VS 2022 or Rider. Copied the follwing error: ``` error : SDK Resolver Failure: "The SD...

Why does sending via a UdpClient cause subsequent receiving to fail?

I'm trying to create a UDP server which can send messages to all the clients that send messages to it. The real situation is a little more complex, but it's simplest to imagine it as a chat server: ev...

7 Nov at 11:50

How to obtain progress feedback on long running async API calls in ServiceStack

We make several long-running, async, API calls using the Jsonclient to a ServiceStack host. These calls perform a number of closely linked tasks. I would like to obtain some feedback as to the curre...

29 Oct at 02:56

How do you access the user's bearer token in a ServiceStack service?

I have a ServiceStack service which is receiving a bearer token, the bearer token then needs to be passed onto Microsoft Graph for additional API calls from the server side What is the best way to acc...

27 Oct at 22:21

How does a Span survive garbage collection?

I'm pretty convinced that creating a Span from an array doesn't fix (in the sense of the `fixed` keyword) the underlying array, otherwise there wouldn't be a need for `Span.GetPinnableReference` and s...

12 May at 04:18

ServiceStack external dependency with ILogger dependency

I have a ServiceStack host which depends on an external class which has a constructor of the form ``` public class MyClass(ILogger<MyClass) {} ``` but when I call ``` container.AddSingleton<ISearchEn...

18 Oct at 00:11

Does ServiceStack.RabbitMq support creating Quorum queues?

RabbitMQ allows for ['Quorum Queues'](https://www.rabbitmq.com/quorum-queues.html#feature-comparison). As far as I have read in the documentation, 'quorum' queues allow queues to be replicated on all ...

Adding Request Headers to a manually instantiated ServiceStack object?

``` using(var service = new PlacementService()) { service.Request.Headers.Add("Impersonated", "1"); //NULL Exception thrown } ``` I need to be able to set a header on a manually instantiated Ser...

12 Oct at 14:9

Why do string hash codes change for each execution in .NET?

Consider the following code: ``` Console.WriteLine("Hello, World!".GetHashCode()); ``` First run: > 139068974 Second run: > -263623806 Now consider the same thing written in Kotlin: ``` println("Hell...

11 Oct at 06:36

42804: column "tree_path" is of type ltree but expression is of type text - npgsql 6.0

Note that this question has been asked before, in 2017 before Ltree support was added to Npgsql. So it's time to ask it again. I'm using ORMLite with the `UpdateAsync<T>()` method. The TreePath proper...

7 Oct at 16:22

How to use unity container registered Named Type in ServiceStack Requesthandler

I am using ServiceStack (5.12.0) in my ASP.NET service along with Unity Container. I am registering instances of same type as follows ``` public static IUnityContainer Create() { container.Regist...

ServiceStack API Explorer: Login form not working when deployed to IIS as a "sub-application"

I have a aspnet core (dotnet 6) application that uses ServiceStack authentication. The built-in login form is displayed when the browser tries to access protected services, as expected. One can login ...

6 Oct at 13:10

RabbitMQ Errors AlreadyClosedException

I have a .Net 6 microservice application which is receiving occasional RabbitMQ errors although there doesn't appear to be an excessive rate of messages on the queue it is trying to write to. The erro...

5 Oct at 13:8

Cannot add or update a child row: a foreign key constraint fails in vb.net

I have an error on create or add product in mysql is there something wrong. is there something wrong with my code? thanks [](https://i.stack.imgur.com/s6Hgf.jpg) [](https://i.stack.imgur.com/clrwz.jpg...

30 Sep at 06:35

ServiceStack request fails with error 401, but the Session is authenticated

In GlobalRequestFilters I have something like this: ``` var session = new AuthUserSession() { AuthProvider = "credentials", IsAuthenticated = true, Id = $"a unique string", ... }; req....

27 Sep at 07:14

ServiceStack Locode Multi select option

I am developing an app and got a feature where an user can assign multiple 's to a . I want the Create Feature page () to populate the list of available users so that the end-user can assign multipl...

15 Sep at 02:18

Consuming Server Sent Events in .NET

I am working on a service which consumes SSE from the Validic Inform platform to handle wearable device data, and process it for our other various services. Currently there is a complex solution in or...

ServiceStack Locode Forms.formData is undefined

I am trying to customize the UI for the edit form. While referring the chinook repo's [custom.js](https://github.com/NetCoreApps/Chinook/blob/main/Chinook/wwwroot/modules/locode/custom.html) file, `th...

13 Sep at 23:5

The property is part of a key and so cannot be modified or marked as modified (ForeignKey is not a key)

I have two entities with a relationship without a key, when I want to edit the personnel code field in Personnel, this error is displayed to me. > 'The property 'Personnel.PersonnelCode' is part of a ...