Questions

Covariance and contravariance on Tasks

Given the followin snippet, i quite dont understand what im going to achieve is not possible: Interface: ``` public interface IEntityRepository<out T> : IRepository<IEntity> { void RequeryData...

asp.net core 1.0 web api use camelcase

On `RC2` the same code returns json format with camel case. After netcore 1.0 release i started new project and the same code is returning json in lowercase. [](https://i.stack.imgur.com/vjPkQ.png) ...

bypass invalid SSL certificate in .net core

I am working on a project that needs to connect to an https site. Every time I connect, my code throws exception because the certificate of that site comes from untrusted site. Is there a way to bypa...

10 Aug at 04:19

AddTransient, AddScoped and AddSingleton Services Differences

I want to implement [dependency injection](https://en.wikipedia.org/wiki/Dependency_injection) (DI) in ASP.NET Core. So after adding this code to `ConfigureServices` method, both ways work. What is th...

8 Jun at 00:10

How to use multiple WITH statements in one PostgreSQL query?

I would like to "declare" what are effectively multiple TEMP tables using the WITH statement. The query I am trying to execute is along the lines of: ``` WITH table_1 AS ( SELECT GENERATE_SERIES('20...

Set the IHostingEnvironment in unit test

I am currently upgrading a project from .NET Core RC1 to the new RTM 1.0 version. In RC1, there was a `IApplicationEnvironment` which was replaced with `IHostingEnvironment` in version 1.0 In RC1 I c...

Visual Studio 2015 Update 3 Offline Installer (ISO)

After digging around for Visual Studio IDE 2015 update 3 offline installer, aka ISO file, I found it and I am sharing the url. And, I know this may be posted elsewhere. But I also do know that many p...

15 Mar at 11:29

How to resolve AttributeError: 'DataFrame' object has no attribute

I know that this kind of question was asked before and I've checked all the answers and I have tried several times to find a solution but in vain. In fact I call a Dataframe using Pandas. I've upload...

2 Nov at 18:10

ImportError: No module named 'encodings'

I recently reinstalled ubuntu and did upgrade to 16.04 and cannot use python: ``` $ python manage.py runserver Could not find platform independent libraries <prefix> Could not find platform dependent ...

Angular 2 router.navigate

I'm trying to navigate to a route in Angular 2 with a mix of route and query parameters. Here is an example route where the route is the last part of the path: ``` { path: ':foo/:bar/:baz/page', co...

24 Nov at 15:4

ServiceStack AutoQuery and [Authenticate] Attribute

I'd like to enforce authentication on some auto querys. ``` [Authenticate] public class BusinessEntitiesService : QueryDb<DataModel.dbo.BusinessEntity> { } ``` Here's my issue. The above class is i...

EF Migration object already exists error

I am working on an ASP.NET MVC project with Entity Framework with code first from database. I get the models for each table in the database. I made some changes in the models, enabled migrations and w...

Empty setter vs no setter in properties

What is the difference between this two property implementations? ``` public override string A { get { return "s"; } set { } } public override string A { get { return "s"; } } ```

1 Jul at 00:1

What is the story of Performance Counters for .NET Core?

Under Windows, one is able to read .NET performance counters using the following: - - `PerformanceCounter`- Considering the recent release of .NET Core and the fact that such app can also run in Li...

30 Jun at 13:12

Does C# store arrays larger than 512 longs (4096 bytes) differently?

I did some benchmarks with collection types implemented in the .NET Framework. From the Reference Source I know that `List<T>` uses an array to store contents. To avoid resizing the array with every ...

1 Jul at 08:23

Some Excel Files not moving from Shared Path to SQL Server

We have an application where the data in Excel file (present in shared path) moves to Database. In case of any error, the files moves to error folder by writing the error in a log file.It uses a windo...

25 Mar at 21:13

How can we destroy child objects in edit mode(Unity3d)?

It is kind of strange things, but if you'll try to destroy child objects with `DestroyImmediate` function, then you will have unpredictabe result. In my case Unity did not destroyed all childs, but di...

5 May at 14:16

How to make nullable list of int

I have this string: ``` string alertsId = "1,2,3,4"; ``` Then I convert the string to list of ints: ``` List<int> list = alertsId.Split(',').Select(n => Convert.ToInt32(n)).ToList(); ``` How ca...

30 Jun at 10:6

TokenValidationParameters no longer working after upgrade to 5.0.0

I have the following code which was working when I was using ``` private static void ConfigureAzureAD(IAppBuilder appBuilder) { appBuilder.UseWindowsAzureActiveDirectoryBearerAuthentication( ...

send bold & italic text on telegram bot with html

I've created a bot in telegram I want to send bold and italic text with HTML page to bot My HTML code is: ``` <html> <head><title>Telegram</title></head> <body> <form method="GET" action="https...

async/await throws NullReferenceException how can we diagnose where we messed it up?

we have started using async/await in asp.net application, now we are getting the famous exception in our production > An unhandled exception occurred and the process was terminated.Application ID: /L...

30 Jun at 09:31

What is the original type of interpolated string?

MSDN [docs](https://msdn.microsoft.com/en-us/library/dn961160.aspx) contain the section about implicit conversions: ``` var s = $"hello, {name}"; System.IFormattable s = $"Hello, {name}"; System.Form...

Can’t delete docker image with dependent child images

I am trying ``` docker rmi c565603bc87f ``` Error: > Error response from daemon: conflict: unable to delete c565603bc87f (cannot be forced) - image has dependent child images So i can't delete ...

6 Mar at 20:48

Why System.Array class implements IList but does not provide Add()

This code: ``` int[] myArr = { 1, 2 }; myArr.Add(3); ``` throws the following error on Build: > error CS1061: 'System.Array' does not contain a definition for 'Add' and no extension method 'Add' acce...

27 Jul at 17:49

What is the best way to return different types of ResponseEntity in Spring-Boot (Error Handling for REST with Spring)

I have written simple REST application in `Spring Boot` (`Spring` Framework). It returns `ResponseEntity<Success>` as response in the controller level. But I want to return a completely different re...