I have ASP.NET Core created using MVC template with individual authentication.
In ASP.NET Core 1.1 ApplicationDbContext was used for identity.
Then in Core 2 Preview they added IdentityService instead, so I modified my project to use it.
But now after Core 2 Release I see they returned back to use ApplicationDbContext, how it was in Core 1.1.
So when I open project I get a lot of errors:
Should I install some Nuget? But I see only version 1.0 Preview for IdentityService:
Maybe I should return back and use ApplicationDbContext for identity instead?
UPDATE: Just found on GitHub: ASP.NET Core Identity as a service
Related
I am using Refit current stable version in .Net Core 3.1 application and want to call an API from MVC application with IFormFile property in request model. I have added Multipart attribute at endpoint declaration. I don't want to replace IFormFile with anything else as I have used this across entire project.
Any solution for this please?
The Unity DI Container has an extension for ASP.NET MVC (based on the older .NET Framework) that includes PerRequestLifetimeManager. This allows you to have one instance of an object that has the lifetime of one http request.
I am building an ASPNET Core MVC project and would like to use Unity, but there does not seem to be an equivalent to the PerRequestLifetimeManager in the Unity.Microsoft.DependencyInjection extension. Is anyone aware if such a thing exists?
I have a ASP.NET Core MVC Application that uses EntityFramework Core and Identity.
So far I have only 2 Connection Strings in Appsettings.json .
Context for Models and Context for Identity.
I would like to have a Database Connection string for each user group.
Does anybody have experience with Orchard Core Framework? It was linked on the Microsoft Documentation, because multi Tenant Database for each User is not supported by Identity.
Can anybody tell me if it is difficult to migrate an existing Project to this Framework?
I also read about Multi Tanent App on a blog form Gunnar Pipemann. This approach would be an alternative for me.
Maybe some of you have developed a similiar App with Asp.net Core MVC and can share their approach.
I am trying to use SharpPDF with Asp.net core 2.2, I have "Install-Package HtmlRenderer.PdfSharp -Version 1.5.0.6", but when I try to access that page within my application that uses SharpPDF I get "Could not load file or assembly 'HtmlRenderer, Version=1.5.0.6" is this because SharpPDF does not support core?
I'm currently developing an ASP.NET 5 Web-API application with VS2015 Ultimate Preview. Some things have changed about configuring EF7 on this new platform.
I've already checked the help in this page: https://github.com/aspnet/EntityFramework/wiki but it doesn't show all the step needed to successfully complete a connection with EF7 (it shows only a partial answer)
Can anyone bring a step-by-step tutorial on how would be the correct way to connect to a database (SQL Server) using EF7?. (not using old syntax like in MusicStore sample app but using more recent syntax)
The code should be the same as you linked in the sample app. You register the context in Startup.cs, within ConfigureServices method using the following code:
public void ConfigureServices(IServiceCollection services)
{
// Add EF services to the services container.
services
.AddEntityFramework(Configuration)
.AddSqlServer()
.AddDbContext<MyDbContext>(options =>
{
options.UseSqlServer(Configuration.Get("Data:DefaultConnection:ConnectionString"));
});
}
Then your MyDbContext will be available for dependency injection, and in your controllers you can do
public MyController(MyDbContext context)
{
...
}
That's it
The following tutorials helped me :
Introduction to Web API : Part 2 – Integrating with Entity Framework 5 Code First
Generic Repository Pattern with Entity Framework and Web API
Building an ASP.NET MVC4 Application with EF and WebAPI
Entity Framework Code First and ASP.NET Web API
Getting started with ASP.NET 5 MVC 6 Web API & Entity Framework 7
Stephen Walther has an updated Music Store tutorial. It starts here