How should I inject a DbContext instance into an IHostedService?
Cannot consume scoped service ‘Microsoft.EntityFrameworkCore.DbContextOptions’ from singleton ‘Microsoft.Extensions.Hosting.IHostedService’.
Cannot consume scoped service ‘Microsoft.EntityFrameworkCore.DbContextOptions’ from singleton ‘Microsoft.Extensions.Hosting.IHostedService’.
I have this line in some code I want to copy into my controller, but the compiler complains that
I am given an absolute URI that contains a query string. I’m looking to safely append a value to the query string, and change an existing parameter.
I am working on a web app that needs to integrate with an existing user database. I would still like to use the [Authorize] attributes, but I don’t want to use the Identity framework. If I did want to use the Identity framework I would add something like this in the startup.cs file:
I’ve deployed my c#, asp.net 5, mvc 6 app to a windows 2008 server. I’ve fired up dnx web and it is listening to port 5000 and works fine when accessing from local computer.
I am hosting a asp.net 5 application on azure, the code is complied for beta8, the application runs fine on the local environment and when i publish the code on the azure site. i get a common error “The specified CGI application encountered an error and the server terminated the process.”
I created the Wep API in ASP.Net core to return the PDF. Here is my code:
In Web API 2, you used to be able to create an endpoint to issue a token by setting up an OAuth Authorization Server via middleware like below:
I am using the ASP.NET Core default website template and have the authentication selected as “Individual User Accounts”. How can I create roles and assign it to users so that I can use the roles in a controller to filter access?
I’m trying to understand the proper way to do authentication in ASP.NET Core. I’ve looked at several Resource (Most of which are out dated).