I have a connection string which uses username and password. However, the credentials are stored as environment variables (I'm using OpenShift), so I would like to add the credentials (username and password) from the code, at runtime.
While I could probably achieve this using reg-ex, or some other creative ideas, it just seems like something that would be supported by default in C#. I found this answer in another post, suggesting to use an EntityConnectionStringBuilder
, but this only works for .NET Framework (I'm using .NET Core 3.1). Is there anything similar for .NET Core (or maybe even smarter)?
Also I am using Entity Framework Core, so anything that modifies the connection itself, and not the connection string, is not really an option.