Mapper not initialized, When Use ProjectTo()

I Use In My Project. When I Use `ProjectTo()` In Code Get This Error: > Mapper not initialized. Call Initialize with Appropriate configuration. If you are trying to use mapper instances through a co...

How do I delete multiple rows in Entity Framework Core?

I need to delete multiple rows from a database using Entity Framework Core. This code does NOT work: ``` foreach (var item in items) { myCollection.Remove(item); } ``` because I get an error "...

17 Sep at 16:20

How to unit test DBService which uses the Servicestack Funq IOC

I am new to a project which I should extend so I decided to use TDD to quickly recognize any problems of a system I do not fully understand. There is one class called `DBService` which "encapsulates...

BindingSource - what are the advantages of using BindingSource

What gives me using something like this: ``` DataGridView dgvDocuments = new DataGridView(); BindingSource bindingSource = new BindingSource(); DataTable dtDocuments; dtDocuments = MsSQL.GetDocument...

31 Jan at 12:37

Could not initialize plugin: interface org.mockito.plugins.MockMaker

I'm getting following exception once tests is started: ``` Testcase: treeCtorArgumentTest(com.xythos.client.drive.cachedtree.CachedTreeTest): Caused an ERROR Could not initialize plugin: interface o...

31 Jan at 12:27

How to create multiple page app using react

I have created a single page web app using react js. I have used `webpack` to create bundle of all components. But now I want to create many other pages. Most of pages are API call related. i.e. in th...

31 Jan at 11:31

Set height of chart in Chart.js

I want to draw a horizontal bar chart with Chart.js but it keeps scaling the chart instead of using the height I assign the canvas form the script. Is there any way to set the height of the graph from...

29 Aug at 17:7

Using async/await or task in web api controller (.net core)

I have a .net core API which has a controller that builds an aggregated object to return. the object it creates is made of data that comes from 3 method calls to a service class. These are all indepen...

31 Jan at 10:46

Conditional predicates in LINQ?

Is there a way to combine the queries in `if` and `else` sections? ``` public List<MyClass> GetData(Category category, bool flag= true) { IQueryable<MyClass> result; if (flag) { ...

31 Jan at 08:34

Kendo UI datepicker incompatible with Chrome 56

After updating Chrome to version 56.0.2924.76 (64-bit), our Kendo datepickers stopped working. All datepickers were bound using ViewModels, and now they don't show their values. If we inspect them we ...

'this' implicitly has type 'any' because it does not have a type annotation

When I enable `noImplicitThis` in `tsconfig.json`, I get this error for the following code: > ``` 'this' implicitly has type 'any' because it does not have a type annotation. ``` ``` class Foo impl...

31 Jan at 04:1

Load Connection String from Config File in Azure Functions

In my Azure Function I am using a Library which establishes a connection to an SQL server via the ConnectionString from the ConfigurationManager like this: ``` var cs = System.Configuration.Configura...

31 Jan at 12:40

How to use zIndex in react-native

I've want to achieve the following: [](https://i.stack.imgur.com/QUe7dm.png) The following images are what I can do right now, but that's NOT what I want. [](https://i.stack.imgur.com/P7ASMm.png)[](...

29 Mar at 11:26

How can I get the arguments called in jest mock function?

How can I get the arguments called in jest mock function? I want to inspect the object that is passed as argument.

13 Oct at 19:1

How to download files using axios

I am using axios for basic http requests like GET and POST, and it works well. Now I need to be able to download Excel files too. Is this possible with axios? If so does anyone have some sample code? ...

10 Jan at 19:24

How int + string becomes string?

I came across a strange way to implement `ToString()` and I am wondering how it works: ``` public string tostr(int n) { string s = ""; foreach (char c in n-- + "") { //<------HOW IS THIS PO...

9 Jul at 13:10

Understanding "VOLUME" instruction in DockerFile

Below is the content of my "Dockerfile" ``` FROM node:boron # Create app directory RUN mkdir -p /usr/src/app # Change working dir to /usr/src/app WORKDIR /usr/src/app VOLUME . /usr/src/app RUN npm...

16 Sep at 20:23

How to join 3 tables with linq

I am trying to join 3 tables in a query with Linq to get data from all 3 tables. Below is an image of the table schemes: [](https://i.stack.imgur.com/LXSCX.jpg) The query should select: SewagePlantN...

Tuple vs string as a Dictionary key in C#

I have a cache that I implement using a ConcurrentDictionary, The data that I need to keep depends on 5 parameters. So the Method to get it from the cache is: (I show only 3 parameters here for simpli...

VS Designer error: GenericArguments[0], 'X' on 'Y' violates the constraint of type parameter 'Z'

I am trying to create forms that inherit from a "generic" base class where the generic argument of that base class has a constraint that it must implement one of my interfaces. It compiles and runs j...

.Net MySql error "The given key was not present in the dictionary"

Trying to get simple count from table results in exception bellow. Tried different select statemens which also makes exception: "`SELECT * FROM goods`", but "`SELECT col1, col2 FROM goods`" - works wi...

30 Jan at 06:57

<div> cannot appear as a descendant of <p>

I'm seeing this. It's not a mystery what it is complaining about: ``` Warning: validateDOMnesting(...): <div> cannot appear as a descendant of <p>. See ... SomeComponent > p > ... > SomeOtherComponen...

6 Dec at 16:52

LogisticRegression: Unknown label type: 'continuous' using sklearn in python

I have the following code to test some of most popular ML algorithms of sklearn python library: ``` import numpy as np from sklearn import metrics, svm from sklearn.linear_mode...

29 Jan at 22:7

How do I generate random number between 0 and 1 in C#?

I want to get the random number between 1 and 0. However, I'm getting 0 every single time. Can someone explain me the reason why I and getting 0 all the time? This is the code I have tried. ``` Rand...

16 May at 09:23

Configuring Dbcontext as Transient

In ASP.NET Core / EntityFramework Core, the services.AddDbContext<> method will add the specified context as a scoped service. It's my understanding that that is the suggested lifetime management for...