.Net core library: How to test private methods using xUnit
The latest xunit framework does not allow test runners in library code when compiled with .Net Core framework (this is allowed for normal Visual Studio code). The solution is to create a separate test...
Where are generic methods stored?
I've read some information about generics in .ΝΕΤ and noticed one interesting thing. For example, if I have a generic class: ``` class Foo<T> { public static int Counter; } Console.WriteLine...
You MUST call Xamarin.Forms.Init(); prior to using it
In my app.xaml.cs I create a new page. ``` public App() { InitializeComponent(); MainPage = new NavigationPage(new WrapLayoutPage()); } ``` This page calls a static class, which use...
Automatically increment version number in ASP .NET Core
I'm developing a REST API using ASP.NET Core and want the version number to be automatically incremented. This used to be easily by the following pattern in the AssemblyInfo file: [assembly: AssemblyV...
- Modified
- 23 May at 10:30
Using IEnumerator to iterate through a list
Let's say I have a list of employee instances, `employeeList`. I can iterate through them, like this: ``` IEnumerator enumerator = employeeList.GetEnumerator(); while (enumerator.MoveNext()) { Con...
How to connect to an Oracle database Connection from .Net Core
Within a .netCore library I want to connect to an Oracle database. Is there any way I can do that yet? I have tried the suggestions on [another SO post](https://stackoverflow.com/questions/37870369/...
- Modified
- 23 May at 11:54
Attaching an entity with a mix of existing and new entities in its graph (Entity Framework Core 1.1.0)
I have encountered an issue when attaching entities holding reference properties to existing entities (I call existing entity an entity that already exists in the database, and has its PK properly set...
- Modified
- 4 Jan at 08:53
Attaching click to anchor tag in angular
I am trying to attach click event to anchor tags (coming from ajax) and block the default redirection. How can I do it in angular ? ``` <ul> <li><a href="/abc"><p>abc</p></a></li> <li><a hre...
- Modified
- 30 May at 06:45
Remove single quote from start of the string and end of the string
I want to remove quote from starting of the string and end of the string. But my existing code is removing all quotes from the string. I tried to replace with `Trim()` method. But no hopes. **My code ...
How to use requirements.txt to install all dependencies in a python project
I am new to python. Recently I got a project written by python and it requires some installation. I run below command to install but got an error. ``` # pip install requirements.txt Collecting requi...
- Modified
- 4 Jan at 08:40
UWP: ListView ItemClick not work
I have to do a Master/Detail in UWP 1- If you're in Laptop: The responsible GridView of show the data of this person appear. So when you select a item is binded to ViewModel. ``` <ScrollViewer x:Na...
- Modified
- 3 Jan at 22:58
Docker Networking Disabled: WARNING: IPv4 forwarding is disabled. Networking will not work
Containers in a host "suddenly" loses connection to outside-world containers. However, some hosts were refreshed and suddenly we had the following situation: 1. The host can communicate with other h...
- Modified
- 3 Jan at 22:17
List append() in for loop raises exception: 'NoneType' object has no attribute 'append'
In Python, trying to do the most basic append function to a list with a loop: Not sure what I am missing here: ``` a = [] for i in range(5): a = a.append(i) ``` returns: > 'NoneType' object h...
ServiceStack - Defining routes for resources with multiple keys
Which option is best for defining routes when dealing with resources that have multiple keys in ServiceStack? For some context, I have the need to get all transactions for a given customer. A unique ...
- Modified
- 3 Jan at 21:33
Passing data into "router-outlet" child components
I've got a parent component that goes to the server and fetches an object: ``` // parent component @Component({ selector : 'node-display', template : ` <router-outlet [node]="node"><...
- Modified
- 5 Sep at 20:37
No executables found matching command 'dotnet-aspnet-codegenerator'"
When trying to add a Controller in an ASP.NET Core project using Visual Studio 15 Enterprise with Update 3, I get the error below: `"The was an error running the selected code generator: No executab...
- Modified
- 3 Jan at 18:34
System.IdentityModel.Tokens.JwtSecurityToken custom properties
My AuthServer is currently using the following code to generate a JwtSecurityToken: ``` var token = new JwtSecurityToken(_issuer, audienceId, data.Identity.Claims, issued.Value.UtcDateTime, expires.V...
Bootstrap fullscreen layout with 100% height
I want to develop a kiosk-app which should stretch itself to 100% of the complete touch-screen. When I'm nesting for each application-view/template the rows and cols, it becomes horrible complicated...
- Modified
- 3 Jan at 17:3
What is the difference between i = i + 1 and i += 1 in a 'for' loop?
I found out a curious thing today and was wondering if somebody could shed some light into what the difference is here? ``` import numpy as np A = np.arange(12).reshape(4,3) for a in A: a = a + ...
React setState not updating state
So I have this: ``` let total = newDealersDeckTotal.reduce(function(a, b) { return a + b; }, 0); console.log(total, 'tittal'); //outputs correct total setTimeout(() => { this.setState({ dealersOv...
- Modified
- 18 Nov at 08:12
How to remove image as attachment but show in body of email
I found this solution for showing an image in the body of the email: [Add image to body of an email](https://stackoverflow.com/questions/41262856/add-image-to-body-of-an-email) And it works fine but ...
- Modified
- 23 May at 12:24
C# 7 ValueTuple compile error
I'm using VS2017 RC and my application targets net framework 4.6.1. I have two assemblies referencing System.ValueTuple 4.3 MyProject.Services MyProject.WebApi In MyProject.Services I have a class ...
Prime numbers between 1 to 100 in C Programming Language
I want to print prime numbers between 1 to 100, I write my code like the following but when I run it, it starts printing 3,7,11,17....91 Why not the code print 2? Please help me friends ``` #include ...
COM+ activation on a remote server with partitions in C#
I want to access partitioned COM+ applications on a remote server. I have tried this: ``` using COMAdmin using System.Runtime.InteropServices; _serverName = myRemoteServer; _partionName = myPartion...
- Modified
- 23 May at 10:29
Does EF Core allow a unique column to contain multiple nulls?
My entity has a property which is allowed to be null. BUT, if it isn't null, then it must be unique. In other words, the column is unique but allows multiple nulls. I've tried: ``` config.Property(p...
- Modified
- 3 Jan at 08:39