Add a safe point to override max lengths for existing properties.

pull/4500/head
Halil İbrahim Kalkan 5 years ago
parent 58cb055a99
commit b273d1944c

@ -26,6 +26,11 @@ namespace MyCompanyName.MyProjectName
)]
public class MyProjectNameDomainSharedModule : AbpModule
{
public override void PreConfigureServices(ServiceConfigurationContext context)
{
MyProjectNameModulePropertyConfigurator.Configure();
}
public override void ConfigureServices(ServiceConfigurationContext context)
{
Configure<AbpVirtualFileSystemOptions>(options =>

@ -0,0 +1,35 @@
using System.ComponentModel.DataAnnotations;
using Volo.Abp.Identity;
using Volo.Abp.ObjectExtending;
using Volo.Abp.Threading;
namespace MyCompanyName.MyProjectName
{
public static class MyProjectNameModulePropertyConfigurator
{
private static readonly OneTimeRunner OneTimeRunner = new OneTimeRunner();
public static void Configure()
{
OneTimeRunner.Run(() =>
{
ConfigureExistingProperties();
});
}
private static void ConfigureExistingProperties()
{
/* You can change max lengths for properties of the
* entities defined in the modules used by your application.
*
* Example: Change user and role name max lengths
IdentityUserConsts.MaxNameLength = 99;
IdentityRoleConsts.MaxNameLength = 99;
* Notice: It is not suggested to change property lengths
* unless you really need it. Go with the standard values wherever possible.
*/
}
}
}

@ -10,6 +10,8 @@ namespace MyCompanyName.MyProjectName.EntityFrameworkCore
public static void Configure()
{
MyProjectNameModulePropertyConfigurator.Configure();
OneTimeRunner.Run(() =>
{
/* You can configure entity extension properties for the

Loading…
Cancel
Save