D
D
Denis Kharchenko2016-08-11 10:28:28
C++ / C#
Denis Kharchenko, 2016-08-11 10:28:28

How to register DbContext in EntityFrameworkCore in Autofac?

Good afternoon, colleagues.
Tell me how to register DbContext in EntityFrameworkCore?
Test project - TestCore
Error: Cannot resolve parameter 'Microsoft.EntityFrameworkCore.DbContext context' (passed parameters, still didn't help)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Denis Kharchenko, 2016-08-11
@itprodavets

protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
        {
            var connectionString = "Data Source=localhost;Initial Catalog=TestCore;Integrated Security=true";
            optionsBuilder.UseSqlServer(connectionString);
            base.OnConfiguring(optionsBuilder);
        }

So far I haven't found any solutions. If anyone knows a better solution, please write here or me personally.
Thank you.
The finished project is here .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question