Hi,
Someone know where I can find any guide about how develop a Class Library Project with Entity Framework Core for .NET Core 2.0 or higger?
The problem is that when we develop an asp.net core mvc application, we add the context to the IServiceCollection on the ConfigureServices method. But on a Class Library Proyect we does not have a Startup.cs class to configure it, and so I don't know how approach that.
On a MVC application, Microsoft guides us to make that as following code, but, How can we make it on a Class Library without that class (startup.cs)?
public void ConfigureServices(IServiceCollection services)
{
services.AddDbContext<SchoolContext>(options =>options.UseSqlServer(Configuration.GetConnectionString("DefaultConnection")));
}
Thanks a lot,
Regards!!!