aDeveloper
aDeveloper

Reputation: 11

Installing EF to .NET core library project

I am new to .NET core. Trying to get used to it. But its kind of complicated.

I have my poco classes in 'solution.Entity' library project and I want to use them to create a database with EF code first in my 'solution.Data' library project.

But when I try to install Entity Framework via Nuget to my 'solution.Data' project it says 'Package Restore Failed. Rolling back...'

Both projects are .NET Core Library projects.

What do I need to do to be able to use EF in .NET core library projects? It's look like I need some kind of configuration.

Thanks for helps.

Upvotes: 1

Views: 486

Answers (2)

natemcmaster
natemcmaster

Reputation: 26773

There are lots of pieces to getting Entity Framework Core working right. I highly recommend taking a look at the docs. There are dozens of samples that show how to setup a project.

https://github.com/aspnet/EntityFramework.Docs

http://learn.microsoft.com/ef/

In particular, I suggest this guide. It will talk you how to take your POCO classes and make a database in a .NET Core project. You will likely find it easiest to keep.everything in one project for now and move code into separate libraries once you get more familiar with EF.

Upvotes: 0

TvanB
TvanB

Reputation: 112

Make sure you're installing EF Core. .NET Core has it's own implementation of Entity Framework.

This should be the NuGet package you're installing.

Upvotes: 2

Related Questions