Goal:
Use EF 6 inside of ASP.net core 3 by using a project named ef.
Project EF is the main connection to the database sql server.
Problem:
I get an error saying 
Error = Unable to evaluate the expression. Operation not supported. Unknown error: 0x80070057.
What part am I missing from the code in order retrieve the data in asp.net core 3.
public IActionResult Index()
{
    var ddf = _context.Blogs;
    return View();
}
Info:
*Uploaded the project at github (https://github.com/candyboyyy/WebApplication1_asp.netcore3)
CREATE TABLE [dbo].[Blogs]
(
    [BlogId] [INT] IDENTITY(1,1) NOT NULL,
    [Name] [NVARCHAR](200) NULL,
    [Url] [NVARCHAR](200) NULL,
    CONSTRAINT [PK_dbo.Blogs] 
        PRIMARY KEY CLUSTERED ([BlogId] ASC)
                    WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, 
                          IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, 
                          ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
I would suggest try to establish a database connection first from your web project to your database.  In your Startup.cs class, add this line of code var connectionString = Configuration.GetConnectionString("DefaultConnection"); under ConfigureServices.cs class.  Then add services.AddDbContext to  configure your EF and add services to the container. 
Code snippet below.
using Microsoft.Extensions.DependencyInjection;
     public void ConfigureServices(IServiceCollection services)
            {
                services.AddControllersWithViews();
                var connectionString = Configuration.GetConnectionString("DefaultConnection");
    services.AddDbContext<BloggingContext>(options =>
                    options.UseSqlServer(connectionString), ServiceLifetime.Transient);
            }
Hope that helps.
User contributions licensed under CC BY-SA 3.0