I have a custom AppSettingProvider as the code below:
public class PortalSettingProvider : SettingProvider
{
private readonly IConfigurationRoot _appConfiguration;
public IdeasSettingProvider(IAppConfigurationAccessor configurationAccessor)
{
_appConfiguration = configurationAccessor.Configuration;
}
public override IEnumerable<SettingDefinition> GetSettingDefinitions(SettingDefinitionProviderContext context)
{
return GetDemographicPersonalInfoSettings().Union(GetDemographicOtherSettings())
.Union(GetPaymentSettings())
}
....................
private IEnumerable<SettingDefinition> GetPaymentSettings()
{
var paymentSettingsGroup = new SettingDefinitionGroup("Ideas.PatientPortal.Payment", L("PaymentSettings"));
return new[] {
new SettingDefinition(PatientPortalSettings.Payment.StripePublicKey,
"", scopes: SettingScopes.Tenant, isVisibleToClients: true, group: paymentSettingsGroup),
new SettingDefinition(PatientPortalSettings.Payment.StripePrivateKey,
"", scopes: SettingScopes.Tenant, isVisibleToClients: false, group: paymentSettingsGroup),
new SettingDefinition(PatientPortalSettings.Payment.PaymentCurrency,
"", scopes: SettingScopes.Tenant, isVisibleToClients: true, group: paymentSettingsGroup),
new SettingDefinition(PatientPortalSettings.Payment.CultureInfo,
"", scopes: SettingScopes.Tenant, isVisibleToClients: true, group: paymentSettingsGroup),
};
}
.............................
I add then custom provider to the Framework like this:
........
//Adding setting providers
Configuration.Settings.Providers.Add<AppSettingProvider>();
Configuration.Settings.Providers.Add<PortalSettingProvider>();
........
I don't want my Payment.StripePrivateKey expose to client, so I set the isVisibleToClients to false, however I still get this value in API call.
What I should do to hide the sensitive info from unauthorized user?
nvm i got it. It seems like i missed the Module.cs file
Hi, I started to move my existing project to newer framework (V.8.8). But when i tried to create a new project under the solution and move my existing cs files in it, the Apis are missing from the Swagger. Any steps that I have missed? Thanks
Hi, I was trying to create a new metronic theme for my project. Then i found the repo https://github.com/aspnetzero/metronic, which I use to generate the bundle.css files by using the MetronicThemeChanger.exe. But after the bundle.css have been generated, it seems that the css classes does not match(a lot of css classes start with kt are missing) and a lot of differences between the generated one and the one existed in the project(ex. default theme's bundle.css file). Any suggestion on this?
Thanks
Hi,
Hi,
Recently we tried to optimize the angular project by using a chrome plugin called Light house report. One of the suggestion they provided is to preload key requests, which leads us to the following website route preloading in angular.
What the website suggests is that we can use preloading strategy that is provided by the base angular, and also quick link loading stratergy provided by a third party library as well.
import { RouterModule, PreloadAllModules } from '@angular/router';
// …
RouterModule.forRoot([
…
], {
preloadingStrategy: PreloadAllModules
})
// …
However, when we try to implement this to our root-routing.module.ts file, the project can not start properly and the browser stuck. Any suggestion on this? Thanks
Hi,
Yes you are right and the background job is a class.
I try to use IDBContextPorvider and the contructor does create succesfully by passing mockMyDbContextProvider.Object.GetDbContext() as the parameter. Now i am confused how to actually create fake datas inside the dbcontext and pass it down the road?
var mockMyDbContext = new Mock<MyDbContext>();
List<Tenant> tenants = GetTenants();
var mockTenantsSet = new Mock<DbSet<Tenant>>();
mockMyDbContext.Setup(m => m.Tenants).Returns(GetQueryableMockDbSet<Tenant>(tenants));
List<Role> roles = GetRoles();
var mockRolesSet = new Mock<DbSet<Role>>();
mockMyDbContext.Setup(m => m.Roles).Returns(GetQueryableMockDbSet<Role>(roles));
return mockMyDbContext;
I used the above code to generate the fake data in my mockdbcontext and i am kind of confused how to combine it with the idbcontextprovider and pass it to the method that i want to test?
Thanks
Hi,
Currently we have a migration service in our project, which is a recurring job, and what it does is keep track of of some dbsets in dbcontext A and try to update some dbsets in another dbcontext B. Right now we want to write unit test for this migration service but kind of stuck. Here is our issues:
Any suggestion on how i need to change my unit test or even the original service?
Thanks
Thanks, searching for solution for a long time and finally your answer appears :)
Thanks. There is one more question, we want to change the theme base on the user roles. So there are two roles in the system and each of them will have their own theme. Any suggestions on how to implement that?