Why does ToString() on generic types have square brackets?
Why does `new List<string>().ToString();` return the following:? ``` System.Collections.Generic.List`1[System.String] ``` Why wouldn't it just bring back `System.Collections.Generic.List<System.Str...
How to use string.Format() to format a hex number surrounded by curly brackets?
`uint hex = 0xdeadbeef;` `string result = "{deadbeef}"` First approach: Explicitly add the `{` and `}`; this works: ``` result = "{" + string.Format("{0:x}", hex) + "}"; // -> "{deadbeef}" ``` ...
- Modified
- 20 Oct at 11:12
Add client certificate to .NET Core HttpClient
I was playing around with .NET Core and building an API that utilizes payment APIs. There's a client certificate that needs to be added to the request for two-way SSL authentication. How can I achieve...
- Modified
- 10 Oct at 14:50
Return multiple datasets from sql server stored procedure
I need to return through Web Api a Base64 XML output based upon calling a stored procedures which runs 5 different queries. Stored procedure is not written ( I need to write it ) but there are 5 que...
- Modified
- 13 Oct at 06:27
Get offset minutes from timezone (string) with NodaTime
What's the easiest way to get the minutes if I only have a string that represents the timezone? (for example "Europe/London") So far I have: ``` public static int ConvertFromTimeZoneToMinutesOffset(...
WebApiConfig.Register() vs. GlobalConfiguration.Configure()
I have a project with a reference to Web API 2, and I'm working through some issues with routing. As far as I know, the correct way to approach this is to ensure that the following line of code is pre...
- Modified
- 7 May at 08:28
Servicestack Multitenancy dynamic plugins
We are moving from an on premise-like application to a multi tenant cloud application. for my web application we made a very simple interface based on IPlugin, to create a plugin architecture. (custo...
- Modified
- 12 Oct at 14:47
How do I reference a local image in React?
How can I load image from local directory and include it in `reactjs img src` tag? I have an image called `one.jpeg` inside the same folder as my component and I tried both `<img src="one.jpeg" />` a...
- Modified
- 4 Jul at 15:58
Append an empty row in dataframe using pandas
I am trying to append an empty row at the end of dataframe but unable to do so, even trying to understand how pandas work with append function and still not getting it. Here's the code: ``` import p...
- Modified
- 12 Oct at 12:17
Is it a good practice to mock Automapper in unit tests?
There is this codebase where we use automapper and have 2 layers, `Domain` and `Service`. Each has its object for data representation, `DomainItem` and `ServiceItem`. The service gets data from domain...
- Modified
- 12 Oct at 12:2
How to use Anaconda Python to execute a .py file?
I just downloaded and installed Anaconda on my Windows computer. However, I am having trouble executing .py files using the command prompt. How can I get my computer to understand that the python.exe ...
ASP.NET Core API Controller: Response.Body.WriteAsync base64 string not working
I'm trying to return a base64 string representing a jpeg image from an API Controller and set it as the src of an `` but all my attempts failed. Here is the very simple HTML: And my controller: I've...
- Modified
- 7 May at 06:2
Alternative to deprecated getCellType
I'm reading an excel-file (file extension xlsx) using org.apache.poi 3.15. This is my code: ``` try (FileInputStream fileInputStream = new FileInputStream(file); XSSFWorkbook workbook = new XSSFWor...
- Modified
- 12 Oct at 09:29
BindableProperty in ContentView not working
I made a very simple Yes/No RadioBox control. In it's code behind I have the following `BindableProperty`: ``` public static readonly BindableProperty SelectedValueProperty = BindableProperty.Create...
- Modified
- 12 Oct at 02:23
pass char * to C DLL from C# string
I need to use a library of C functions in a DLL from a C# application. I am having trouble calling DLL functions with char * arguments: The C DLL: The C# app needs to look something like this: I've se...
How does List<SelectListItem> safely cast to SelectList in view
I was following a question where the OP had something like this ``` [HttpGet] public ActionResult Index() { var options = new List<SelectListItem>(); options.Add(new SelectListItem { Text = "...
- Modified
- 24 Jun at 02:8
How can I safely reset Hangfire to a clean state?
I have a server with Hangfire installed. I haven't checked it for a while and it seems one recurring job has gone rogue. It stopped working and then it has stacked up with retries resulting in a compl...
- Modified
- 11 Oct at 13:39
C# Optional Array Parameter for Class
I know this can be done using `null` so I have a workaround for that, but I was wondering if there was a better way that I can have an optional `int[]` parameter for a class? ``` class PriceLevels { ...
- Modified
- 11 Oct at 06:18
Deprecation warning in Moment.js - Not in a recognized ISO format
I'm getting a warning that a value provided to moment is not in a recognized ISO format. I changed my variable today with the moment function and still it doesn't work. Here's the warning error: > Dep...
- Modified
- 6 Jul at 07:3
Why is the scheme required for AuthenticationHeaderValue?
I am setting the authorization header of an `HttpClient` in the following manner: ``` httpClient .DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue(null, "abc"); ``` ...but am...
- Modified
- 4 Jan at 22:5
How to loop an object in React?
New to React and trying to loop Object attributes but React complains about Objects not being valid React children, can someone please give me some advice on how to resolve this problem? I've added cr...
- Modified
- 10 Oct at 20:7
Is using Single as an Assert a bad practice?
I'm testing a method that manipulates a collection. Given a set of parameters it should contain exactly one element that matches a condition. I'm using [Single](https://msdn.microsoft.com/en-us/libr...
- Modified
- 10 Oct at 17:52
React: Passing props to function components
I have a seemingly trivial question about props and function components. Basically, I have a container component which renders a Modal component upon state change which is triggered by user click on a...
- Modified
- 21 Dec at 04:55
What is the purpose of the ContainsPrefix method of the Web API IValueProvider interface?
I've created some implementations of `IValueProvider` for my Web API project and I'm confused about the purpose of the `ContainsPrefix` method on the interface. The `ContainsPrefix` method has this s...
- Modified
- 10 Oct at 19:52
.Net Framework and .Net Core in same solution
I have an application targeting .NET Framework, and now I need to develop a library in .NET Core. I plan to put both projects in the same solution and add the .NET Core library as a reference in the ....
- Modified
- 1 Aug at 03:29