Can I use Microsoft.AspNet.Identity on .net core 3.0 - asp.net-mvc

I'm working on porting an ASP.NET MVC application to an ASP.NET Core MVC hosted in .NET Core.
I was excited to see that EF 6.3 can host on .NET Core, since it looks like the EF -> EF Core migration is something that I'd at like to defer (possibly indefinitely).
Looking at Microsoft.AspNet.Identity.* nuget packages, it appears that they don't have dependencies on a particular .NET framework (full or Core) just on Entity Framework 6.1 or greater.
Other than the purist idea that I should just move everything over to core while I'm in the code, is there any reason I can't have an ASP.NET Core MVC application that uses EF 6.3 and Microsoft.AspNet.Identity rather than EF Core and Microsoft.AspNetCore.Identity?
After some experimentation:
It looks like I was wrong and Microsoft.AspNet.Identity.Owin has a dependency on the full .NET framework. So I will revise the question:
Can I use Microsoft.AspNetCore.Identity with Entity Framework 6.3? My key goal here is to avoid biting off the EF -> EF Core migration while getting the rest of my codebase moved to .NET Core.

Related

EntityFramework (database first) using Azure managed identity for SQL DB

I'm in the process of converting the existing .Net framework project that uses EF 6 with Database First approach (EDMX) file to .Net Standard 2.1 which connects to SQLDB hosted on Azure.
Existing EDMX file has a constructor (auto generated) that accepts ConnectionString as given below -
public TestDatabaseConnection()
: base(ConfigurationManager.ConnectionStrings["TestDatabaseConnection"].ConnectionString)
{
}
This is breaking for two reasons -
ConfigurationManager.ConnectionStrings works only in .Net framework projects and throw runtime errors in the .Net Core project (for eg- ConfigurationManager.ConnectionStrings returns null).
I need to make changes to the above code to use the AppAuthentication nuget as mentioned in the MSDN docs here
So, what are the options available in order to make this work so that I could use the same nuget package for connecting to the database via EF 6 (database first) for both .net framework and .net core projects?
Is the only available is to convert to Code first and make the necessary changes as mentioned in the above MSDN link?

Migrate from Using ninject in .Net Classic to .Net Core

I'm decided to migrate from .Net classic web api project to .Net core project. Many developers say to me for migration you don't have any concern about code changes, because .net core support package for Ninject, but I don't see any operational example. Please tell me exactly could I use my old api controller from .net classic project in .net core project using Ninject?
ASP.NET core comes with completly new web framework. Regarding your existing controllers from classic web api framework, you can do the following:
rewrite them to fit the new framework
or use Microsoft.AspNetCore.Mvc.WebApiCompatShim, so you can reuse them
Here is the article describing this topic:
https://learn.microsoft.com/en-us/aspnet/core/migration/webapi?view=aspnetcore-2.2
What you don't have to rewrite are dependencies that can be ported to .nestandard. This is also the case of Ninject, because it already supports .nestandard, so if you've already written any Ninject modules you can use them. But the integration with the ASP.NET core looks different, beacause the framework is different. As already commented this link shows the integration:
How to integrate Ninject into ASP.NET Core 2.0 Web applications?

.Net Core Vs .Net framework to create a new mvc web application

I have visual studio 2015 professional editton, and i want to create my first MVC web application which should be a .net core. now i am watching an online learning demo, which mentioned to create this project:-
while inside my visual studio i have these options:-
so which option i need to chose?
second question, how i can be sure that i am using the latest version of MVC?
Thanks
First, there is no such thing as MVC 6. It's ASP.NET Core. Second, the decision of whether to use .NET Core or .NET Framework comes down to what you need to do. .NET Core is cross-platform (Windows, Mac and Linux), whereas .NET Framework is Windows-only. .NET Core is also lighter weight, faster, and has a number of new CLR features, compared to .NET Framework. Virtually the only reason to use .NET Framework is if you have a dependency on something that utilizes Windows-specific APIs, meaning it can't be run cross-platform. Otherwise, you should always use .NET Core, if you can get away with it.
ASP.NET Core is really just a collection of NuGet packages, and like other NuGet packages, they can be updated easily. However, the difference is that these NuGet packages are generally tied to a particular version of .NET Core, and thus, the appropriate version of the packages are installed based on which version of .NET Core you're targeting. For example, if you're targeting netcoreapp2.2 then you'll see that that packages like Microsoft.AspNetCore.App will be brought in with versions like 2.2.x.
So, to answer your question about staying up to date, it essentially entails installing the latest version of the .NET Core SDK, and then changing your project to target that new version. Then, all the ASP.NET Core NuGet packages will naturally update accordingly.

Entity Framework vs Nhibernate

I am using Nhibernate from about 3 years.Currently Microsoft published Asp.net Identity 2 sample using EntityFramework.But I can't customize Asp.net Identity sample with Nhibernate 4.For this reason i can't get any data by userid.So Which one i should use for my project Nhibernate or Entity Framework 6
I ran across this today. Looks like NHibernate has published a ASP.NET Identity Provider here.
You can also pull down the NuGet package here.

ASP.NET-5 with EF6

Is it possible to use the new ASP.NET with Entity Framework 6 instead of Entity Framework v7?
I use the latest Visual Studio 2015 and could not add a Ado.Net Data Model but the Reference to EF6 was added.
Most existing packages, such as EF6, will not support asp.net Core 5; because of the significant differences, they need to be manually updated. If you're wanting to use EF6 you'll need to stick to asp.net 5 (not Core).
I've run into a series of issues running the EF6 package manager commands, such as Add-Migration, in VS2015 CTP6; I believe they're still working on updates. I was able to get them working in a .Net 4.5 library that is referenced by my .Net 5 libraries, but I've found that occasionally I have to uninstall and install EF6 again to get the package manager commands working.

Resources