The difference between "require(x)" and "import x"
I've just started working on a small node project that will interface with a MongoDB. However, I cannot seem to get the relevant node modules to import correctly, even though I have installed them cor...
- Modified
- 14 Feb at 05:11
Error CS1061 'IdentityBuilder' does not contain a definition for 'AddEntityFrameworkStores'
I'm trying to change the primary key in ASPNET Core 2.0 to `Guid` or `long`. I've tried the following examples in both these links [Link1][1] and [Link2][2] However, in the Startup class I get...
- Modified
- 2 May at 13:0
How to update record using Entity Framework Core?
What is the best approach to update database table data in Entity Framework Core? 1. Retrieve the table row, do the changes and save 2. Use keyword Update in DB context and handle exception for item ...
- Modified
- 9 Dec at 17:58
how to undo pending changes of files that are unchanged?
One thing that drives me crazy with TFS is the fact that if you have a file checked out, but you made no changes to it, it still shows as a change, distracting you from real changes that you made. Thi...
- Modified
- 10 Oct at 01:46
What are the benefits of C# 7 local functions over lambdas?
The other day in one of my utilities, ReSharper hinted me about the piece of code below stating that lambda defining the delegate `ThreadStart` can be turned into a local function: ``` public void St...
What is the best way to compress a request to asp.net core 2 site using HttpClient?
I am sending request that can be significantly big(~1Mb) and I am seeing a large delay betweeen when I make the request and when asp.net core logs that it is handling the request. I think I can cut do...
- Modified
- 9 Oct at 20:37
Is there a way to force npm to generate package-lock.json?
I deleted it by accident and have made many changes to `package.json` since. An `npm install` or `npm update` do not generate `package-lock.json` anymore. I tried clearing my npm cache and my nvm cach...
- Modified
- 10 Jun at 18:41
What's the idiomatic way to verify collection size in xUnit?
I have in my test suite a test that goes something like this: ``` [Fact] public void VerifySomeStuff() { var stuffCollection = GetSomeStuff(); Assert.Equal(1, stuffCollection.Count()); } ```...
Where to store my Git personal access token?
Is it necessary to store the personal access token somewhere locally on the machine after generating it in GitHub? If yes, is there any preferred way where it could be stored?
- Modified
- 17 Nov at 11:4
Is there any technical reason to write a catch block containing only a throw statement?
Disclaimer: It is well known that `catch (ex) { throw ex; }` [is bad practice](https://stackoverflow.com/q/881473/87698). This question is about that. --- While digging through Microsoft referen...
code . is not recognized as an internal or external command
I want to open a directory using cmd in visual studio code but its giving me an error in cmd. So, what setting is required for that? ``` D:\RND>code . ```
- Modified
- 26 Feb at 10:34
firebase.firestore() is not a function when trying to initialize Cloud Firestore
When I try to initialize Firebase Cloud Firestore, I ran into the following error: > Uncaught TypeError: .firestore is not a function I installed firebase with `npm install firebase --save` previou...
- Modified
- 13 Oct at 22:8
C# .NET MVC Service Stack How to access custom user session from Authentication Filter
I have e .NET MVC5 Application with ServiceStack. In an AuthenticationFilter I want to check whether a particular property is in the session. In AuthController: ``` var customerSession = SessionAs<C...
- Modified
- 8 Oct at 14:22
Serilog With API App in Azure
I've integrated Serilog into WebApi project developed with Asp.Net Core 2.0 This is the configuration code in `Program.cs`: ``` Log.Logger = new LoggerConfiguration() .Enrich.FromLogContext()...
- Modified
- 8 Oct at 09:20
ambiguity in package references version
In a project, there are several references to Ninject library which have their version, and the unit test fails, this is the error : > Message: System.IO.FileLoadException : Could not load file or as...
- Modified
- 3 Apr at 11:17
What is the default user and password for elasticsearch?
I have [installed Elastic with Docker](https://www.elastic.co/guide/en/elasticsearch/reference/current/docker.html): ``` docker run -p 9200:9200 \ -p 9300:9300 \ -e "discovery.ty...
- Modified
- 27 Jan at 09:1
How to get the value from DapperRow in a query that returns a single result
I've done the following SQL query: ``` SELECT SUM(SI.UnitaryValue) as Amount FROM Services as S INNER JOIN ServicesItems as SI ON S.ServiceId = SI.ServiceId WHERE S.ServiceId = @ID" ``` In...
- Modified
- 7 Oct at 09:21
Angular - ng: command not found
I'm trying to learn Angular and my knowledge in terminal is beginner. After I installed Angular and then type `ng new my-project`. I get the response `ng: command not found`. I've seen other posts tha...
- Modified
- 24 Dec at 20:23
The *deps.json file in .NET Core
What is the purpose of *deps.json file in .NET Core? What is the reason to store references in such file and not in assembly manifest(as in standalone .NET Framework)? Using Ildasm i checked that ass...
- Modified
- 7 Oct at 15:46
Can I merge table rows in markdown
Is there a way to create merged rows in a column of table in markdown files like ReadMe.md files? Something like this: [](https://i.stack.imgur.com/Z4k5w.png)
- Modified
- 7 Oct at 15:35
How do I target .NET Standard 2.0 in a freshly created .NET Core 2.0 web app?
I've just created a fresh project using `dotnet new web`. My Google-foo may be failing me, but I didn't find anything relating to my answer (please link to another SO answer, or relevant documentation...
- Modified
- 7 Oct at 14:14
What are the ways to secure Azure functions
I have written 5 Azure functions in Azure Portal using c#. Below are the steps to install my application:- - - - - - Above process will be executed on the Customer Edge node. The authorization u...
- Modified
- 7 Oct at 07:50
What are hidden dependencies?
Could someone please give me an example of a hidden dependency. I've googled it, and found results like this: > "A visible dependency is a dependency that developers can see from a class's interfa...
- Modified
- 7 Oct at 03:56
How to display multiple images in one figure correctly?
I am trying to display 20 random images on a single Figure. The images are indeed displayed, but they are overlaid. I am using: ``` import numpy as np import matplotlib.pyplot as plt w=10 h=10 fig=pl...
- Modified
- 8 Oct at 05:4
How to import a csv-file into a data array?
I have a line of code in a script that imports data from a text file with lots of spaces between values into an array for use later. ``` textfile = open('file.txt') data = [] for line in textfile: ...
- Modified
- 7 Oct at 01:49