Generic method with type constraints or base class parameter
If I write a method accepting a parameter which derives from a `BaseClass` (or an interface), as far as I know there are two ways to achieve that: ``` void MyMethod<T>(T obj) where T : BaseClass { ......
- Modified
- 23 Jul at 16:17
Why does a `null` Nullable<T> have a hash code?
Bit of a weird question... But can anyone give me a justification for why this would be expected behaviour? This just seems totally odd to me.... ``` //Makes perfect sense object o = null; o.GetHas...
ToArrayAsync() throws "The source IQueryable doesn't implement IAsyncEnumerable"
I have a MVC project on ASP.NET Core, my problem is connected with IQueryable and asynchronous. I wrote the following method for search in `IQueryable<T>`: ``` private IQueryable<InternalOrderInfo> W...
- Modified
- 12 Feb at 09:30
Create a ClassLibrary in .NET is compatible with all the frameworks
I want to create a compatible ClassLibraray, But I don't know how to create it. e.g: ![Project Property](https://i.stack.imgur.com/aSqwK.png) ![References](https://i.stack.imgur.com/Got2G.png)
- Modified
- 12 Feb at 09:5
ASP.NET Core 2.0 Web App Deployment and Hosting
My local dev environment is a Windows 10 PC using Visual Studio 2017. NOTE: At the moment I can only access my web server via cpanel. However, if the hosting provider cannot provide adequate suppor...
- Modified
- 12 Feb at 06:53
Passing .net core model data to external javascript?
I have a .NET Core Razor view with the underlying model inside a *.cshtml.cs file. Let's say I have a string like this: How can I access this variable (data) inside my external JavaScript file? I need...
- Modified
- 5 May at 15:50
how to add a Run Button and Compile Button on the toolbar in visual studio
I want to add a "" button and a "" button on the toolbar so that I may not have to Press or
- Modified
- 11 Feb at 16:31
Appropriate design pattern for the payment modules c#
As i am learning through design pattern concept and also wanted to implement the payment modules in my project using the proper design pattern. So for that I have created some sample code. Currently...
- Modified
- 15 Nov at 14:49
How to read images into a script without using using imageio or scikit image?
I am trying to read a `png` image in python. The `imread` function in `scipy` is being [deprecated](https://docs.scipy.org/doc/scipy/reference/generated/scipy.ndimage.imread.html#scipy.ndimage.imread)...
Vue 'export default' vs 'new Vue'
I just installed Vue and have been following some tutorials to create a project using the vue-cli webpack template. When it creates the component, I notice it binds our data inside of the following: ...
- Modified
- 11 Feb at 02:59
How to configure docker-compose.yml to up a container as root
I'm trying to connect two containers with a docker-compose-yml, but it isn't working. This is my docker-compose.yml file: ``` version: "3" services: datapower: build: . ports: ...
- Modified
- 16 Jul at 10:8
What do strict types do in PHP?
I've seen the following new line in PHP 7, but nobody really explains what it means. I've googled it and all they talk about is will you be enabling it or not like a poll type of thing. ``` declare(s...
- Modified
- 3 Apr at 16:13
Failing to read input from .net-core console application in vscode
I've been trying to get [dotnet new console](https://code.visualstudio.com/docs/other/dotnet) example project (for vscode) to work in Ubuntu 17.10. I can get the default program to run: ``` using Syst...
- Modified
- 20 Jun at 09:12
.NET Core2.0 bundleconfig.json not working
I'm struggling trying to get bundling to work in a Core 2.0 web application. I have the following in my file: ``` [ { "outputFileName": "wwwroot/css/site.min.css", "inputFiles": [ "...
- Modified
- 10 Feb at 12:26
Asp.net core 2 - 401 error with bearer token
I'm not able to access protected method with Authorized with a token generated by Asp.net Core. ``` services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme) .AddJwtBearer(cfg...
- Modified
- 10 Feb at 12:9
pull access denied repository does not exist or may require docker login
I am using Laravel 4.2 with docker. I setup it on local. It worked without any problem but when I am trying to setup online using same procedure then I am getting error: ``` pull access denied for <pr...
- Modified
- 2 Sep at 17:49
Where does the Nuget Get-Project -All | Add-BindingRedirect get its version numbers?
I'm trying to synchronize all of the DLL versions in my solution with many projects. I noted that my app.config contains several assembly binding redirects like so: ``` <dependentAssembly> <assem...
- Modified
- 10 Feb at 01:23
Is ServiceStack.RabbitMQServer thread safe ? Can it start in task?
: .NET WebServer on ServiceStack using RabbitMQ to host services by class RabbitMQServer. : WebServer and RabbitMQ are in diffrent Docker container. : During start WebServer App it has to RabbitMQSe...
- Modified
- 10 Feb at 04:12
StackExchange.Redis: couple of questions about transactions
I've got several question about using transactions from StackExchange.Redis: 1. Is it allowed to execute commands in transaction which could potentially target different nodes in cluster environment...
- Modified
- 12 Feb at 10:45
Partial content in .NET Core MVC (for video/audio streaming)
I am trying to implement video and audio streaming on my website (to enable seeking in Chrome) and I recently found out that .NET Core 2.0 apparently provides a relatively simple and recommended way o...
- Modified
- 9 Feb at 18:6
Best way to measure the execution time of methods
I'm trying to find the best way to measure the duration of a method to log them on Application Insights, I know it's possible if we do something like this: ``` public void TestMethod() { var ...
- Modified
- 9 Feb at 11:42
LINQ OrderBy is not sorting correctly
I hope someone can prove me wrong here :) If I do this: ``` List<string> a = new List<string> { "b", "c", "a", "aa" }; var b = a.OrderBy(o => o).ToList(); ``` I would expect the result of 'b' to b...
How to change .NET Framework in Rider IDE?
In Rider IDE, I am trying to create a new solution: [](https://i.stack.imgur.com/IPGIF.jpg) But I'm unable to change the .NET Framework as the dropdown is disabled. How can I change the version? I hav...
- Modified
- 14 Apr at 07:24
How do I hide an API key in Create React App?
I made a weather app in [Create React App](https://create-react-app.dev/docs/getting-started/) (`create-react-app`). How do I hide the API key so that I can commit to GitHub? Right now, the key is in ...
- Modified
- 17 Jan at 16:37
Xamarin.Forms and ServiceStack exception - Couldn't bind to method 'CertStoreLookup'
We have a Xamarin.Forms android and ios app which has been performing well for a number of years now. The latest version has been in prod since early 2017, and has had very few crashes. Until recentl...
- Modified
- 8 Feb at 23:41