Why is Parallel.Invoke much faster if the call is in a separate method?

I implemented the QuickSort-Algorithm 3 times and measured the time for sorting 50 million random numbers: 1. sequential (took ~14 seconds) 2. With Parallel.Invoke() in the same method as the sortin...

.NET decompiler distinction between "using" and "try...finally"

Given the following C# code in which the method is called in two different ways: ``` class Disposable : IDisposable { public void Dispose() { } } class Program { static void Main(st...

13 Apr at 11:11

Run a background task from a controller action in ASP.NET Core

I am developing a web application with a REST API using C# with ASP.NET Core 2.0. What I want to achieve is when the client send a request to an endpoint I will run a background task separated from th...

Why isn't this code unreachable?

I found a case where I have some code that I believe to be unreachable and is not detected. No warning is issued neither by the compiler nor by Visual Studio. Consider this code: ``` enum Foo { A, B...

3 May at 11:43

Microsoft Edge handling HTTP 401 - ServiceStack Typescript client

`Using the [ServiceStack Typescript client][1] and ServiceStack Auth on the backend I am seeing a failure to call`/access-token` after an initial API request that receives a HTTP 401 response in Micro...

13 Apr at 01:54

C#7 Pattern Matching value Is Not Null

I'd like to grab the first instance of an enumerable and then perform some actions on that found instance if it exists (`!= null`). Is there a way to simplify that access with C#7 pattern Matching? ...

12 Apr at 22:20

Servicestack OrmLite: Capture PRINT statements from stored procedure

I'm currently writing a console app that kicks off a number of stored procedures in our (Sql Server) database. The app is primarily responsible for executing the procedures, logging events to a number...

Rename a foreign key in Entity Framework Core without dropping data

I have two model classes: ``` public class Survey { public int SurveyId { get; set; } public string Name { get; set; } } public class User { public int UserId { get; set; } public i...

Ionic not working on Safari & iOS 11 Using ServiceStack Client

my ionic app not working when calling any webservice (servicestack) method on safari 11.1 (13605.1.33.1.2), see the attched picture also I have the same problem when run to iOS 11 device or simulator....

nuget package not installing dependencies

I've created a nuget package which has 2 dependencies. ``` <?xml version="1.0" encoding="utf-8"?> <package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd"> <metadata> <id>Cons...

12 Apr at 14:39

How to make HTTP POST request with url encoded body in flutter?

I'm trying to make an post request in flutter with content type as url encoded. When I write `body : json.encode(data)`, it encodes to plain text. If I write `body: data` I get the error `type '_Int...

12 Apr at 13:14

WampServer - mysqld.exe can't start because MSVCR120.dll is missing

I've tried to run wampserver on my local side, but mysql server doesn't run. when I try to , it give me error. I searched the answer all day and found some answers on here and there. but any solutio...

Angular Material icons not working

I've installed Material for angular, I've imported on my app module MatIconModule (with `import { MatIconModule } from '@angular/material/icon';`) I've added it under my ngmodule imports with: ```...

Build C++ plugin for Unity

Trying to create my first plugin. The cpp code is: header: ``` #pragma once #ifndef __MY_DLL_H #define __MY_DLL_H extern "C" int add_1(int number); #endif ``` source: ``` //FirstDLL.cpp #includ...

12 Apr at 11:44

.NET core X509Store on linux

Where are the certificate files located in linux when using the .NET Core 2 `X509Store`? On Windows, the certificates are accessible from the management console `certlm.msc` or with `New-SelfSignedCe...

16 May at 00:10

The type ApplicationUser cannot be used as type parameter 'TUser' in the generic type or method 'IdentityDbContext<TUser>'

Trying to implement Identity in ASP.NET Core 2.0. Having many problems getting my head around this. ``` public class Startup { public Startup(IConfiguration configuration) { Config...

12 Apr at 05:43

ASP.NET MVC (Razor) vs Angular 5

We are currently considering moving from ASP.NET MVC to Angular 5, mostly because it seems like the best and latest framework. However none of us seems to be able to come up with hard reasons on why A...

14 Jan at 20:40

What is default location of ChromeDriver and for installing Chrome on Windows

I need to install `chromedriver` on Windows OS. In the article below they specify: [https://sites.google.com/a/chromium.org/chromedriver/getting-started](https://sites.google.com/a/chromium.org/chro...

Servicestack Exception Handling: Passing a Status That Came From Web

Let's say I have multiple services. One service is calling another service to get something. That service also gets some information from a third party vendor. Let's say the third party vendor returne...

12 Apr at 02:25

How do I fix "No pubspec.yaml file found" in flutter?

I am using Windows 10 with VS Code, although I also tested it on PowerShell, and both produced the same result: After creating a new flutter program, before editing anything, I tried to run it on my ...

8 Jun at 05:50

Bearer token in postman

I want to set a `Bearer Token` in postman For some reason my Postman doesn't have the `Bearer Token` option in the Auth dropdown What can I do in Postman to show that option? Any ideas where I can ...

10 Mar at 13:0

Warning: Received `false` for a non-boolean attribute. How do I pass a boolean for a custom boolean attribute?

``` Warning: Received `false` for a non-boolean attribute `comingsoon`. If you want to write it to the DOM, pass a string instead: comingsoon="false" or comingsoon={value.toString()}. ``` How do I...

25 Feb at 08:48

Database operation expected to affect 1 row(s) but actually affected 0 row(s)

I'm trying to insert records in two tables, but getting the exception. Could you please help me to resolve the issue. First I tried the below code. ``` await _testRepository.InsertAsync(test); await...

Uncaught (in promise): Error: StaticInjectorError(AppModule)[options]

I have a strange error. Usually (I did my googling), in this case of errors Angular specifies in square brackets which exactly module/service/provider/etc caused the problem. However here, it says onl...

12 Apr at 09:48

javascript- Uncaught SyntaxError: Identifier * has already been declared

``` console.log(a) //output:ƒ a(){} var a = 1; function a(){}; var a = 10; console.log(a) //output:10 ``` ==================== ``` var a = 1; if(true){ function a(){}; var a = 10; } console.log...

23 Oct at 11:18