Top "Asp.net-core-mvc" questions

ASP.

ASP.NET Core Dependency Injection error: Unable to resolve service for type while attempting to activate

I created an .NET Core MVC application and use Dependency Injection and Repository Pattern to inject a repository to my …

c# dependency-injection asp.net-core asp.net-core-mvc
Getting value from appsettings.json in .net core

Not sure what am I missing here but I am not able to get the values from my appsettings.json …

c# asp.net-core configuration asp.net-core-mvc appsettings
How do you create a custom AuthorizeAttribute in ASP.NET Core?

I'm trying to make a custom authorization attribute in ASP.NET Core. In previous versions it was possible to override …

c# asp.net authorization asp.net-core asp.net-core-mvc
Resolving instances with ASP.NET Core DI from within ConfigureServices

How do I manually resolve a type using the ASP.NET Core MVC built-in dependency injection framework? Setting up the …

c# dependency-injection asp.net-core asp.net-core-mvc
How to get the current logged in user Id in ASP.NET Core

I've done this before with MVC5 using User.Identity.GetUserId() but that doesn't seem to work here. The User.Identity …

asp.net asp.net-identity asp.net-core-mvc asp.net-core-1.0
Select Tag Helper in ASP.NET Core MVC

I need some help with the select tag helper in ASP.NET Core. I have a list of employees that …

c# asp.net-core asp.net-core-mvc tag-helpers
How to return HTTP 500 from ASP.NET Core RC2 Web Api?

Back in RC1, I would do this: [HttpPost] public IActionResult Post([FromBody]string something) { try{ // ... } catch(Exception e) { return new …

c# asp.net-core asp.net-core-mvc
How to register multiple implementations of the same interface in Asp.Net Core?

I have services that are derived from the same interface. public interface IService { } public class ServiceA : IService { } public class ServiceB : …

c# asp.net-core asp.net-core-mvc coreclr
How to return a specific status code and no contents from Controller?

I want the example controller below to return a status code 418 with no contents. Setting the status code is easy …

c# asp.net-core asp.net-core-mvc asp.net-core-webapi
How do I get client IP address in ASP.NET CORE?

Can you please let me know how to get client IP address in ASP.NET when using MVC 6. Request.ServerVariables["…

c# asp.net-core asp.net-core-mvc