How to I access the DbContext of EF core from another project when used in ASP.NET core?
问题 I followed the pattern to use EF Core with ASP.NET core and all is well. But recently I created a 'Calculation' project and want to make database calls from it. The problem is I don't know how to create a new DbContextOptions . In my code that is done with services.AddDbContext<RetContext>(options => options .UseLazyLoadingProxies() .UseSqlServer(Configuration.GetConnectionString("DefaultConnection"))); But in a new .NET core class I need to provide it manually. How do I do this ? My code is