Azure Function Middleware: How to return a custom HTTP response?
I am exploring Azure Function running on `.net 5` and I found out about the new [middleware capabilities](https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.hosting.middlewareworkerappl...
- Modified
- 14 Jul at 00:47
Unable to resolve service for type 'Microsoft.Extensions.Logging.ILogger' while attempting to activate 'Controller'
I am trying to implement Application Insights logging. Here is my startup Under configureservices ``` services.AddApplicationInsightsTelemetry(Configuration["ApplicationInsights:InstrumentationKey"]);...
- Modified
- 5 Aug at 10:37
Cannot run WebApp in .Net
So I created a new web app using $x new web WebApp in my cmd and when I open the .sln file in VS and go to press run I get this page: [](https://i.stack.imgur.com/q2fwD.png) But what I want is this: [...
- Modified
- 11 Jul at 10:39
Using ServiceStack Client with Case Sensitive REST Service
My code is using a `DataContract` with `DataMember` in the response DTO and I'm attempting to consume a REST service with this response but it's not working: ``` { "results": { "p": 277.76, "s": ...
- Modified
- 10 Jul at 00:36
What is the best practice to call Async method from Sync method?
I know some people will argue "why don't you just make SyncMethod() to async method?". We wish, but in a real world, sometimes we have to keep SyncMethod the way it is for backwards compatibility reas...
- Modified
- 5 Jun at 09:48
error: NU1100: Unable to resolve 'MicrosoftOfficeCore (>= 15.0.0)' for 'net5.0'
In Terminal of Visual Studio Code, when I try to run: ``` dotnet add package MicrosoftOfficeCore --version 15.0.0 ``` I get the following error on Visual Studio Code terminal: ``` error: NU1100: Unab...
- Modified
- 25 Oct at 15:14
ServiceStack Different Security based on routes
We have a ServiceStack host, in which we have modularised the services. In addition we have a custom authentication solution based on the Basic Authentication. But what we would like to do is have di...
- Modified
- 7 Jul at 08:10
Why is ServiceStack JwtAuthProvider being invoked when service is specified to authenticate with GithubAuthProvider?
Exploring the `ServiceStack` authentication providers for the first time. Have gradually built up a test project by adding `BasicAuthProvider` and when that worked, added `GithubAuthProvider`. The las...
- Modified
- 7 Jul at 04:41
Why C++ forces initialization of member variables to be in the order of the declaration
I know that in C++ the declaration of members in the class header defines the initialization order. Can you tell me why C++ choose this design? Are there any benefits to force the initialize order ins...
- Modified
- 30 Jun at 06:19
Why does an interface's default implementation get called when two classes are in the inheritance chain, and the class in the middle is empty
## Summary I have found that inserting a class between an interface and another derived class results in the interface's default implementation being called rather than the derived implementation f...
CUDA error: device-side assert triggered on Colab
I am trying to initialize a tensor on Google Colab with GPU enabled. ``` device = torch.device('cuda' if torch.cuda.is_available() else 'cpu') t = torch.tensor([1,2], device=device) ``` But I am get...
- Modified
- 28 Mar at 12:32
SoapHttpClientProtocol equivalent in .NET Core
I'm trying to invoke a soap web service from .NET Core. I've built the proxy using `dotnet-svcutil` and found it's a lot different from an older .NET 4.6 implementation of the same endpoint. The .NET ...
- Modified
- 28 Jun at 14:58
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