loading a full hierarchy from a self referencing table with EntityFramework.Core

Explanation why this question is different to: [EF - multiple includes to eager load hierarchical data. Bad practice?](https://stackoverflow.com/questions/23497079/ef-multiple-includes-to-eager-load-h...

Moving all files from one directory to another using Python

I want to move all text files from one folder to another folder using Python. I found this code: ``` import os, shutil, glob dst = '/path/to/dir/Caches/com.apple.Safari/WebKitCache/Version\ 4/Blobs ...

8 Sep at 10:2

Can I make an ASP.NET Core controller internal?

ASP.NET (and Core) controllers need to be `public`. Problem is I have a controller which depends (in its constructor) on something `internal`. And that dependency depends on something internal, which...

24 Jan at 09:56

System.NotSupportedException - Cannot compare elements of type 'System.Linq.IQueryable

I am currently getting the below error > An exception of type 'System.NotSupportedException' occurred in >EntityFramework.SqlServer.dll but was not handled in user codeAdditional information: Cannot c...

20 Jun at 09:12

ModuleNotFoundError: What does it mean __main__ is not a package?

I am trying to run a module from the console. The structure of my directory is this: [](https://i.stack.imgur.com/naRKa.png) I am trying to run the module `p_03_using_bisection_search.py`, from the ...

Asp.Net Core: register implementation with multiple interfaces and lifestyle Singleton

Considering the following interface and class definitions: ``` public interface IInterface1 { } public interface IInterface2 { } public class MyClass : IInterface1, IInterface2 { } ``` is there any...

Correctly create RSACryptoServiceProvider from public key

I'm currently trying to create an `RSACryptoServiceProvider` object solely from a decoded PEM file. After several days of searching, I did manage to wrangle a working solution but it's not one that wo...

Register all implementation of type T interface in .NET core

I have an interface public interface IEvent { } An Event class public class ContactEvent : IEvent { } Two Event Handlers classes public class ContactCreateHandler : IEventHandler { } public cl...

6 May at 10:39

Create (and select from) a table dynamically using servicestack ormlite

I am using `C#`, and I try to create a table, using `ServiceStack.OrmLite`, corresponding to a class type created in , I searched for the topic and I have found the following solution: - After creat...

23 Jan at 12:59

Get custom attributes via ActionExecutingContext from controller .Net Core

This used used to work with earlier version of .Net. What's the equivalent in .net core terms. Now I get following error: 'ActionDescriptor' does not contain a definition for '' and no extension meth...

23 Jan at 09:55

Error in Visual Studio Code Dotnet Core C#: "The type or namespace name 'System' could not be found", but build succeeds

When trying to work with Visual Studio Code on a C# DotNet Core MVC application, I am having a lot of trouble getting visual studio code to work. It is having trouble finding anything related to C#, m...

ASP.NET Core API POST parameter is always null

I have read the following: - [Asp.net Core Post parameter is always null](https://stackoverflow.com/questions/39748153/asp-net-core-post-parameter-is-always-null)- [asp.net webapi 2 post parameter is...

23 May at 11:47

Return a response and file via servicestack

I am working on a project where we have a database and a separate file system both stored on the same server and are accessed through service stack requests and responses. The database contains the ...

23 Jan at 01:52

`col-xs-*` not working in Bootstrap 4

I have not encountered this before, and I am having a very hard time trying to find the solution. When having a column equal to medium in bootstrap like so: ``` <h1 class="text-center">Hello, world!<...

Plotting images side by side using matplotlib

I was wondering how I am able to plot images side by side using `matplotlib` for example something like this: [](https://i.stack.imgur.com/dDepR.jpg) The closest I got is this: [](https://i.stack.imgu...

5 May at 02:9

ADB device list is empty

I have the latest version of Android Studio and an Android device. I turned on developer mode on my device and plugged it to my lap top via USB. I didn't get the prompt message that asks me to author...

30 Mar at 17:52

First-child full-width in Flexbox

How can I set the first-child of flexbox in full-width and all of the other childs set to `flex:1`(for split space)? Like this: [](https://i.stack.imgur.com/bjGWl.png)

20 Oct at 12:19

Why Task.Factory.StartNew returns immediately while Task.Run does not?

Consider this code snippet: ```csharp Task[] tasks = new Task[4]; for (var i = 0; i { await Task.Delay(4000); }); } for (var i = 0; i

6 May at 06:13

Eager Load many to Many - EF Core

Hello I have a many to many relationship set up like following. ``` public class order { public int id { get; set; } public virtual ICollection<OrderProducts> Products { get; set; } }...

Unity C# JsonUtility is not serializing a list

I've got some data I need to serialize/deserialize, but JsonUtility is just not doing what it's supposed to. Here's the objects I'm working with: ``` public class SpriteData { public string sprit...

22 Jan at 03:42

Scientific Notation in C#

How do I assign a number that is in scientific notation to a variable in C#? I'm looking to use Plancks Constant which is 6.626 X 10 This is the code I have which isn't correct: ``` Decimal Plancks...

22 Jan at 03:48

How to emit a Type in .NET Core

In C#, how do I emit a new Type at runtime with .NET Core? All of the examples I can find for .NET 6 don't seem to work in .NET core (they all begin with getting the current AppDomain, which doesn't e...

21 Jan at 20:54

JSON Deserialization - String Is Automatically Converted To Int

When I deseiralize the JSON to the C# object below, either using Newtonsoft explicitly or via the model binding mechanism of ASP.NET Web Api, the string `id` value is automatically converted to int. I...

Dynamically read properties from c# expando object

Currently I have the following method- I would like to replace `T` with expando object. But I can't read properties from an expando object. Is there any way to do it?

5 May at 16:53

SerialPort.BaseStream.ReadAsync drops or scrambles bytes when reading from a USB Serial Port

I've added the sending code and an example of the received output I'm getting. --- I am reading data from a USB "virtual" serial port connected to an embedded system. I have written two methods...

23 May at 12:33