Soap endpoints not appearing in servicestack Asp.Net core application

Newly created Asp.Net core application with ServiceStack.Core package does not expose Soap end point. It only expose Json endpoints as shown in the image below. Soap endpoint support are not supported...

3 May at 13:15

string.Contains as a predicate not a function call?

I found this sample of code on SO (can't remember from where :/) that allowed me to check for line code arguments when launching my application : ``` if (e.Args.Length == 0 || e.Args.Any("-show".Cont...

3 May at 09:20

Ajax helper tags documentation in Asp.net Core

Is there is any link for Ajax helper tags documentation in Asp.net Core. I am trying to learn ajax with asp.net core but i found no documentation for it. In asp.net mvc we use @Ajax.Form and then use...

ServiceStack Swagger UI 500 Error

I'm getting a 500 error when testing a ServiceStack API using Swagger UI. Here's the plugin code: ``` private void InitializePlugins(Container container) { Plugins.Add(new ValidationFeatu...

2 May at 21:23

How To: Register ServiceStack's Redis Client Manager singleton in ASP.NET Core using the default container

I've been reading several documents and articles on how to ServiceStack's Redis client, but all of them use the ServiceStack's `AppHost` method and their built-in Func IOC But I don't want to mix diff...

EF Core - The MERGE statement conflicted with the FOREIGN KEY constraint

I need some help understanding the error I'm getting when I try to update a product. I have read [this similar question](https://stackoverflow.com/questions/49179473/the-merge-statement-conflicted-wi...

Asp.net core web api using windows authentication - Cors request unauthorised

In my asp.net core web api, I've configured Cors as per the article from [MS documentation](https://learn.microsoft.com/en-us/aspnet/core/security/cors?view=aspnetcore-2.1). The web api app is using w...

10 May at 17:41

Checking if Object has null in every property

I have class with multiple properties; ``` public class Employee { public string TYPE { get; set; } public int? SOURCE_ID { get; set; } public string FIRST_NAME { get; set; } ...

2 May at 08:14

When exactly do nullable types throw exceptions?

Consider the following code: ``` int? x = null; Console.Write ("Hashcode: "); Console.WriteLine(x.GetHashCode()); Console.Write("Type: "); Console.WriteLine(x.GetType()); ``` When executed, it writ...

AutoFac / .NET Core - Register DBcontext

I have a new .NET Core Web API project that has the following projects structure: API -> Business / Domain -> Infrastructure The API is very thin with only the API methods. The Business / Domain la...

2 May at 00:14

Awaiting a Callback method

I'm calling a third-party API which has a method that looks like this: ``` myServiceClient.Discover(key, OnCompletionCallback); public bool OnCompletionCallback(string response) { // my code } `...

1 May at 21:11

Extract values from HttpContext.User.Claims

I'm trying to extract an email address from `HttpContext.User.Claims` and I'd like to ask for help to come up with a better way to code this (maybe using LINQ?) The way I'm doing it now seems very ha...

1 May at 17:39

Blazor - How to create Components dynamically

I want to test if it was possible to create Blazor components dynamically. I can't find any way to do this. I have experimented a bit with some dynamic content found on [this link](https://learn-blaz...

11 May at 22:4

Generate a Word document (docx) using data from an XML file / Convert XML to a Word document based on a template

I have an XML file with the data that I need to be populated on a Word document. I need to find a way, to define a template which can be used as a base line to populate data from an XML file and crea...

3 May at 16:31

Mock HttpRequest in ASP.NET Core Controller

I'm building a Web API in ASP.NET Core, and I want to unit test the controllers. I inject an interface for data access, that I can easily mock. But the controller has to check the headers in the Req...

What is the correct usage of ORMLite with ASPNET Core 2.0?

Reading the documentation for ORMLite, it says to register the Connection Factory as a singleton if you're using an IoC container. Is this the correct syntax for that with ASPNET Core 2.0? Or should...

VB vs C# — CType vs ChangeType

Why does this work in VB.Net: ``` Dim ClipboardStream As New StreamReader( CType(ClipboardData.GetData(DataFormats.CommaSeparatedValue), Stream)) ``` But this is throwing an error in C#: > St...

1 May at 07:10

What is the proper usage of JoinableTaskFactory.RunAsync?

I searched online but there is very little information regarding [ThreadHelper.JoinableTaskFactory.RunAsync](https://learn.microsoft.com/en-us/dotnet/api/microsoft.visualstudio.threading.joinabletaskf...

1 May at 12:54

ServiceStack.Redis - is sharding supported in sentinel mode?

I'd like to achieve the following high availability setup: - - - Now, I know that ServiceStack.Redis provides api for connecting to redis via sentinels: ``` new RedisSentinel(sentinelHosts, maste...

24 Jun at 00:8

How should cancellation tokens be used in IHostedService?

The [ASP.NET Core 2.0 documentation](https://learn.microsoft.com/en-us/aspnet/core/fundamentals/hosted-services?view=aspnetcore-2.0) defines the IHostedService interface as follows: > StartAsync(Cance...

NavigationManager - Get current URL in a Blazor component

I need to know the URL of the current page in order to check if I have to apply a certain style to an element. The code below is an example. ``` @using Microsoft.AspNetCore.Blazor.Services @inject...

5 Jan at 18:7

Check if value tuple is default

How to check if a System.ValueTuple is default? Rough example: ``` (string foo, string bar) MyMethod() => default; // Later var result = MyMethod(); if (result is default){ } // doesnt work ``` I ...

30 Apr at 12:35

VSTO custom taskpane on multi DPI system shows content twice

I am building an office addin using VSTO. On systems with multiple monitors with different DPI settings, the contents of my custom task pane is drawn twice on the monitor with the higher DPI settings:...

Authentication method 'caching_sha2_password' not supported by any of the available plugins

When I try to connect MySQL (8.0) database with Visual Studio 2018 I get this error message > "Authentication method 'caching_sha2_password' not supported by any of the available plugins" Also I am...

VS Code: How to copy files to output directory depending on build configurations

I just started a new project in VS Code (C#, .NET Core). Anyways, I want to be able to copy files from within my project directory to the output directory like I can in visual studio. But I also want ...

29 Apr at 05:16