Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Enhancement] Configuration Api to act like aspsettings.json #90

Closed
davidbuckleyni opened this issue May 22, 2020 · 4 comments
Closed

Comments

@davidbuckleyni
Copy link

davidbuckleyni commented May 22, 2020

Summary

In Xamarin Forms we had to relied on Xamarin essentials plugin for settings , moving forward with MAUI it would be nice if MAUI had the same approach as asp.net for example.

The settings file would be able to be transformed at time of publish base on the configuration manger public setting i.e Debug Or release. Their should be two json files created in the tooling.

Eg.
appsettings.json
appsettings.Development.json

Platforms Affected

ALL
IOS
ANDRIOD
MAC
ASP.NET
LINUX
TIZEN
WATCHOS

Access one can then access the config value from the file using the following. The system should be smart enough to no that the user is either in Debug Or Release Build.

Access to values can be as simple as

var test = Configuration.GetConnectionString("DefaultConnection");

But Could also have.

 bool test = Configuration.GetConnectionString("DefaultConnection").ToBollean();
 int32  test = Configuration.GetConnectionString("DefaultConnection").ToInt32();

API Changes

This should use the existing asp.net core configuration code where possible.
e.g.

{
"ConnectionStrings": {
"DefaultConnection": "Server=ServerBame;Database=DatabaseName;User Id=DB_5976_fitnessbud_user;Password=MyPassword;Trusted_Connection=True;MultipleActiveResultSets=true"

},
"JwtToken": {
"SecretKey": "mysecret should allow the value to be stored in a key chain",
"LiveIssuer": "http://api-url.net",
"expirationInMinutes": "2"
},
"EmailSettings": {
"MailServer": "mailserver name",
"MailPort": 25,
"SenderName": "",
"Sender": "",
"Password": ""
},

"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
},
"AllowedHosts": "*"
}

@IeuanWalker
Copy link

#24

@davidbuckleyni
Copy link
Author

#24

They are link but urs doesn’t super seed this configuration in relation to settings is different.

@IeuanWalker
Copy link

@davidbuckleyni ye, just wanted to make sure if they start working on the other issue, they keep this one in mind at the same time.

@PureWeen
Copy link
Member

#24

lytico referenced this issue in lytico/maui Aug 19, 2021
Add some better navigation handlers for blazor
@ghost ghost locked as resolved and limited conversation to collaborators Feb 19, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants