Base solution for your next web application

Activities of "moetarhini"

<cite>ismcagdas: </cite> Hi,

Can you share your setting definition ?

Hello,

Thank you for your reply,

Here is the line we are adding in the following class:

public class AppSettingProvider : SettingProvider

new SettingDefinition(TimeFormat.TimeFormatSettingName, ConfigurationManager.AppSettings[TimeFormat.TimeFormatSettingName] ?? "12 Hour", scopes: SettingScopes.User)

and here is the full code section:

public class AppSettingProvider : SettingProvider
   {
       public override IEnumerable<SettingDefinition> GetSettingDefinitions(SettingDefinitionProviderContext context)
       {
           var defaultPasswordComplexitySetting = new PasswordComplexitySetting
           {
               MinLength = 6,
               MaxLength = 10,
               UseNumbers = true,
               UseUpperCaseLetters = false,
               UseLowerCaseLetters = true,
               UsePunctuations = false,
           };

           return new[]
                  {
                      //Host settings
                       new SettingDefinition(AppSettings.General.WebSiteRootAddress, "http://localhost:6240/"),
                       new SettingDefinition(AppSettings.TenantManagement.AllowSelfRegistration,ConfigurationManager.AppSettings[AppSettings.TenantManagement.UseCaptchaOnRegistration] ?? "true"),
                       new SettingDefinition(AppSettings.TenantManagement.IsNewRegisteredTenantActiveByDefault,ConfigurationManager.AppSettings[AppSettings.TenantManagement.IsNewRegisteredTenantActiveByDefault] ??"false"),
                       new SettingDefinition(AppSettings.TenantManagement.UseCaptchaOnRegistration,ConfigurationManager.AppSettings[AppSettings.TenantManagement.UseCaptchaOnRegistration] ?? "true"),
                       new SettingDefinition(AppSettings.TenantManagement.DefaultEdition,ConfigurationManager.AppSettings[AppSettings.TenantManagement.DefaultEdition] ?? ""),
                       new SettingDefinition(AppSettings.Security.PasswordComplexity, defaultPasswordComplexitySetting.ToJsonString(),scopes: SettingScopes.Application | SettingScopes.Tenant),

                       //Tenant settings
                       new SettingDefinition(AppSettings.UserManagement.AllowSelfRegistration, ConfigurationManager.AppSettings[AppSettings.UserManagement.UseCaptchaOnRegistration] ?? "true", scopes: SettingScopes.Tenant),
                       new SettingDefinition(AppSettings.UserManagement.IsNewRegisteredUserActiveByDefault, ConfigurationManager.AppSettings[AppSettings.UserManagement.IsNewRegisteredUserActiveByDefault] ?? "false", scopes: SettingScopes.Tenant),
                       new SettingDefinition(AppSettings.UserManagement.UseCaptchaOnRegistration, ConfigurationManager.AppSettings[AppSettings.UserManagement.UseCaptchaOnRegistration] ?? "true", scopes: SettingScopes.Tenant),

                       //User Settings
                       new SettingDefinition(DateFormat.DateFormatSettingName, ConfigurationManager.AppSettings[DateFormat.DateFormatSettingName] ?? "European", scopes: SettingScopes.User),
                       new SettingDefinition(TimeFormat.TimeFormatSettingName, ConfigurationManager.AppSettings[TimeFormat.TimeFormatSettingName] ?? "12 Hour", scopes: SettingScopes.User)
                  };
       }
   }

I have created a new user-related setting and added it to the AppSettingProvider as new SettingDefinition. I am able to save the setting values to the database and retrieve them on the server side, but the JSON object returned from abp.setting.values does not include my custom settings.

Also, the settings seem to be not loaded when I try to access them in the _layout.cshtml, is this the correct behavior? Is there a way to access settings values in the _layout page?

Thank you

<cite>ismcagdas: </cite> Hi,

We haven't got such an error before. It might be because of referencing different versions of same dll in different projects in your solution.

Can you share your custom repository, domain service and app service methods ? So, we can try to catch same exception.

Thank you for your reply, Actually we thought first that this might be due to different DLL versions, yet the problem was resolved by rewriting the Domain and Application service classes following step by step the guide.

Thank you for your help, much appreciated. Moe

Hi,

We are trying to create a project based on ASPNET Zero module, and we need to use Custom Repositories for our Models. We used the built-in DI mechanism to inject this repository in the Domain Service, and then call it in the Application service. However, We are getting this error "Declaration referenced in a method implementation cannot be a final method." in the Castel Windsor library (DynamicProxyGenAssembly2).

Is this a familiar issue faced before? We followed the following link for guidance [http://www.aspnetboilerplate.com/Pages/Documents/Repositories]) Section: Custom Repositories

[http://www.aspnetboilerplate.com/Pages/Documents/EntityFramework-Integration#DocCustomRepositoryMethods])

Thank you Moe

Showing 11 to 14 of 14 entries