'NPGSQL with .netCore how to login to schema not just to database

This is my NPGSQL connection string

{
    "ConnectionStrings": {     
        "DataAccessPostgreSqlProvider":  "User ID=damienbod;Password=1234;Host=localhost;Port=5432;Database=damienbod;Pooling=true;"
        }
    }
}

taken from here: https://damienbod.com/2016/01/11/asp-net-5-with-postgresql-and-entity-framework-7/

But I am using schemas under my Postgres database. How to connect to idsrv4 schema?



Solution 1:[1]

You can also specify the search path in the connection string:

{
"ConnectionStrings": {     
    "DataAccessPostgreSqlProvider":  "User ID=damienbod;Password=1234;Host=localhost;Port=5432;Database=damienbod;Pooling=true;SearchPath=your_search_path;"
    }
}

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Manuel Montoya