Questions

Disambiguate between two constructors, when two type parameters are the same

Given ``` class Either<A, B> { public Either(A x) {} public Either(B x) {} } ``` How to disambiguate between the two constructors when the two type parameters are the same? For example,...

12 Sep at 08:33

.NET - c# - Cross partition query is required but disabled trouble on DocumentDB data access

I have written the following code to fetch a record from the DocumentDB ``` private static void QueryDocuments1(DocumentClient client) { IQueryable<SearchInput> queryable = client.CreateDocument...

25 Sep at 18:17

How to use log4net in Asp.net core 2.0

I configure `log4net` in my asp.net core 2.0 application as mentioned in this article [LINK](https://stackify.com/making-log4net-net-core-work/) program.cs ``` public static void Main(string[] args...

ReactJS - .JS vs .JSX

There is something I find very confusing when working in `React.js`. There are plenty of examples available on internet which use `.js` files with `React` but many others use `.jsx` files. I have read...

12 Oct at 05:11

.net core 2.0 ConfigureLogging xunit test

In my xUnit integration test in my .NET Core 2.0 project I cannot see log messages in the terminal that also prints the test results. When the code is run in WebHost environment, the logs are printed ...

12 Sep at 11:1

Authorization based on assigned Permission function

I have three `dbo.PermissionFunc`, `dbo.Roles`, `dbo.Permissions` for my `asp.net MVC web application`. `dbo.PermissionFunc` contains all the function name in my project. `dbo.Roles` contains the ...

How to use protobuff in the serviceStack framework

Do you have a corresponding example? I want to convert the transport format to protolbuff now. Thank you.

12 Sep at 05:34

How to access TempData in my own utility class? Or TempData is null in constructor

I use TempData in some of my Views/Actions but I'd like to extract that into some class. The problem is if I try to create my class in Controller's constructor, the TempDate there is null. Better yet,...

11 Sep at 22:16

Getting "The connection does not support MultipleActiveResultSets" in a ForEach with async-await

I have the following code using Dapper.SimpleCRUD : ``` var test = new FallEnvironmentalCondition[] { new FallEnvironmentalCondition {Id=40,FallId=3,EnvironmentalConditionId=1}, new FallEnvir...

How to get scalar value from a SQL statement in a .Net core application?

The following code in a .Net core console application (EF core 2.0/Sql server). ``` var sql = _context.Set<string>() .FromSql("select dbo.FunctionReturnVarchar({0});", id); ``` got the fo...

5 Nov at 23:11

SignalR - Works when deployed to Server, but stops after a few hours (MVC)

EDIT: Look at the bottom of this post for updates. My SignalR implementation works perfectly on my local system. But when I deployed it out to my server it doesnt seem to work. Its an MVC project. M...

14 Sep at 11:50

Asp.Net Core 2.0-2.2 Kestrel not serving static content

When running a Asp.Net Core 2.0 (or 2.2) app using IIS express, static files (css, js) are served as expected. However when using command line/Kestrel via "dotnet publish -o [targetDirectory]" and do...

17 Jul at 08:56

Map category parent id self referencing table structure to EF Core entity

Database Table: [](https://i.stack.imgur.com/MX0Qc.png) I tried this approach to map the category table to EF core: ``` protected override void OnModelCreating(ModelBuilder modelBuilder) { modelBu...

Attach to running process inside docker from VS2017

Is there an easy way to debug a process running inside a Linux container on a remote host from Visual Studio? Imagine a scenario where we have multiple services deployed on some remote machine, runni...

13 Sep at 03:15

kafka broker not available at starting

I set on a ubuntu node of a cluster a kafka 0.11.0.0 instance. Until some weeks ago everything worked fine, today I'm trying to starting it and I obtain this error after the boot: ``` [2017-09-11 16:...

11 Sep at 14:36

ASP.Net Core register Controller at runtime

I am asking myself if it is possible to load a DLL with `Controller`s in it at runtime and use it. The only solution I've found is to add an assembly via `ApplicationPart` on the `StartUp`: ``` var ...

How to POST via a link in ASP.NET Core

I try to POST to the SetLanguage action via a link, but not sure how to finalize the following code: ``` <form id="selectLanguage" asp-controller="Home" asp-action="SetLanguage" asp-route-returnUrl=...

laravel 5.5 The page has expired due to inactivity. Please refresh and try again

I'm new with Laravel and I have a problem which I don't understand. I have а log form in my project and my method is . When I try a request the result is: > 'The page has expired due to inactivity. ...

19 Feb at 08:47

Prevent pushing to master on GitHub?

GitHub allows you to configure your repository so that [users can't force push to master](https://github.com/blog/2051-protected-branches-and-required-status-checks), but is there a way to prevent pus...

ServiceStack request POST body as query string

I am trying to implement an IPN handler in C# and I am using ServiceStack as my backend framework. I am facing the following issue however; I am trying to find a way to take the POST body of a reques...

How to convert BASE64 string into Image with Flutter?

I'm converting images saved in my Firebase database to Base64 and would like to decode and encode. I've researched similar questions, but am still getting errors. Here is what I have so far? ``` va...

11 Sep at 23:46

Why is HashSet<Point> so much slower than HashSet<string>?

I wanted to store some pixels locations without allowing duplicates, so the first thing comes to mind is `HashSet<Point>` or similar classes. However this seems to be very slow compared to something l...

Entity Framework 6 navigation collections are null instead of empty

I'm trying to write a relational database application using Entity Framework 6. I have classes analogous to: ``` public class Subject { public int ID { get; set; } public string Name { get; s...

10 Sep at 13:25

Unable to cast object of type 'System.Data.ProviderBase.DbConnectionClosedConnecting' to type 'System.Data.SqlClient.SqlInternalConnectionTds

I am getting the following error on the first db access after the application starts - "Unable to cast object of type 'System.Data.ProviderBase.DbConnectionClosedConnecting' to type 'System.Data.SqlCl...

Where should functions in function components go?

I'm trying to convert this cool `<canvas>` animation I found [here](https://blog.alexwendland.com/2015/particle-network-js-animations/) into a React reusable component. It looks like this component wo...

31 Jul at 20:33