Top "Asp.net-core-webapi" questions

Questions about ASP.

Mock HttpRequest in ASP.NET Core Controller

I'm building a Web API in ASP.NET Core, and I want to unit test the controllers. I inject an …

c# unit-testing asp.net-core moq asp.net-core-webapi
Version Conflict detected for Microsoft.EntityFrameworkCore.Install

I am getting the following error when adding an asp.net core api to an existing project I am working …

c# .net-core asp.net-core-webapi ef-core-2.1
Accept x-www-form-urlencoded in Web API .Net Core

I have a .Net Core Web API that is returning a 415 Unsupported Media Error when I try to post some …

asp.net-core-2.0 asp.net-core-webapi
MediatR when and why I should use it? vs 2017 webapi

It might have been asked before but I cannot find even in the official site why I should use MediatR …

c# asp.net-core-webapi architectural-patterns
How to do model validation in every method in ASP.NET Core Web API?

I am getting into ASP.NET Core 2.0 with Web API. One of my first methods are my login: /// <summary&…

c# asp.net-core .net-core asp.net-core-webapi modelstate
ASP.NET CORE, Web API: No route matches the supplied values

PLEASE NOTE: This question was asked in 2016. The original answer to this problem was to update the microsoft api versiong …

c# asp.net-mvc-routing .net-core asp.net-core-webapi api-versioning
Using Dependency Injection with .NET Core Class Library (.NET Standard)

I have gone through the link: https://docs.microsoft.com/en-us/aspnet/core/mvc/controllers/dependency-injection and learnt that how …

dependency-injection asp.net-core .net-core asp.net-core-webapi visual-studio-2017
.NET Core UseCors() does not add headers

This would be a duplicate of How does Access-Control-Allow-Origin header work?, but the method there also isn't working for me. …

c# asp.net-core cors asp.net-core-webapi cross-domain-policy
Failed to determine the https port for redirect in Docker

I'm trying to deploy an asp.net-core webapi service which is exposed from 80 port using: docker run --rm -p 80:80 --name …

linux windows docker asp.net-core-webapi
How can I throw an exception in an ASP.NET Core WebAPI controller that returns an object?

In Framework WebAPI 2, I have a controller that looks like this: [Route("create-license/{licenseKey}")] public async Task<LicenseDetails> …

c# asp.net-core-webapi