xUnit Theory with async MemberData
I have a unit test project using [xUnit.net](http://xunit.github.io/docs/getting-started-dotnet-core) v.2.3.1 for my ASP.NET Core 2.0 web app. My test should focus on testing a given DataEntry instan...
- Modified
- 4 May at 12:46
Why do Service Stack dot net core project templates include a types folder in the service model project with a .GitIgnore
I cannot figure out, nor can I find documentation, for the use of the "Types" folder in the ServiceModel project. I have used the Service Stack project template cli for .NET Core 2.0 web and self host...
- Modified
- 3 May at 13:25
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...
- Modified
- 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...
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...
- Modified
- 3 May at 06:37
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...
- Modified
- 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...
- Modified
- 2 May at 19:36
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...
- Modified
- 2 May at 08:54
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...
- Modified
- 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; } ...
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...
- Modified
- 2 May at 06:32
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...
- Modified
- 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 } `...
- Modified
- 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...
- Modified
- 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...
- Modified
- 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...
- Modified
- 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...
- Modified
- 1 May at 13:19
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...
- Modified
- 1 May at 12:39
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...
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...
- Modified
- 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...
- Modified
- 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...
- Modified
- 20 Jun at 09:12
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...
- Modified
- 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 ...
- Modified
- 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:...
- Modified
- 8 May at 05:7