Functional programming and decoupling
I'm your classic OOP developer. However since I discovered purely functional programming languages I've been ever intrigued to the since OOP seemed to solve most business cases in a reasonable manner...
- Modified
- 28 Jun at 16:21
Select multiple tables and custom column to POCO
I have an export query that returns multiple tables with a lot of columns. ``` var q = db.From<Blog>() .Join<Blog, UserAuthCustom>((b, u) => b.UserAuthCustomId == u.Id) .Join<UserAuthC...
- Modified
- 27 Jun at 02:45
OnCertificateValidated not running - Self-Signed Certificate Client Authentication - ASP.NET Core and Kestrel
I would like to authenticate clients connecting to my ASP.NET Core Web API (.NET 5) running on Kestrel using certificate-based authentication. In my `Startup.cs` I have the following in `ConfigureServ...
- Modified
- 29 Jun at 03:44
TableAlias doesn't work with multiple joins
`TableAlias` isn't working with multiple joins. The query: ``` var q = Db.From<Blog>(Db.TableAlias("b")) .LeftJoin<Blog, BlogToBlogCategory>((b,btb)=> b.Id == btb.BlogId, Db.TableAlias("btbc")) ...
- Modified
- 24 Jun at 21:19
Autquery not including nested result when using a response DTO
Let's say you have these models: ``` public class Blog { [PrimaryKey] [AutoIncrement] public int Id { get; set; } public string Url { get; set; } public string PrivateField { get; ...
- Modified
- 24 Jun at 14:36
Can't get query parameter from HttpRequestData
I'm upgrading my code from .NET 3.0 to .NET 5.0, this changes the sintaxis quite a bit. In my previous code, which is a http request build in AZURE FUNCTIONS .NET 5.0 isolate, builds an GET api that t...
- Modified
- 22 Jun at 17:24
Using PostgreSQL aggregate functions with OrmLite
I am trying to figure out how to process query results with OrmLite for queries that use an aggregate function. For instance take this query: ``` var q = db .From<Blog>(db.TableAlias("b")) .Jo...
- Modified
- 22 Jun at 03:15
Allowing for range requests in Service Stack
Recently we have decided to play some video in browser at my company. We want to support Safari, Firefox and Chrome. To stream video, Safari requires that we implement range http requests in servicest...
- Modified
- 21 Jun at 02:26
New .Net MAUI App project throws 'The name 'InitializeComponent' does not exist in the current context' build errors
I've attempted to start playing with .Net MAUI and I've setup my development environment following the steps as described in: 1. https://learn.microsoft.com/en-us/dotnet/maui/get-started/first-app?pi...
Selecting multiple with table alias and typed query
I needed to join the same table twice so have seen in docs that I can use table alias but I am having some difficulty selecting the joined tables.. This is what I tried: ``` var q = _AutoQuery.CreateD...
- Modified
- 16 Jun at 23:51
UserAuthRole created even if UseDistinctRoleTables is false
When using separate table for Role, e.g. `UseDistinctRoleTables=false` why is `UserAuthRole` table still created? I checked the source code, which has if-clauses for UseDistinctRoleTables many places...
- Modified
- 16 Jun at 14:54
The attribute 'TableAttribute' is a WebJobs attribute and not supported in the .NET Worker, Isolated Process
I am migrating some functions from netcore 3.1 to net5, to use **isolated model**. However, I have come across this incompatibility that I have not resolve; the documentation has not led me to find a ...
- Modified
- 5 May at 14:11
Impersonating user embeds wrong details inside JWT
I am using the following service to get a JWT token to impersonate a user. ``` [Authenticate] [RequiredRole(nameof(UserRoles.Admin))] public class ImpersonateUserService : Service { private static...
- Modified
- 14 Jun at 16:46
Superfluous 'runtimes' folder created in output directory for .NET 5 project
I've just migrated a (WPF) .NET 4.6 project to .NET 5. I've noticed it is now creating a folder called 'runtimes' in the output directory with lots of platform-dependent dlls. Since this app will only...
- Modified
- 10 Jun at 11:16
Compress the response of service stack
I tried to compress the response of service stack using global filters but it not work throws 500 err code. here are my code ``` this.GlobalResponseFilters.Add((req, response, requestDto) => ...
- Modified
- 10 Jun at 10:44
ServiceStack returns UnauthorizedAccessException after usage of Route Annotation
After annotation a dto with ``` [Tag("DocumentationSignoffs")] [Route("/json/reply/DocumentationSignoffs", "GET", Summary = "Get DocumentationSignoffs", Notes = "Get DocumentationSignoffs")] ``` the ...
- Modified
- 9 Jun at 09:39
Bug in .Net's `Random` class?
I was looking at a question that was talking about a bad implementation of the Fisher-Yates shuffling algorithm and I was perplexed that there was a bias when implemented incorrectly. The two algorith...
- Modified
- 9 Jun at 10:43
The generic type already contains a definition
If I try to define the following `Pair<A, B>` class in C#, I get a compiler error. ``` public class Pair<A, B> { public Pair(A a, B b) { this.A = a; this.B = b; } publ...
- Modified
- 8 Jun at 09:41
Get tableDefs from SqlExpression<T>
I have a method that takes a parameter of `SqlExpression<T>`. The method basically takes an OrmLite query and performs some queries on it generated from a string input. I really need to be able to ge...
- Modified
- 8 Jun at 00:26
How to use ranges with List in C#?
With C# 8 we got ranges to get "sub lists". While this works: ``` var array = new string[] { "abc", "def", "ghi" }; var subArray = array[0..1]; // works ``` This does not: ``` var list = new List<str...
- Modified
- 2 Mar at 12:38
Having() count of id's on joined table
I am trying to make this query in OrmLite: ``` select b.* from blog b join blog_to_blog_category btbc on b.id = btbc.blog_id join blog_category bc on btbc.blog_category_id = bc.id where b.url like '%....
- Modified
- 4 Jun at 18:41
Derived class thinks my base class got deleted
I tried to make a derived WinForm class, but I have an issue: when I try to create my DerivedClass (via Add > New element > Derived Form), I'm sure the object at stake is BaseForm because I get the `...
- Modified
- 28 Jun at 16:43
Select distinct on joined table
I have this query ``` var q = Db .From<Blog>() .LeftJoin<BlogToBlogCategory>() .Join<BlogToBlogCategory, BlogCategory>() .Where( .. ) .SelectDistinct(); var results = Db.Select<Bl...
- Modified
- 3 Jun at 20:37
Blazor WASM Net 6 Preview 4 Azure AD - There was an error trying to log you in: 'Cannot read property 'toLowerCase' of undefined'
I have a simple Blazor WASM running Net 6 Preview 4 that I setup using this guide: [https://learn.microsoft.com/en-us/aspnet/core/blazor/security/webassembly/hosted-with-azure-active-directory?view=as...
- Modified
- 3 Jun at 09:25
Nullable Array Notation
I am new to nullable. Is there a meaningful difference between the possible notations? `string?[] str` `string[]? str` and even `string?[]? str` seems to all be valid
- Modified
- 2 Jun at 19:16