Lock Web API controller method

I'm developing an ASP.NET Web Api application with C# and .Net Framework 4.7. I have a method in a controller that I want to execute only by one thread at a time. In other words, if someone calls thi...

C# Composition - I'm not convinced I fully understand how to implement this

Okay so I have recently been getting up to speed on Classes, Inheritance, Interfaces and how they all interact with one another. During this I discovered a general vocal disdain for inheritance and a...

21 Jun at 07:4

Entity Framework Core "The entity type 'XXX' requires a primary key to be defined."

So I'm currently trying to create a code first migration with Entity Framework Core for a table that displays which lectures the application user has completed. My model looks like this: ``` public c...

Encoding issue when save string "Don’t do it" by ServiceStack and Ormlite to MySQL

Save object with string by ServiceStack and OrmLite to MySQL. The string changed to in MySQL. If I read the value from MySQL and save again, then get It only happened on one Windows server 2016...

How can I do ModelBinding with HttpTrigger in Azure Functions?

I need to create an Azure Function that responds to a HTTP POST, and leverages the integrated model binding. How can I modify this ``` [FunctionName("TokenPolicy")] public static HttpResponseMes...

Vue component event after render

Is there an event in Vue that gets fired after an element re-renders? I have an object that updates, which causes my template to update. After it updates I want to trigger an event which runs a jQuery...

20 Jun at 18:29

CSS file blocked: MIME type mismatch (X-Content-Type-Options: nosniff)

I am developing an Angular 4 app and I want to apply some global styles. Following the [tutorial at the angular site](https://angular.io/tutorial/toh-pt5#global-application-styles), I've created a "s...

15 Jul at 14:53

Exception handler middleware not catching

I'm developping a web API with ASP.NET Core and I'm trying to implement a custom error handling middleware so I can throw standard exceptions that can be converted into a JSON response with the approp...

21 Jun at 09:9

How to remove double-quotes in jq output for parsing json files in bash?

I'm using jq to parse a JSON file as shown [here](http://xmodulo.com/how-to-parse-json-string-via-command-line-on-linux.html#comment-13001). However, the results for string values contain the "double-...

27 Oct at 12:23

Correct way to install psql without full Postgres on macOS?

[Official page](https://www.postgresql.org/download/macosx) do not mention such case. But many users need only `psql` without a local database (I have it on AWS). Brew do not have `psql`.

20 Jun at 13:18

Android dependency has different version for the compile and runtime

After updating Android Studio from to , the following error is thrown at the build time. > Android dependency 'com.android.support:support-support-v4' has different version for the compile (25.2.0) ...

Type 'Object' is defined in an assembly that is not referenced (NET Standard 2.0/.NET Framework 4.6.1)

I'm using the [.NET Standard 2.0](https://blogs.msdn.microsoft.com/dotnet/2017/05/10/announcing-net-core-2-0-preview-1/) preview, on which my Class Libraries are based. After having trouble with a fe...

14 Jul at 02:0

django.db.migrations.exceptions.InconsistentMigrationHistory

When I run `python manage.py migrate` on my Django project, I get the following error: ``` Traceback (most recent call last): File "manage.py", line 22, in <module> execute_from_command_line(sys.argv...

Referencing another project in .Net Core

I have 6 projects in a blank solution. I just want to reference a project to another. I have `HomeController` in projects. I want to access another project's methods like `IOrganizationService` in p...

When to use: Tuple vs Class in C# 7.0

Before Tuples, I used to create a class and its variables, then create object from this class and make that object the return type for some functions. Now, with tuples, I can do the same thing, and in...

14 Jul at 18:12

ServiceStack JsonServiceClient (TypeScript): Do not go to the requests after authentication from CORS

I configured the service as mentioned above: ``` Plugins.Add(new CorsFeature( allowCredentials: true, allowedMethods: "GET, POST, PUT, DELETE, OPTIONS", allowedHeaders: "Content-Ty...

20 Jun at 11:16

How to run shell script file using nodejs?

I need to run a shell script file using nodeJS that executes a set of Cassandra DB commands. Can anybody please help me on this. ``` create keyspace dummy with replication = {'class':'SimpleStra...

28 Feb at 19:5

Conflict between System, Version=4.0.0.0 and System, Version=2.0.5.0 in ServiceStack.Interfaces

I am trying to resolve build warnings but I cannot get past this one. I am targeting .Net 4.6.2, but it appears that `ServiceStack.Interfaces` is targeting a lower version? In the detailed output: ``...

20 Jun at 04:35

How to include XML comments files in Swagger in ASP.NET Core

I need Swagger generate API documentation include UI to test operations. When use ASP.NET in my project, deps XML files are generated, everything is OK, look like this: [](https://i.stack.imgur.com/...

15 Jul at 11:9

What could cause P/Invoke arguments to be out of order when passed?

This is a problem that happens specifically on the ARM, not on x86 or x64. I had this problem reported by a user and was able to reproduce it using UWP on Raspberry Pi 2 via Windows IoT. I've seen t...

17 Nov at 17:10

Sending email using EWS in c# from shared mailbox

The IT department is moving away from creating a service account to shared mailbox. All of our department email accounts are being converted to shared mailbox. Until now, I had been using EWS to send ...

19 Jun at 20:53

VBA + Excel + Try Catch

In VBA, I'm doing a simple script that records a version of a spreadsheet being used. ``` Private Sub Workbook_Open() version = "1.0" Set objHTTP = CreateObject("WinHttp.WinHttpRequest.5.1")...

20 Dec at 14:52

How to know Laravel version and where is it defined?

How to know Laravel version and where is it defined? Is Laravel version is defined inside my application directory or somewhere in global server side directory? Sorry, the main question is where t...

20 Jun at 07:26

Can the data contract serializer used for any third party webservice

I have a large third party webservice; the reference.cs is 33 Mbyte. Using Visual Studio 2017, the proxy uses the XML Serializer, which causes a 5 second delay when creating the channel. I opened a ca...

23 Jun at 12:6

AttributeError: module 'cv2.cv2' has no attribute 'createLBPHFaceRecognizer'

I am facing some attribute error while running face recognizing the code. My face detects code run perfectly.But while I try to run the face recognizing code it shows some attribute error. I googled a...

20 Jun at 00:7