Web API: Configure JSON serializer settings on action or controller level

Overriding the default JSON serializer settings for web API on application level has been covered in a lot of SO threads. But how can I configure its settings on action level? For example, I might wan...

12 Jun at 12:7

ASP.NET Core modify/substitute request body

I want to do a substitution on `HttpContext.Request.Body`. I've tried to do it inside a middleware: ``` public async Task Invoke(HttpContext context) { if (context.Request.Path.Value.Contains("Dat...

How do you add additional files to a NuGet package in Visual Studio 2017?

I recently moved to Visual Studio 2017 Community Edition. It has 2 nice new features: 1. You don't need to explicitly include your source files in the csproj. It does this automatically. 2. It can bu...

21 Jan at 00:51

What's the difference between implementation, api and compile in Gradle?

After updating to Android Studio 3.0 and creating a new project, I noticed that in `build.gradle` there is a new way to add new dependencies instead of `compile` there is `implementation` and instead ...

Equal height rows in CSS Grid Layout

I gather that this is impossible to achieve using Flexbox, as each row can only be the minimal height required to fit its elements, but can this be achieved using the newer CSS Grid? To be clear, I w...

12 Jun at 18:32

Android SDK cannot be found by flutter

I have installed [flutter through AUR.](https://aur.archlinux.org/packages/flutter/) I also have `aur/android-sdk 26.0.2-1` installed. When I run `flutter run` I get: ``` Warning! This package refere...

11 Jun at 16:0

Unable to resolve service for type 'Microsoft.AspNetCore.Identity.UserManager` while attempting to activate 'AuthController'

I'm getting this error in Login Controller. > InvalidOperationException: Unable to resolve service for type 'Microsoft.AspNetCore.Identity.UserManager`1[Automobile.Models.Account]' while attempting t...

HasOne not found in EF 6

I am very new to Entity Framework and I am trying to figure out relations. I have found this code: ``` class MyContext : DbContext { public DbSet<Post> Posts { get; set; } public DbSet<Tag> T...

11 Jun at 08:7

Identity Server 4 and docker

I'm trying to configure IdentityServer4 with docker but I cannot make it work. To get started, I took the Client Credential example of the identity server documentation: [Protecting an API using Clien...

13 Jun at 17:17

How do you change the icon of the `wwwroot` folder in a .NET Core project?

In Visual Studio 2017, when I want to create an ASP.NET Core Web Application from scratch using either one of these standard .NET Core project templates: - - These project templates; obviously woul...

servicestack angular 2 template on mac

is there any way to generate project without visual studio just on mac with rider or vs code? Don't really want to install windows only for creating empty project to try real promising template.

10 Jun at 21:47

How does FirstAsync work?

In my everlasting quest to suck less I'm trying to understand Rx.net's `FirstAsync()` syntax. Most documentation is for the deprecated `First()` If I understand correctly it allows me to start a stre...

7 May at 05:55

Getting "The path to the driver executable must be set by the webdriver.chrome.driver system property"though set correct path

My code is very simple code: ``` WebDriver wd =new ChromeDriver(); System.setProperty("webdriver.chrome.driver", "D:\\List_of_Jar\\chromedriver.exe"); String baseUrl ...

ServiceStack OrmLite: JSON fild deserialization Issue

I have a table in MySql: ``` CREATE TABLE db.catalog ( id varchar(36) NOT NULL, pictures json DEFAULT NULL ) ``` and declaration form code ``` public class catalog { public stri...

How to prevent Gremlin injection in C#?

When user enters data in a text box, many possibilities of SQL Injection are observed. To prevent this, many methods are available to have placeholders in the SQL query, which are replaced in the next...

ServiceStack Caching No Ceremony Razor

I have a simple website that is using the no ceremony razor views mostly for handling the layouts of a bunch of static pages. This is on an azure web app. The pages seem to load a little slower than...

10 Jun at 05:15

Better way to disable console inside unit tests

I wonder if there is a better way to disable console errors inside a Jest test (i.e. restore the original console before/after each test). Here is my current approach: ``` describe("Some description"...

25 Sep at 18:18

Bootstrap 4: Multilevel Dropdown Inside Navigation

What's the easiest way to make a multilevel dropdown in Bootstrap 4? All the examples I managed to find on SO were either too messy or not included in nav. I've tried just placing a dropdown inside a...

ASP.NET Core DbContext injection

I have a `ConfigurationDbContext` that I am trying to use. It has multiple parameters, `DbContextOptions` and `ConfigurationStoreOptions`. How can I add this DbContext to my services in ASP.NET Core...

Inject Service Reference into .NET with AppSettings.json and Startup.cs

My project is not finding the service reference endpoint in runtime. I believe it's due to incorrect injection in my Startup.cs. I'm new to the appsettings.json and Startup.cs method of configuration ...

12 Jun at 18:40

Xamarin Forms Icons

I'm wondering how I can implement icons inside my Xamarin Forms app. I want to use something like glyphicons or font awesome. However, I have no idea how to implement it into my xaml/c# pages. Ideall...

How do I set the ServiceStack ResponseStatus StatusCode?

I have developed a custom exception which I throw from my ServiceStack service. The status code and description are mapped correctly, but the inner 'statusCode' value always appears to be '0'. Here i...

ServiceStack.OrmLite.Sqlite.Core Can't Load Proper Sqlite DLL

I'll keep this short and sweet... OS: Windows 7 x64 Latest Updates IDE: Visual Studio 2017 15.2 Framework: .Net Core 1.1 / Standard 1.3 Steps to reproduce: 1) File -> New Project (.Net Core Consol...

How to debug code in NuGet package created by me

I have a NuGet package I created and installed in another solution but now I need to debug the code of the package when called from my new solution. I tried referencing the solution of the package but...

9 Oct at 02:10

How to Find All Controller and Action

How to find all controllers and actions with its attribute in dotnet core? In .NET Framework I used this code: ``` public static List<string> GetControllerNames() { List<string> controllerNames ...

9 Jun at 12:6