kaziux
kaziux
Explore posts from servers
CC#
Created by kaziux on 3/15/2023 in #help
❔ How optimize this code without breaking it and taking DRY into account?
Still I have repeating code.
52 replies
CC#
Created by kaziux on 3/15/2023 in #help
❔ How optimize this code without breaking it and taking DRY into account?
I try with
is null
is null
but still code isn't optimized.
52 replies
CC#
Created by kaziux on 3/15/2023 in #help
❔ How optimize this code without breaking it and taking DRY into account?
Legal Person and Individual are diffrent entity types
52 replies
CC#
Created by kaziux on 1/23/2023 in #help
✅ How to edit and save specific appsettings.json (project root) section?
but if hosting would be the case, I must pretty aware of that.
83 replies
CC#
Created by kaziux on 1/23/2023 in #help
✅ How to edit and save specific appsettings.json (project root) section?
Sorry, but I'm not hosting this project on the free Azure plan
83 replies
CC#
Created by kaziux on 1/23/2023 in #help
✅ How to edit and save specific appsettings.json (project root) section?
Much safer case have custom json with user configurable values
83 replies
CC#
Created by kaziux on 1/23/2023 in #help
✅ How to edit and save specific appsettings.json (project root) section?
If saved in the DB it would be fine but I'm not 100proc sure about some kind of the file
83 replies
CC#
Created by kaziux on 1/23/2023 in #help
✅ How to edit and save specific appsettings.json (project root) section?
It depends if have reload on change or not
83 replies
CC#
Created by kaziux on 1/23/2023 in #help
✅ How to edit and save specific appsettings.json (project root) section?
That is the case I faced prieviously when value is saved on the bin/debug edition of the appsettings.json so the value be 1
83 replies
CC#
Created by kaziux on 1/23/2023 in #help
✅ How to edit and save specific appsettings.json (project root) section?
The case if for some reason you can't save the value sucessfully
83 replies
CC#
Created by kaziux on 1/23/2023 in #help
✅ How to edit and save specific appsettings.json (project root) section?
value is must set configurable runtime
83 replies
CC#
Created by kaziux on 1/23/2023 in #help
✅ How to edit and save specific appsettings.json (project root) section?
because one of requirements make that value editable. So system admin must change value who can be non-tech person
83 replies
CC#
Created by kaziux on 1/23/2023 in #help
✅ How to edit and save specific appsettings.json (project root) section?
But I must have option for user aka admin to set a value
83 replies
CC#
Created by kaziux on 1/23/2023 in #help
✅ How to edit and save specific appsettings.json (project root) section?
public class ConfigService : IConfigService
{
private readonly Configs _configs;

public ConfigService(IOptions<Configs> configs)
{
_configs = configs.Value;
}

public void SetYear(int year)
{

_configs.ConfigurableYear = year;
}
}
public class ConfigService : IConfigService
{
private readonly Configs _configs;

public ConfigService(IOptions<Configs> configs)
{
_configs = configs.Value;
}

public void SetYear(int year)
{

_configs.ConfigurableYear = year;
}
}
Also, I do in this Startup.cs to bind this section
services.Configure<Configs>(options => Configuration.GetSection("ConfigurableYear").Bind(options));
services.Configure<Configs>(options => Configuration.GetSection("ConfigurableYear").Bind(options));
83 replies
CC#
Created by kaziux on 1/23/2023 in #help
✅ How to edit and save specific appsettings.json (project root) section?
inside controller aka endpoint
83 replies
CC#
Created by kaziux on 1/23/2023 in #help
✅ How to edit and save specific appsettings.json (project root) section?
nope, I do just API call.
83 replies
CC#
Created by kaziux on 1/23/2023 in #help
✅ How to edit and save specific appsettings.json (project root) section?
I use on the local env. This is service function which used on the api endpoint
83 replies
CC#
Created by kaziux on 10/10/2022 in #help
GroupBy cannot be translated using
I barely use grouping queries. I forgot that query is for aggregations
22 replies
CC#
Created by kaziux on 10/10/2022 in #help
GroupBy cannot be translated using
I'm only do filtering query. No any agregrations like counting, average or something.
22 replies
CC#
Created by kaziux on 10/10/2022 in #help
GroupBy cannot be translated using
Impossible to use, because month itself is int property
22 replies