I am facing an issue while giving the connectionstring to get it connect to PostgreSQL through the AddDbContext()
method in ConfigureServices method of Startup.cs
I'm getting this error while calling the function options.UseNpgsql()
(see the image below).
I have seen other questions regarding this but those are for usesqlserver()
and also they did not solve my problem.
Two things to check:
Are you missing the correct import. The UseNpgsql()
extension method is in the Microsoft.EntityFrameworkCore
namespace which means you should have this line:
using Microsoft.EntityFrameworkCore;