sl8er
sl8er
Explore posts from servers
CC#
Created by sl8er on 1/9/2025 in #help
Overriding appsettings.json section with environment variable
Or just subkeys.
25 replies
CC#
Created by sl8er on 1/9/2025 in #help
Overriding appsettings.json section with environment variable
It's not such a novel idea. Other frameworks support this, like Spring. You can override the whole application config with a JSON-inline env variable SPRING_APPLICATION_JSON.
25 replies
CC#
Created by sl8er on 1/9/2025 in #help
Overriding appsettings.json section with environment variable
It's a Kubernetes secret injected into the environment.
25 replies
CC#
Created by sl8er on 1/9/2025 in #help
Overriding appsettings.json section with environment variable
Maybe it can be suggested as a potential improvement.
25 replies
CC#
Created by sl8er on 1/9/2025 in #help
Overriding appsettings.json section with environment variable
I really feared it wouldn't be supported. Doing export Tenants__ByCode__11__Name=acme for the huge actual structure I'm dealing with is really crazy.
25 replies
CC#
Created by sl8er on 1/9/2025 in #help
Overriding appsettings.json section with environment variable
Like instead of doing export Position='{ "Title": "Environment_Editor", "Name": "Environment_Rick" }'
25 replies
CC#
Created by sl8er on 1/9/2025 in #help
Overriding appsettings.json section with environment variable
Even the documentation on this seems to only mention cases where fields in a JSON object are set independently, rather than setting the whole object via a JSON string. https://learn.microsoft.com/en-us/aspnet/core/fundamentals/configuration/?view=aspnetcore-9.0#evcp
set Position__Title=Environment_Editor
set Position__Name=Environment_Rick
set Position__Title=Environment_Editor
set Position__Name=Environment_Rick
25 replies
CC#
Created by sl8er on 1/9/2025 in #help
Overriding appsettings.json section with environment variable
It does return the data I want, it's just that it doesn't bind to the options object.
25 replies
CC#
Created by sl8er on 1/9/2025 in #help
Overriding appsettings.json section with environment variable
I'm setting an env variable externally before running the app, like I mentioned: export Tenants='{"ByCode": {"11": {"Name": "acme"}, "42": {"Name": "silver"}}}'
25 replies
CC#
Created by sl8er on 1/9/2025 in #help
Overriding appsettings.json section with environment variable
How's that?
25 replies
CC#
Created by sl8er on 5/27/2023 in #help
EF Core Many-to-One (Many Owned Entity to Non-owned Entity)
I don't really need an identifier for Address. It should have value object semantics. With it being owned, I can hide the fact that there still is an address_id being generated in the underlying table (as required by the One-to-Many relationship between Customer and Address. Otherwise I'd have to specify AddressId in Address?
6 replies
CC#
Created by sl8er on 5/27/2023 in #help
EF Core Many-to-One (Many Owned Entity to Non-owned Entity)
Well, I guess I do? I don't need to access Address outside the context of a Customer.
6 replies