Top "Asp.net-core" questions

ASP.

AddTransient, AddScoped and AddSingleton Services Differences

I want to implement dependency injection (DI) in ASP.NET Core. So after adding this code to ConfigureServices method, both …

c# asp.net-core .net-core
How to read AppSettings values from a .json file in ASP.NET Core

I have set up my AppSettings data in file appsettings/Config .json like this: { "AppSettings": { "token": "1234" } } I have searched online …

c# asp.net-core .net-core configuration app-config
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
ASP.NET Core return JSON with status code

I'm looking for the correct way to return JSON with a HTTP status code in my .NET Core Web API …

c# json asp.net-core asp.net-core-webapi
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 to pass multiple parameters to a get method in ASP.NET Core

How can I pass in multiple parameters to Get methods in an MVC 6 controller. For example I want to be …

c# asp.net-core asp.net-core-routing
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 determine if .NET Core is installed

I know that for older versions of .NET, you can determine if a given version is installed by following https://…

c# asp.net-core .net-core
How to get HttpContext.Current in ASP.NET Core?

We are currently rewriting/converting our ASP.NET WebForms application using ASP.NET Core. Trying to avoid re-engineering as much …

c# asp.net-core .net-core