Use SELECT DISTINCT ON with OrmLite
I tried writing this code to use `SELECT DISTINCT ON`: ``` var q = Db.From<WatchedUrlScanResult>(); q.Join<WatchedUrlRecord>() .Where<WatchedUrlRecord>(x => x.TargetDomainR...
- Modified
- 26 Sep at 01:8
Need understanding as to why string.StartsWith() is true when it should be false
So I have this file that I download via ftp. The file is just a config file for a system at my company I work for. Once the file is downloaded I open the file and processor the file. Part of the proce...
Is it possible to change HTML title with SwashBuckle and Swagger UI
We have many services, which use SwashBuckle / Swagger UI to expose REST methods. It can often be annoying when you have several of them open in tabs in a browser that you cannot immdiately see the se...
- Modified
- 5 May at 14:55
ServiceStack Authentication flow
I’m integrating ServiceStack authentication in my own web app. The flow that I’m trying to implementing is 1. Calling Authenticate method of my own AuthProvider 2. If the authentication against authR...
- Modified
- 22 Sep at 17:37
Is it possible to create a C# record with a private constructor?
I´m trying to rebuild a `discriminated union type` in C#. I always created them with classes like this: ``` public abstract class Result { private Result() { } public sealed class Ok : Resul...
- Modified
- 23 Jun at 11:33
Using dotnet dev-certs with aspnet docker image
You can use `dotnet dev-certs https` to generate a self-signed certificate for use with ASP.NET as this dockerfile demontrates ``` FROM mcr.microsoft.com/dotnet/sdk:5.0 as build WORKDIR /src RUN dotne...
- Modified
- 22 Sep at 10:28
Why is HttpRepl unable to find an OpenAPI description? The command "ls" does not show available endpoints
I am working through the Microsoft Learn tutorials to "[Create a web API with ASP.Net Core](https://learn.microsoft.com/en-us/learn/modules/build-web-api-aspnet-core/3-exercise-create-web-api)". Under...
- Modified
- 25 Sep at 02:51
What is the difference between "is not null" and "!= null"?
With the release of C# 9.0, the pattern was introduced. The documentation for [pattern matching](https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/operators/patterns) states: > Begin...
Autoquery servicestack ILeftJoin issue with table.id column
I have definition of autoquery dto defined as below: ``` [Route("/project/{ProjectId}/contracts/{ContractId}/items")] public class QueryContractItem : QueryDb<ContractItem, ContractItemResponse>, ...
- Modified
- 23 Sep at 08:11
Can OrmLite specify foreign key to an attribute other than the primary key
I have a table structure where a foreign key from Employee table references something other than the primary key of the Department table. This is for historical reasons, so that's just the way it is. ...
- Modified
- 20 Sep at 14:41
Entity Framework | Sequence contains more than one matching element
I used the database first approach. The model is right (or at least it looks like) But I always get this error. Please, I've already tried so many things.. The full code of my program (and even sql sc...
- Modified
- 18 Sep at 16:7
Get X509 Certificate WITH PRIVATE KEY from Azure Keyvault c#
I am currently working on an authentication server developed in C #, this one is hosted on an azure function app, and I use a KeyVault where my secrets are stored. My problem is the following, in my k...
- Modified
- 5 May at 16:48
MicrosoftGraphAuthProvider does not respect [Authenticate("microsoftgraph")] attribute
We have implemented the MicrosoftGraphAuthProvider and it is all set up correctly as we have added an endpoint to output the authorized user's credentials using the following: ``` if (!IsAuthenticated...
- Modified
- 17 Sep at 12:45
Fetch API cannot load localhost:(port&path). URL scheme "localhost" is not supported
I create react app that use API created with Spring Boot. I would like to send a file to the server via the form in my react app (The server works good because I can upload file in Postman). This is m...
How can I use DateOnly/TimeOnly query parameters in ASP.NET Core 6?
As of .NET 6 in ASP.NET API, if you want to get `DateOnly` (or `TimeOnly`) as query parameter, you need to separately specify all it's fields instead of just providing a string ("2021-09-14", or "10:5...
- Modified
- 15 Feb at 00:1
Running Multiple Redis Sentinels through ServiceStack
I'm working on a project that is using a Redis Sentinel through Servicestack. When the project was set up the original developer used Redis for both Caching and for maintaining a series of queue that ...
- Modified
- 14 Sep at 18:8
EF Update-Database Error: Value cannot be null Parameter name: type
I try to execute command `update-database` in PMC and always get this error msg. I know theres [another article](https://stackoverflow.com/q/41777590/16898096) basically has the same error but i tried...
- Modified
- 13 Feb at 09:47
Build was configured to prefer settings repositories over project repositories but repository 'maven' was added by build file 'build.gradle'
I want to add jitpack.io as a repository in my gradle file. This is my gradle root file: ``` buildscript { repositories { google() mavenCentral() } dependencies { c...
ServiceStack - validate json data before it is mapped to a DTO
Using ServiceStack, is it possible to validate JSON data before it is mapped (by ServiceStack) to a DTO? My DTO Shape: ``` public class ExampleDto { public int? MyValue {get;set;} } ``` Example (...
- Modified
- 13 Sep at 08:30
Date Only cannot be mapped SQL Server 2019
I am trying to use the new DateOnly aspects of c# but when I come to do my migrations I am having the following issue. I am using SQL Server 2019 the error is. > 'Amenitie.StartDate could not be mappe...
- Modified
- 11 Sep at 20:25
Setting up MediatR with ServiceStack
Probably I got it all wrong but here is the [MediatR](https://github.com/jbogard/MediatR/tree/v5.1.0) registration at the [ServiceStacks](https://github.com/ServiceStack/ServiceStack/tree/v5.10.4) con...
- Modified
- 10 Sep at 06:15
How to convert XSD maxOccurs="unbounded", minOccurs="0" to OpenAPI?
``` <xs:element name="EarningsData" minOccurs="0"> <xs:complexType> <xs:sequence> <xs:element type="xs:f...
- Modified
- 10 Sep at 07:23
ASP.NET Core .NET 6 Preview 7 Windows Service
I created a new ASP.NET Core project with Visual Studio 2022 Preview and I am trying to run it as a Windows Service. I downloaded the latest Microsoft.Extensions.Hosting.WindowsServices package (6.0.0...
- Modified
- 9 Sep at 20:21
Why can nameof not be used with alias-qualified types at the root level?
Imagine a type at the root namespace level (could be in the default `global` space, or could potentially be an `extern alias`). It appears that this type be referred to via `nameof()`, when using the...
ServiceStack SharpScript Future
Good day, I've been using ServiceStack for many years, I currently designing and planning a rewrite of an ASP MVC (Razor) project. #Script seems to be an almost perfect fit, without hands-on experien...
- Modified
- 9 Sep at 06:14