diff --git a/modules/audit-logging/src/Volo.Abp.AuditLogging.Domain.Shared/Volo/Abp/AuditLogging/AuditLogActionConsts.cs b/modules/audit-logging/src/Volo.Abp.AuditLogging.Domain.Shared/Volo/Abp/AuditLogging/AuditLogActionConsts.cs
index 86652aacec..5f1967804e 100644
--- a/modules/audit-logging/src/Volo.Abp.AuditLogging.Domain.Shared/Volo/Abp/AuditLogging/AuditLogActionConsts.cs
+++ b/modules/audit-logging/src/Volo.Abp.AuditLogging.Domain.Shared/Volo/Abp/AuditLogging/AuditLogActionConsts.cs
@@ -2,10 +2,19 @@
{
public class AuditLogActionConsts
{
- public const int MaxServiceNameLength = 256;
+ ///
+ /// Default value: 256
+ ///
+ public static int MaxServiceNameLength { get; set; } = 256;
- public const int MaxMethodNameLength = 128;
+ ///
+ /// Default value: 128
+ ///
+ public static int MaxMethodNameLength { get; set; } = 128;
- public const int MaxParametersLength = 2000;
+ ///
+ /// Default value: 2000
+ ///
+ public static int MaxParametersLength { get; set; } = 2000;
}
}
diff --git a/modules/audit-logging/src/Volo.Abp.AuditLogging.Domain.Shared/Volo/Abp/AuditLogging/AuditLogConsts.cs b/modules/audit-logging/src/Volo.Abp.AuditLogging.Domain.Shared/Volo/Abp/AuditLogging/AuditLogConsts.cs
index 504e7451e0..4a8c723b76 100644
--- a/modules/audit-logging/src/Volo.Abp.AuditLogging.Domain.Shared/Volo/Abp/AuditLogging/AuditLogConsts.cs
+++ b/modules/audit-logging/src/Volo.Abp.AuditLogging.Domain.Shared/Volo/Abp/AuditLogging/AuditLogConsts.cs
@@ -2,31 +2,67 @@
{
public static class AuditLogConsts
{
- public const int MaxApplicationNameLength = 96;
+ ///
+ /// Default value: 96
+ ///
+ public static int MaxApplicationNameLength { get; set; } = 96;
- public const int MaxClientIpAddressLength = 64;
+ ///
+ /// Default value: 64
+ ///
+ public static int MaxClientIpAddressLength { get; set; } = 64;
- public const int MaxClientNameLength = 128;
+ ///
+ /// Default value: 128
+ ///
+ public static int MaxClientNameLength { get; set; } = 128;
- public const int MaxClientIdLength = 64;
+ ///
+ /// Default value: 64
+ ///
+ public static int MaxClientIdLength { get; set; } = 64;
- public const int MaxCorrelationIdLength = 64;
+ ///
+ /// Default value: 64
+ ///
+ public static int MaxCorrelationIdLength { get; set; } = 64;
- public const int MaxBrowserInfoLength = 512;
+ ///
+ /// Default value: 512
+ ///
+ public static int MaxBrowserInfoLength { get; set; } = 512;
- public const int MaxExceptionsLength = 4000;
+ ///
+ /// Default value: 4000
+ ///
+ public static int MaxExceptionsLength { get; set; } = 4000;
//TODO: Replace with MaxExceptionsLength in v3.0
public static int MaxExceptionsLengthValue { get; set; } = MaxExceptionsLength;
- public const int MaxCommentsLength = 256;
+ ///
+ /// Default value: 256
+ ///
+ public static int MaxCommentsLength { get; set; } = 256;
- public const int MaxUrlLength = 256;
+ ///
+ /// Default value: 256
+ ///
+ public static int MaxUrlLength { get; set; } = 256;
- public const int MaxHttpMethodLength = 16;
+ ///
+ /// Default value: 16
+ ///
+ public static int MaxHttpMethodLength { get; set; } = 16;
- public const int MaxUserNameLength = 256;
+ ///
+ /// Default value: 256
+ ///
+ public static int MaxUserNameLength { get; set; } = 256;
- public const int MaxTenantNameLength = 64;
+ ///
+ /// Default value: 64
+ ///
+ public static int MaxTenantNameLength { get; set; } = 64;
}
}
diff --git a/modules/audit-logging/src/Volo.Abp.AuditLogging.Domain.Shared/Volo/Abp/AuditLogging/EntityChangeConsts.cs b/modules/audit-logging/src/Volo.Abp.AuditLogging.Domain.Shared/Volo/Abp/AuditLogging/EntityChangeConsts.cs
index d19407cfa4..b7f88db3e2 100644
--- a/modules/audit-logging/src/Volo.Abp.AuditLogging.Domain.Shared/Volo/Abp/AuditLogging/EntityChangeConsts.cs
+++ b/modules/audit-logging/src/Volo.Abp.AuditLogging.Domain.Shared/Volo/Abp/AuditLogging/EntityChangeConsts.cs
@@ -2,8 +2,14 @@
{
public class EntityChangeConsts
{
- public const int MaxEntityTypeFullNameLength = 128;
+ ///
+ /// Default value: 128
+ ///
+ public static int MaxEntityTypeFullNameLength { get; set; } = 128;
- public const int MaxEntityIdLength = 128;
+ ///
+ /// Default value: 128
+ ///
+ public static int MaxEntityIdLength { get; set; } = 128;
}
}
diff --git a/modules/audit-logging/src/Volo.Abp.AuditLogging.Domain.Shared/Volo/Abp/AuditLogging/EntityPropertyChangeConsts.cs b/modules/audit-logging/src/Volo.Abp.AuditLogging.Domain.Shared/Volo/Abp/AuditLogging/EntityPropertyChangeConsts.cs
index 2ac9204395..8d592e06aa 100644
--- a/modules/audit-logging/src/Volo.Abp.AuditLogging.Domain.Shared/Volo/Abp/AuditLogging/EntityPropertyChangeConsts.cs
+++ b/modules/audit-logging/src/Volo.Abp.AuditLogging.Domain.Shared/Volo/Abp/AuditLogging/EntityPropertyChangeConsts.cs
@@ -2,12 +2,24 @@
{
public class EntityPropertyChangeConsts
{
- public const int MaxNewValueLength = 512;
+ ///
+ /// Default value: 512
+ ///
+ public static int MaxNewValueLength { get; set; } = 512;
- public const int MaxOriginalValueLength = 512;
+ ///
+ /// Default value: 512
+ ///
+ public static int MaxOriginalValueLength { get; set; } = 512;
- public const int MaxPropertyNameLength = 128;
+ ///
+ /// Default value: 128
+ ///
+ public static int MaxPropertyNameLength { get; set; } = 128;
- public const int MaxPropertyTypeFullNameLength = 64;
+ ///
+ /// Default value: 64
+ ///
+ public static int MaxPropertyTypeFullNameLength { get; set; } = 64;
}
}
diff --git a/modules/background-jobs/src/Volo.Abp.BackgroundJobs.Domain.Shared/Volo/Abp/BackgroundJobs/BackgroundJobRecordConsts.cs b/modules/background-jobs/src/Volo.Abp.BackgroundJobs.Domain.Shared/Volo/Abp/BackgroundJobs/BackgroundJobRecordConsts.cs
index f4418bc423..01f935b30e 100644
--- a/modules/background-jobs/src/Volo.Abp.BackgroundJobs.Domain.Shared/Volo/Abp/BackgroundJobs/BackgroundJobRecordConsts.cs
+++ b/modules/background-jobs/src/Volo.Abp.BackgroundJobs.Domain.Shared/Volo/Abp/BackgroundJobs/BackgroundJobRecordConsts.cs
@@ -2,8 +2,14 @@
{
public static class BackgroundJobRecordConsts
{
- public const int MaxJobNameLength = 128;
+ ///
+ /// Default value: 128
+ ///
+ public static int MaxJobNameLength { get; set; } = 128;
- public const int MaxJobArgsLength = 1024 * 1024;
+ ///
+ /// Default value: 1024 * 1024
+ ///
+ public static int MaxJobArgsLength { get; set; } = 1024 * 1024;
}
}
diff --git a/modules/blob-storing-database/src/Volo.Abp.BlobStoring.Database.Domain.Shared/Volo/Abp/BlobStoring/Database/DatabaseContainerConsts.cs b/modules/blob-storing-database/src/Volo.Abp.BlobStoring.Database.Domain.Shared/Volo/Abp/BlobStoring/Database/DatabaseContainerConsts.cs
index 0a71451f9f..22d127a1f1 100644
--- a/modules/blob-storing-database/src/Volo.Abp.BlobStoring.Database.Domain.Shared/Volo/Abp/BlobStoring/Database/DatabaseContainerConsts.cs
+++ b/modules/blob-storing-database/src/Volo.Abp.BlobStoring.Database.Domain.Shared/Volo/Abp/BlobStoring/Database/DatabaseContainerConsts.cs
@@ -2,6 +2,9 @@
{
public static class DatabaseContainerConsts
{
- public const int MaxNameLength = 128;
+ ///
+ /// Default value: 128.
+ ///
+ public static int MaxNameLength { get; set; } = 128;
}
}
\ No newline at end of file
diff --git a/modules/blogging/src/Volo.Blogging.Admin.Web/Pages/Blogging/Admin/Blogs/Create.cshtml.cs b/modules/blogging/src/Volo.Blogging.Admin.Web/Pages/Blogging/Admin/Blogs/Create.cshtml.cs
index b2d89fbd55..6f4bae5e63 100644
--- a/modules/blogging/src/Volo.Blogging.Admin.Web/Pages/Blogging/Admin/Blogs/Create.cshtml.cs
+++ b/modules/blogging/src/Volo.Blogging.Admin.Web/Pages/Blogging/Admin/Blogs/Create.cshtml.cs
@@ -2,6 +2,7 @@ using System.ComponentModel.DataAnnotations;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
+using Volo.Abp.Validation;
using Volo.Blogging.Admin.Blogs;
using Volo.Blogging.Blogs;
@@ -44,14 +45,14 @@ namespace Volo.Blogging.Admin.Pages.Blogging.Admin.Blogs
public class BlogCreateModalView
{
[Required]
- [StringLength(BlogConsts.MaxNameLength)]
+ [DynamicStringLength(typeof(BlogConsts), nameof(BlogConsts.MaxNameLength))]
public string Name { get; set; }
[Required]
- [StringLength(BlogConsts.MaxShortNameLength)]
+ [DynamicStringLength(typeof(BlogConsts), nameof(BlogConsts.MaxShortNameLength))]
public string ShortName { get; set; }
- [StringLength(BlogConsts.MaxDescriptionLength)]
+ [DynamicStringLength(typeof(BlogConsts), nameof(BlogConsts.MaxDescriptionLength))]
public string Description { get; set; }
}
diff --git a/modules/blogging/src/Volo.Blogging.Admin.Web/Pages/Blogging/Admin/Blogs/Edit.cshtml.cs b/modules/blogging/src/Volo.Blogging.Admin.Web/Pages/Blogging/Admin/Blogs/Edit.cshtml.cs
index 536810e015..8d0b2ba978 100644
--- a/modules/blogging/src/Volo.Blogging.Admin.Web/Pages/Blogging/Admin/Blogs/Edit.cshtml.cs
+++ b/modules/blogging/src/Volo.Blogging.Admin.Web/Pages/Blogging/Admin/Blogs/Edit.cshtml.cs
@@ -3,6 +3,7 @@ using System.ComponentModel.DataAnnotations;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
+using Volo.Abp.Validation;
using Volo.Blogging.Admin.Blogs;
using Volo.Blogging.Blogs;
@@ -58,14 +59,14 @@ namespace Volo.Blogging.Admin.Pages.Blogging.Admin.Blogs
public Guid Id { get; set; }
[Required]
- [StringLength(BlogConsts.MaxNameLength)]
+ [DynamicStringLength(typeof(BlogConsts), nameof(BlogConsts.MaxNameLength))]
public string Name { get; set; }
[Required]
- [StringLength(BlogConsts.MaxShortNameLength)]
+ [DynamicStringLength(typeof(BlogConsts), nameof(BlogConsts.MaxShortNameLength))]
public string ShortName { get; set; }
- [StringLength(BlogConsts.MaxDescriptionLength)]
+ [DynamicStringLength(typeof(BlogConsts), nameof(BlogConsts.MaxDescriptionLength))]
public string Description { get; set; }
}
}
diff --git a/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/Files/BloggingWebConsts.cs b/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/Files/BloggingWebConsts.cs
index ae4eb32dff..d9eb284ac6 100644
--- a/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/Files/BloggingWebConsts.cs
+++ b/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/Files/BloggingWebConsts.cs
@@ -6,7 +6,10 @@ namespace Volo.Blogging
{
public class FileUploading
{
- public const int MaxFileSize = 5242880; //5MB
+ ///
+ /// Default value: 5242880
+ ///
+ public static int MaxFileSize { get; set; } = 5242880; //5MB
public static int MaxFileSizeAsMegabytes => Convert.ToInt32((MaxFileSize / 1024f) / 1024f);
}
diff --git a/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/Posts/CreatePostDto.cs b/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/Posts/CreatePostDto.cs
index 164e4f691f..96cfbd6859 100644
--- a/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/Posts/CreatePostDto.cs
+++ b/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/Posts/CreatePostDto.cs
@@ -1,5 +1,6 @@
using System;
using System.ComponentModel.DataAnnotations;
+using Volo.Abp.Validation;
namespace Volo.Blogging.Posts
{
@@ -8,22 +9,22 @@ namespace Volo.Blogging.Posts
public Guid BlogId { get; set; }
[Required]
- [StringLength(PostConsts.MaxTitleLength)]
+ [DynamicStringLength(typeof(PostConsts), nameof(PostConsts.MaxTitleLength))]
public string Title { get; set; }
[Required]
public string CoverImage { get; set; }
[Required]
- [StringLength(PostConsts.MaxUrlLength)]
+ [DynamicStringLength(typeof(PostConsts), nameof(PostConsts.MaxUrlLength))]
public string Url { get; set; }
- [StringLength(PostConsts.MaxContentLength)]
+ [DynamicStringLength(typeof(PostConsts), nameof(PostConsts.MaxContentLength))]
public string Content { get; set; }
public string Tags { get; set; }
- [StringLength(PostConsts.MaxDescriptionLength)]
+ [DynamicStringLength(typeof(PostConsts), nameof(PostConsts.MaxDescriptionLength))]
public string Description { get; set; }
}
diff --git a/modules/blogging/src/Volo.Blogging.Domain.Shared/Volo/Blogging/Blogs/BlogConsts.cs b/modules/blogging/src/Volo.Blogging.Domain.Shared/Volo/Blogging/Blogs/BlogConsts.cs
index 502a4364e7..b4b428207c 100644
--- a/modules/blogging/src/Volo.Blogging.Domain.Shared/Volo/Blogging/Blogs/BlogConsts.cs
+++ b/modules/blogging/src/Volo.Blogging.Domain.Shared/Volo/Blogging/Blogs/BlogConsts.cs
@@ -2,10 +2,19 @@
{
public static class BlogConsts
{
- public const int MaxNameLength = 256;
+ ///
+ /// Default value: 256
+ ///
+ public static int MaxNameLength { get; set; } = 256;
- public const int MaxShortNameLength = 32;
+ ///
+ /// Default value: 32
+ ///
+ public static int MaxShortNameLength { get; set; } = 32;
- public const int MaxDescriptionLength = 1024;
+ ///
+ /// Default value: 1024
+ ///
+ public static int MaxDescriptionLength { get; set; } = 1024;
}
}
diff --git a/modules/blogging/src/Volo.Blogging.Domain.Shared/Volo/Blogging/Comments/CommentConsts.cs b/modules/blogging/src/Volo.Blogging.Domain.Shared/Volo/Blogging/Comments/CommentConsts.cs
index 34cc655fb3..359b322cbf 100644
--- a/modules/blogging/src/Volo.Blogging.Domain.Shared/Volo/Blogging/Comments/CommentConsts.cs
+++ b/modules/blogging/src/Volo.Blogging.Domain.Shared/Volo/Blogging/Comments/CommentConsts.cs
@@ -2,6 +2,9 @@
{
public class CommentConsts
{
- public const int MaxTextLength = 1024;
+ ///
+ /// Default value: 1024
+ ///
+ public static int MaxTextLength { get; set; } = 1024;
}
}
diff --git a/modules/blogging/src/Volo.Blogging.Domain.Shared/Volo/Blogging/Posts/PostConsts.cs b/modules/blogging/src/Volo.Blogging.Domain.Shared/Volo/Blogging/Posts/PostConsts.cs
index 665984dfbb..de91caa2d3 100644
--- a/modules/blogging/src/Volo.Blogging.Domain.Shared/Volo/Blogging/Posts/PostConsts.cs
+++ b/modules/blogging/src/Volo.Blogging.Domain.Shared/Volo/Blogging/Posts/PostConsts.cs
@@ -2,16 +2,34 @@
{
public static class PostConsts
{
- public const int MaxTitleLength = 512;
+ ///
+ /// Default value: 512
+ ///
+ public static int MaxTitleLength { get; set; } = 512;
- public const int MaxUrlLength = 64;
+ ///
+ /// Default value: 64
+ ///
+ public static int MaxUrlLength { get; set; } = 64;
- public const int MaxContentLength = 1024 * 1024; //1MB
+ ///
+ /// Default value: 1024 * 1024
+ ///
+ public static int MaxContentLength { get; set; } = 1024 * 1024; //1MB
- public const int MaxDescriptionLength = 1000;
+ ///
+ /// Default value: 1000
+ ///
+ public static int MaxDescriptionLength { get; set; } = 1000;
- public const int MaxTitleLengthToBeSeoFriendly = 60;
+ ///
+ /// Default value: 60
+ ///
+ public static int MaxTitleLengthToBeSeoFriendly { get; set; } = 60;
- public const int MaxSeoFriendlyDescriptionLength = 200;
+ ///
+ /// Default value: 200
+ ///
+ public static int MaxSeoFriendlyDescriptionLength { get; set; } = 200;
}
}
diff --git a/modules/blogging/src/Volo.Blogging.Domain.Shared/Volo/Blogging/Tagging/TagConsts.cs b/modules/blogging/src/Volo.Blogging.Domain.Shared/Volo/Blogging/Tagging/TagConsts.cs
index c75ccd4184..ad2be87ca8 100644
--- a/modules/blogging/src/Volo.Blogging.Domain.Shared/Volo/Blogging/Tagging/TagConsts.cs
+++ b/modules/blogging/src/Volo.Blogging.Domain.Shared/Volo/Blogging/Tagging/TagConsts.cs
@@ -2,8 +2,14 @@
{
public class TagConsts
{
- public const int MaxNameLength = 64;
+ ///
+ /// Default value: 64
+ ///
+ public static int MaxNameLength { get; set; } = 64;
- public const int MaxDescriptionLength = 512;
+ ///
+ /// Default value: 512
+ ///
+ public static int MaxDescriptionLength { get; set; } = 512;
}
}
diff --git a/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/Edit.cshtml.cs b/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/Edit.cshtml.cs
index c2ebcc441b..6d998a7172 100644
--- a/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/Edit.cshtml.cs
+++ b/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/Edit.cshtml.cs
@@ -6,6 +6,7 @@ using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Volo.Abp.AspNetCore.Mvc.UI.RazorPages;
+using Volo.Abp.Validation;
using Volo.Blogging.Blogs;
using Volo.Blogging.Pages.Blogs.Shared.Helpers;
using Volo.Blogging.Posts;
@@ -85,7 +86,7 @@ namespace Volo.Blogging.Pages.Blog.Posts
public Guid BlogId { get; set; }
[Required]
- [StringLength(PostConsts.MaxTitleLength)]
+ [DynamicStringLength(typeof(PostConsts), nameof(PostConsts.MaxTitleLength))]
public string Title { get; set; }
[Required]
@@ -93,14 +94,14 @@ namespace Volo.Blogging.Pages.Blog.Posts
public string CoverImage { get; set; }
[Required]
- [StringLength(PostConsts.MaxUrlLength)]
+ [DynamicStringLength(typeof(PostConsts), nameof(PostConsts.MaxUrlLength))]
public string Url { get; set; }
[HiddenInput]
- [StringLength(PostConsts.MaxContentLength)]
+ [DynamicStringLength(typeof(PostConsts), nameof(PostConsts.MaxContentLength))]
public string Content { get; set; }
- [StringLength(PostConsts.MaxDescriptionLength)]
+ [DynamicStringLength(typeof(PostConsts), nameof(PostConsts.MaxDescriptionLength))]
public string Description { get; set; }
public string Tags { get; set; }
diff --git a/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/New.cshtml.cs b/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/New.cshtml.cs
index 41c8f43ddd..3930a79900 100644
--- a/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/New.cshtml.cs
+++ b/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/New.cshtml.cs
@@ -6,6 +6,7 @@ using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Options;
using Volo.Abp.AspNetCore.Mvc.UI.RazorPages;
+using Volo.Abp.Validation;
using Volo.Blogging.Blogs;
using Volo.Blogging.Blogs.Dtos;
using Volo.Blogging.Pages.Blogs.Shared.Helpers;
@@ -79,7 +80,7 @@ namespace Volo.Blogging.Pages.Blog.Posts
public Guid BlogId { get; set; }
[Required]
- [StringLength(PostConsts.MaxTitleLength)]
+ [DynamicStringLength(typeof(PostConsts), nameof(PostConsts.MaxTitleLength))]
public string Title { get; set; }
[Required]
@@ -87,16 +88,16 @@ namespace Volo.Blogging.Pages.Blog.Posts
public string CoverImage { get; set; }
[Required]
- [StringLength(PostConsts.MaxUrlLength)]
+ [DynamicStringLength(typeof(PostConsts), nameof(PostConsts.MaxUrlLength))]
public string Url { get; set; }
[HiddenInput]
- [StringLength(PostConsts.MaxContentLength)]
+ [DynamicStringLength(typeof(PostConsts), nameof(PostConsts.MaxContentLength))]
public string Content { get; set; }
public string Tags { get; set; }
- [StringLength(PostConsts.MaxDescriptionLength)]
+ [DynamicStringLength(typeof(PostConsts), nameof(PostConsts.MaxDescriptionLength))]
public string Description { get; set; }
}
diff --git a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Documents/GetAllInput.cs b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Documents/GetAllInput.cs
index e375f6ba0b..1512c13da9 100644
--- a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Documents/GetAllInput.cs
+++ b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Documents/GetAllInput.cs
@@ -1,6 +1,7 @@
using System;
using System.ComponentModel.DataAnnotations;
using Volo.Abp.Application.Dtos;
+using Volo.Abp.Validation;
using Volo.Docs.Documents;
namespace Volo.Docs.Admin.Documents
@@ -9,19 +10,19 @@ namespace Volo.Docs.Admin.Documents
{
public Guid? ProjectId { get; set; }
- [StringLength(DocumentConsts.MaxNameLength)]
+ [DynamicStringLength(typeof(DocumentConsts), nameof(DocumentConsts.MaxNameLength))]
public string Name { get; set; }
- [StringLength(DocumentConsts.MaxVersionNameLength)]
+ [DynamicStringLength(typeof(DocumentConsts), nameof(DocumentConsts.MaxVersionNameLength))]
public string Version { get; set; }
- [StringLength(DocumentConsts.MaxLanguageCodeNameLength)]
+ [DynamicStringLength(typeof(DocumentConsts), nameof(DocumentConsts.MaxLanguageCodeNameLength))]
public string LanguageCode { get; set; }
- [StringLength(DocumentConsts.MaxFileNameNameLength)]
+ [DynamicStringLength(typeof(DocumentConsts), nameof(DocumentConsts.MaxFileNameNameLength))]
public string FileName { get; set; }
- [StringLength(DocumentConsts.MaxFormatNameLength)]
+ [DynamicStringLength(typeof(DocumentConsts), nameof(DocumentConsts.MaxFormatNameLength))]
public string Format { get; set; }
public DateTime? CreationTimeMin { get; set; }
diff --git a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Documents/PullAllDocumentInput.cs b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Documents/PullAllDocumentInput.cs
index d796c00e64..c375de8b67 100644
--- a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Documents/PullAllDocumentInput.cs
+++ b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Documents/PullAllDocumentInput.cs
@@ -1,5 +1,6 @@
using System;
using System.ComponentModel.DataAnnotations;
+using Volo.Abp.Validation;
using Volo.Docs.Documents;
namespace Volo.Docs.Admin.Documents
@@ -8,10 +9,10 @@ namespace Volo.Docs.Admin.Documents
{
public Guid ProjectId { get; set; }
- [StringLength(DocumentConsts.MaxLanguageCodeNameLength)]
+ [DynamicStringLength(typeof(DocumentConsts), nameof(DocumentConsts.MaxLanguageCodeNameLength))]
public string LanguageCode { get; set; }
- [StringLength(DocumentConsts.MaxVersionNameLength)]
+ [DynamicStringLength(typeof(DocumentConsts), nameof(DocumentConsts.MaxVersionNameLength))]
public string Version { get; set; }
}
}
\ No newline at end of file
diff --git a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Documents/PullDocumentInput.cs b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Documents/PullDocumentInput.cs
index fcc9816b02..dce5de0420 100644
--- a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Documents/PullDocumentInput.cs
+++ b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Documents/PullDocumentInput.cs
@@ -1,5 +1,6 @@
using System;
using System.ComponentModel.DataAnnotations;
+using Volo.Abp.Validation;
using Volo.Docs.Documents;
namespace Volo.Docs.Admin.Documents
@@ -8,13 +9,13 @@ namespace Volo.Docs.Admin.Documents
{
public Guid ProjectId { get; set; }
- [StringLength(DocumentConsts.MaxNameLength)]
+ [DynamicStringLength(typeof(DocumentConsts), nameof(DocumentConsts.MaxNameLength))]
public string Name { get; set; }
- [StringLength(DocumentConsts.MaxLanguageCodeNameLength)]
+ [DynamicStringLength(typeof(DocumentConsts), nameof(DocumentConsts.MaxLanguageCodeNameLength))]
public string LanguageCode { get; set; }
- [StringLength(DocumentConsts.MaxVersionNameLength)]
+ [DynamicStringLength(typeof(DocumentConsts), nameof(DocumentConsts.MaxVersionNameLength))]
public string Version { get; set; }
}
}
\ No newline at end of file
diff --git a/modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Projects/Create.cshtml.cs b/modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Projects/Create.cshtml.cs
index e6de68a3b1..506b674ba5 100644
--- a/modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Projects/Create.cshtml.cs
+++ b/modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Projects/Create.cshtml.cs
@@ -9,6 +9,7 @@ using Microsoft.AspNetCore.Mvc.Rendering;
using Volo.Abp;
using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Form;
using Volo.Abp.AspNetCore.Mvc.UI.RazorPages;
+using Volo.Abp.Validation;
using Volo.Docs.Admin.Projects;
using Volo.Docs.Projects;
@@ -70,11 +71,11 @@ namespace Volo.Docs.Admin.Pages.Docs.Admin.Projects
public abstract class CreateProjectViewModelBase
{
[Required]
- [StringLength(ProjectConsts.MaxNameLength)]
+ [DynamicStringLength(typeof(ProjectConsts), nameof(ProjectConsts.MaxNameLength))]
public string Name { get; set; }
[Required]
- [StringLength(ProjectConsts.MaxShortNameLength)]
+ [DynamicStringLength(typeof(ProjectConsts), nameof(ProjectConsts.MaxShortNameLength))]
[InputInfoText("ShortNameInfoText")]
public string ShortName { get; set; }
@@ -82,21 +83,21 @@ namespace Volo.Docs.Admin.Pages.Docs.Admin.Projects
[SelectItems(nameof(FormatTypes))]
public string Format { get; set; }
- [StringLength(ProjectConsts.MaxDefaultDocumentNameLength)]
+ [DynamicStringLength(typeof(ProjectConsts), nameof(ProjectConsts.MaxDefaultDocumentNameLength))]
public string DefaultDocumentName { get; set; } = "Index";
- [StringLength(ProjectConsts.MaxNavigationDocumentNameLength)]
+ [DynamicStringLength(typeof(ProjectConsts), nameof(ProjectConsts.MaxNavigationDocumentNameLength))]
public string NavigationDocumentName { get; set; } = "docs-nav.json";
- [StringLength(ProjectConsts.MaxParametersDocumentNameLength)]
+ [DynamicStringLength(typeof(ProjectConsts), nameof(ProjectConsts.MaxParametersDocumentNameLength))]
public string ParametersDocumentName { get; set; } = "docs-params.json";
- [StringLength(ProjectConsts.MaxVersionNameLength)]
+ [DynamicStringLength(typeof(ProjectConsts), nameof(ProjectConsts.MaxVersionNameLength))]
public string MinimumVersion { get; set; }
public string MainWebsiteUrl { get; set; }
- [StringLength(ProjectConsts.MaxLatestVersionBranchNameLength)]
+ [DynamicStringLength(typeof(ProjectConsts), nameof(ProjectConsts.MaxLatestVersionBranchNameLength))]
public string LatestVersionBranchName { get; set; }
[HiddenInput]
diff --git a/modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Projects/Edit.cshtml.cs b/modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Projects/Edit.cshtml.cs
index 3b9aba5303..ef1762c460 100644
--- a/modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Projects/Edit.cshtml.cs
+++ b/modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Projects/Edit.cshtml.cs
@@ -9,6 +9,7 @@ using Microsoft.AspNetCore.Mvc.Rendering;
using Volo.Abp;
using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Form;
using Volo.Abp.AspNetCore.Mvc.UI.RazorPages;
+using Volo.Abp.Validation;
using Volo.Docs.Admin.Projects;
using Volo.Docs.Projects;
@@ -83,28 +84,28 @@ namespace Volo.Docs.Admin.Pages.Docs.Admin.Projects
public Guid Id { get; set; }
[Required]
- [StringLength(ProjectConsts.MaxNameLength)]
+ [DynamicStringLength(typeof(ProjectConsts), nameof(ProjectConsts.MaxNameLength))]
public string Name { get; set; }
[Required]
[SelectItems(nameof(FormatTypes))]
public string Format { get; set; }
- [StringLength(ProjectConsts.MaxDefaultDocumentNameLength)]
+ [DynamicStringLength(typeof(ProjectConsts), nameof(ProjectConsts.MaxDefaultDocumentNameLength))]
public string DefaultDocumentName { get; set; }
- [StringLength(ProjectConsts.MaxNavigationDocumentNameLength)]
+ [DynamicStringLength(typeof(ProjectConsts), nameof(ProjectConsts.MaxNavigationDocumentNameLength))]
public string NavigationDocumentName { get; set; }
- [StringLength(ProjectConsts.MaxParametersDocumentNameLength)]
+ [DynamicStringLength(typeof(ProjectConsts), nameof(ProjectConsts.MaxParametersDocumentNameLength))]
public string ParametersDocumentName { get; set; }
- [StringLength(ProjectConsts.MaxVersionNameLength)]
+ [DynamicStringLength(typeof(ProjectConsts), nameof(ProjectConsts.MaxVersionNameLength))]
public string MinimumVersion { get; set; }
public string MainWebsiteUrl { get; set; }
- [StringLength(ProjectConsts.MaxLatestVersionBranchNameLength)]
+ [DynamicStringLength(typeof(ProjectConsts), nameof(ProjectConsts.MaxLatestVersionBranchNameLength))]
public string LatestVersionBranchName { get; set; }
}
diff --git a/modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Projects/Pull.cshtml.cs b/modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Projects/Pull.cshtml.cs
index 195337a22e..5cbd094834 100644
--- a/modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Projects/Pull.cshtml.cs
+++ b/modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Projects/Pull.cshtml.cs
@@ -2,6 +2,7 @@ using System;
using System.ComponentModel.DataAnnotations;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
+using Volo.Abp.Validation;
using Volo.Docs.Admin.Documents;
using Volo.Docs.Admin.Projects;
using Volo.Docs.Documents;
@@ -60,15 +61,15 @@ namespace Volo.Docs.Admin.Pages.Docs.Admin.Projects
public bool All { get; set; }
[Required]
- [StringLength(DocumentConsts.MaxNameLength)]
+ [DynamicStringLength(typeof(DocumentConsts), nameof(DocumentConsts.MaxNameLength))]
public string Name { get; set; }
[Required]
- [StringLength(DocumentConsts.MaxLanguageCodeNameLength)]
+ [DynamicStringLength(typeof(DocumentConsts),nameof(DocumentConsts.MaxLanguageCodeNameLength))]
public string LanguageCode { get; set; }
[Required]
- [StringLength(DocumentConsts.MaxVersionNameLength)]
+ [DynamicStringLength(typeof(DocumentConsts), nameof(DocumentConsts.MaxVersionNameLength))]
public string Version { get; set; }
}
}
diff --git a/modules/docs/src/Volo.Docs.Application.Contracts/Volo/Docs/Documents/GetDefaultDocumentInput.cs b/modules/docs/src/Volo.Docs.Application.Contracts/Volo/Docs/Documents/GetDefaultDocumentInput.cs
index 3deeb83967..1cef038512 100644
--- a/modules/docs/src/Volo.Docs.Application.Contracts/Volo/Docs/Documents/GetDefaultDocumentInput.cs
+++ b/modules/docs/src/Volo.Docs.Application.Contracts/Volo/Docs/Documents/GetDefaultDocumentInput.cs
@@ -1,5 +1,7 @@
using System;
using System.ComponentModel.DataAnnotations;
+using System.Runtime.CompilerServices;
+using Volo.Abp.Validation;
using Volo.Docs.Language;
using Volo.Docs.Projects;
@@ -9,11 +11,11 @@ namespace Volo.Docs.Documents
{
public Guid ProjectId { get; set; }
- [StringLength(ProjectConsts.MaxVersionNameLength)]
+ [DynamicStringLength(typeof(ProjectConsts), nameof(ProjectConsts.MaxVersionNameLength))]
public string Version { get; set; }
[Required]
- [StringLength(LanguageConsts.MaxLanguageCodeLength)]
+ [DynamicStringLength(typeof(LanguageConsts), nameof(LanguageConsts.MaxLanguageCodeLength))]
public string LanguageCode { get; set; }
}
}
\ No newline at end of file
diff --git a/modules/docs/src/Volo.Docs.Application.Contracts/Volo/Docs/Documents/GetDocumentInput.cs b/modules/docs/src/Volo.Docs.Application.Contracts/Volo/Docs/Documents/GetDocumentInput.cs
index 412f41b82e..3646f2ade0 100644
--- a/modules/docs/src/Volo.Docs.Application.Contracts/Volo/Docs/Documents/GetDocumentInput.cs
+++ b/modules/docs/src/Volo.Docs.Application.Contracts/Volo/Docs/Documents/GetDocumentInput.cs
@@ -1,5 +1,6 @@
using System;
using System.ComponentModel.DataAnnotations;
+using Volo.Abp.Validation;
using Volo.Docs.Language;
using Volo.Docs.Projects;
@@ -10,14 +11,14 @@ namespace Volo.Docs.Documents
public Guid ProjectId { get; set; }
[Required]
- [StringLength(DocumentConsts.MaxNameLength)]
+ [DynamicStringLength(typeof(DocumentConsts), nameof(DocumentConsts.MaxNameLength))]
public string Name { get; set; }
- [StringLength(ProjectConsts.MaxVersionNameLength)]
+ [DynamicStringLength(typeof(ProjectConsts), nameof(ProjectConsts.MaxVersionNameLength))]
public string Version { get; set; }
[Required]
- [StringLength(LanguageConsts.MaxLanguageCodeLength)]
+ [DynamicStringLength(typeof(LanguageConsts), nameof(LanguageConsts.MaxLanguageCodeLength))]
public string LanguageCode { get; set; }
}
}
\ No newline at end of file
diff --git a/modules/docs/src/Volo.Docs.Application.Contracts/Volo/Docs/Documents/GetDocumentResourceInput.cs b/modules/docs/src/Volo.Docs.Application.Contracts/Volo/Docs/Documents/GetDocumentResourceInput.cs
index 6f759c47d8..52c1cf78af 100644
--- a/modules/docs/src/Volo.Docs.Application.Contracts/Volo/Docs/Documents/GetDocumentResourceInput.cs
+++ b/modules/docs/src/Volo.Docs.Application.Contracts/Volo/Docs/Documents/GetDocumentResourceInput.cs
@@ -1,5 +1,6 @@
using System;
using System.ComponentModel.DataAnnotations;
+using Volo.Abp.Validation;
using Volo.Docs.Language;
using Volo.Docs.Projects;
@@ -10,14 +11,14 @@ namespace Volo.Docs.Documents
public Guid ProjectId { get; set; }
[Required]
- [StringLength(DocumentConsts.MaxNameLength)]
+ [DynamicStringLength(typeof(DocumentConsts), nameof(DocumentConsts.MaxNameLength))]
public string Name { get; set; }
- [StringLength(ProjectConsts.MaxVersionNameLength)]
+ [DynamicStringLength(typeof(ProjectConsts), nameof(ProjectConsts.MaxVersionNameLength))]
public string Version { get; set; }
[Required]
- [StringLength(LanguageConsts.MaxLanguageCodeLength)]
+ [DynamicStringLength(typeof(LanguageConsts), nameof(LanguageConsts.MaxLanguageCodeLength))]
public string LanguageCode { get; set; }
}
}
\ No newline at end of file
diff --git a/modules/docs/src/Volo.Docs.Application.Contracts/Volo/Docs/Documents/GetNavigationDocumentInput.cs b/modules/docs/src/Volo.Docs.Application.Contracts/Volo/Docs/Documents/GetNavigationDocumentInput.cs
index 6866c8c633..ee4e3380ee 100644
--- a/modules/docs/src/Volo.Docs.Application.Contracts/Volo/Docs/Documents/GetNavigationDocumentInput.cs
+++ b/modules/docs/src/Volo.Docs.Application.Contracts/Volo/Docs/Documents/GetNavigationDocumentInput.cs
@@ -1,5 +1,6 @@
using System;
using System.ComponentModel.DataAnnotations;
+using Volo.Abp.Validation;
using Volo.Docs.Language;
using Volo.Docs.Projects;
@@ -9,11 +10,11 @@ namespace Volo.Docs.Documents
{
public Guid ProjectId { get; set; }
- [StringLength(ProjectConsts.MaxVersionNameLength)]
+ [DynamicStringLength(typeof(ProjectConsts), nameof(ProjectConsts.MaxVersionNameLength))]
public string Version { get; set; }
[Required]
- [StringLength(LanguageConsts.MaxLanguageCodeLength)]
+ [DynamicStringLength(typeof(LanguageConsts), nameof(LanguageConsts.MaxLanguageCodeLength))]
public string LanguageCode { get; set; }
}
}
\ No newline at end of file
diff --git a/modules/docs/src/Volo.Docs.Application.Contracts/Volo/Docs/Documents/GetParametersDocumentInput.cs b/modules/docs/src/Volo.Docs.Application.Contracts/Volo/Docs/Documents/GetParametersDocumentInput.cs
index 33bd25b394..1e277f36a3 100644
--- a/modules/docs/src/Volo.Docs.Application.Contracts/Volo/Docs/Documents/GetParametersDocumentInput.cs
+++ b/modules/docs/src/Volo.Docs.Application.Contracts/Volo/Docs/Documents/GetParametersDocumentInput.cs
@@ -1,5 +1,6 @@
using System;
using System.ComponentModel.DataAnnotations;
+using Volo.Abp.Validation;
using Volo.Docs.Language;
using Volo.Docs.Projects;
@@ -9,11 +10,11 @@ namespace Volo.Docs.Documents
{
public Guid ProjectId { get; set; }
- [StringLength(ProjectConsts.MaxVersionNameLength)]
+ [DynamicStringLength(typeof(ProjectConsts), nameof(ProjectConsts.MaxVersionNameLength))]
public string Version { get; set; }
[Required]
- [StringLength(LanguageConsts.MaxLanguageCodeLength)]
+ [DynamicStringLength(typeof(LanguageConsts), nameof(LanguageConsts.MaxLanguageCodeLength))]
public string LanguageCode { get; set; }
}
}
\ No newline at end of file
diff --git a/modules/docs/src/Volo.Docs.Domain.Shared/Volo/Docs/Documents/DocumentConsts.cs b/modules/docs/src/Volo.Docs.Domain.Shared/Volo/Docs/Documents/DocumentConsts.cs
index f629abd0a4..04e3de3fd5 100644
--- a/modules/docs/src/Volo.Docs.Domain.Shared/Volo/Docs/Documents/DocumentConsts.cs
+++ b/modules/docs/src/Volo.Docs.Domain.Shared/Volo/Docs/Documents/DocumentConsts.cs
@@ -2,14 +2,49 @@
{
public static class DocumentConsts
{
- public const int MaxNameLength = 255;
- public const int MaxVersionNameLength = 128;
- public const int MaxLanguageCodeNameLength = 128;
- public const int MaxFileNameNameLength = 128;
- public const int MaxFormatNameLength = 128;
- public const int MaxEditLinkLength = 2048;
- public const int MaxRootUrlLength = 2048;
- public const int MaxRawRootUrlLength = 2048;
- public const int MaxLocalDirectoryLength = 512;
+ ///
+ /// Default value: 255
+ ///
+ public static int MaxNameLength { get; set; } = 255;
+
+ ///
+ /// Default value: 128
+ ///
+ public static int MaxVersionNameLength { get; set; } = 128;
+
+ ///
+ /// Default value: 128
+ ///
+ public static int MaxLanguageCodeNameLength { get; set; } = 128;
+
+ ///
+ /// Default value: 128
+ ///
+ public static int MaxFileNameNameLength { get; set; } = 128;
+
+ ///
+ /// Default value: 128
+ ///
+ public static int MaxFormatNameLength { get; set; } = 128;
+
+ ///
+ /// Default value: 2048
+ ///
+ public static int MaxEditLinkLength { get; set; } = 2048;
+
+ ///
+ /// Default value: 2048
+ ///
+ public static int MaxRootUrlLength { get; set; } = 2048;
+
+ ///
+ /// Default value: 2048
+ ///
+ public static int MaxRawRootUrlLength { get; set; } = 2048;
+
+ ///
+ /// Default value: 512
+ ///
+ public static int MaxLocalDirectoryLength { get; set; } = 512;
}
}
diff --git a/modules/docs/src/Volo.Docs.Domain.Shared/Volo/Docs/Language/LanguageConsts.cs b/modules/docs/src/Volo.Docs.Domain.Shared/Volo/Docs/Language/LanguageConsts.cs
index 867cc2dd4e..cd449a37fd 100644
--- a/modules/docs/src/Volo.Docs.Domain.Shared/Volo/Docs/Language/LanguageConsts.cs
+++ b/modules/docs/src/Volo.Docs.Domain.Shared/Volo/Docs/Language/LanguageConsts.cs
@@ -3,6 +3,9 @@ namespace Volo.Docs.Language
{
public static class LanguageConsts
{
- public const int MaxLanguageCodeLength = 10;
+ ///
+ /// Default value: 10
+ ///
+ public static int MaxLanguageCodeLength { get; set; } = 10;
}
}
diff --git a/modules/docs/src/Volo.Docs.Domain.Shared/Volo/Docs/Projects/ProjectConsts.cs b/modules/docs/src/Volo.Docs.Domain.Shared/Volo/Docs/Projects/ProjectConsts.cs
index 927a1a4c59..3322fb7732 100644
--- a/modules/docs/src/Volo.Docs.Domain.Shared/Volo/Docs/Projects/ProjectConsts.cs
+++ b/modules/docs/src/Volo.Docs.Domain.Shared/Volo/Docs/Projects/ProjectConsts.cs
@@ -2,12 +2,39 @@
{
public static class ProjectConsts
{
- public const int MaxNameLength = 128;
- public const int MaxShortNameLength = 32;
- public const int MaxDefaultDocumentNameLength = 128;
- public const int MaxNavigationDocumentNameLength = 128;
- public const int MaxParametersDocumentNameLength = 128;
- public const int MaxLatestVersionBranchNameLength = 128;
- public const int MaxVersionNameLength = 128;
+ ///
+ /// Default value: 128
+ ///
+ public static int MaxNameLength { get; set; } = 128;
+
+ ///
+ /// Default value: 32
+ ///
+ public static int MaxShortNameLength { get; set; } = 32;
+
+ ///
+ /// Default value: 128
+ ///
+ public static int MaxDefaultDocumentNameLength { get; set; } = 128;
+
+ ///
+ /// Default value: 128
+ ///
+ public static int MaxNavigationDocumentNameLength { get; set; } = 128;
+
+ ///
+ /// Default value: 128
+ ///
+ public static int MaxParametersDocumentNameLength { get; set; } = 128;
+
+ ///
+ /// Default value: 128
+ ///
+ public static int MaxLatestVersionBranchNameLength { get; set; } = 128;
+
+ ///
+ /// Default value: 128
+ ///
+ public static int MaxVersionNameLength { get; set; } = 128;
}
}
diff --git a/modules/feature-management/src/Volo.Abp.FeatureManagement.Domain/Volo/Abp/FeatureManagement/FeatureValueConsts.cs b/modules/feature-management/src/Volo.Abp.FeatureManagement.Domain/Volo/Abp/FeatureManagement/FeatureValueConsts.cs
index 0fd1a644fa..f44deca44a 100644
--- a/modules/feature-management/src/Volo.Abp.FeatureManagement.Domain/Volo/Abp/FeatureManagement/FeatureValueConsts.cs
+++ b/modules/feature-management/src/Volo.Abp.FeatureManagement.Domain/Volo/Abp/FeatureManagement/FeatureValueConsts.cs
@@ -2,12 +2,24 @@
{
public static class FeatureValueConsts
{
- public const int MaxNameLength = 128;
+ ///
+ /// Default value: 128
+ ///
+ public static int MaxNameLength { get; set;} = 128;
- public const int MaxProviderNameLength = 64;
+ ///
+ /// Default value: 64
+ ///
+ public static int MaxProviderNameLength { get; set;} = 64;
- public const int MaxProviderKeyLength = 64;
+ ///
+ /// Default value: 64
+ ///
+ public static int MaxProviderKeyLength { get; set;} = 64;
- public const int MaxValueLength = 128;
+ ///
+ /// Default value: 128
+ ///
+ public static int MaxValueLength { get; set;} = 128;
}
}
diff --git a/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/IdentityClaimTypeConsts.cs b/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/IdentityClaimTypeConsts.cs
index 6e15cb0cfc..d13d3fba0e 100644
--- a/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/IdentityClaimTypeConsts.cs
+++ b/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/IdentityClaimTypeConsts.cs
@@ -2,10 +2,29 @@
{
public class IdentityClaimTypeConsts
{
+ ///
+ /// Default value: 256
+ ///
public static int MaxNameLength { get; set; } = 256;
+
+ ///
+ /// Default value: 512
+ ///
public static int MaxRegexLength { get; set; } = 512;
+
+ ///
+ /// Default value: 128
+ ///
public static int MaxRegexDescriptionLength { get; set; } = 128;
+
+ ///
+ /// Default value: 256
+ ///
public static int MaxDescriptionLength { get; set; } = 256;
+
+ ///
+ /// Default value: 256
+ ///
public static int MaxConcurrencyStampLength { get; set; } = 256;
}
}
diff --git a/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/IdentityRoleConsts.cs b/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/IdentityRoleConsts.cs
index 33e8e74977..dfed056854 100644
--- a/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/IdentityRoleConsts.cs
+++ b/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/IdentityRoleConsts.cs
@@ -2,8 +2,19 @@
{
public static class IdentityRoleConsts
{
+ ///
+ /// Default value: 256
+ ///
public static int MaxNameLength { get; set; } = 256;
+
+ ///
+ /// Default value: 256
+ ///
public static int MaxNormalizedNameLength { get; set; } = 256;
+
+ ///
+ /// Default value: 256
+ ///
public static int MaxConcurrencyStampLength { get; set; } = 256;
}
}
diff --git a/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/IdentityUserClaimConsts.cs b/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/IdentityUserClaimConsts.cs
index a850d6cff2..84ba493853 100644
--- a/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/IdentityUserClaimConsts.cs
+++ b/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/IdentityUserClaimConsts.cs
@@ -2,8 +2,14 @@
{
public static class IdentityUserClaimConsts
{
+ ///
+ /// Default value: 256
+ ///
public static int MaxClaimTypeLength { get; set; } = 256;
+ ///
+ /// Default value: 1024
+ ///
public static int MaxClaimValueLength { get; set; } = 1024;
}
}
diff --git a/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/IdentityUserConsts.cs b/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/IdentityUserConsts.cs
index 7b1a90dacc..378f545dff 100644
--- a/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/IdentityUserConsts.cs
+++ b/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/IdentityUserConsts.cs
@@ -18,12 +18,24 @@ namespace Volo.Abp.Identity
public static int MaxPhoneNumberLength { get; set; } = AbpUserConsts.MaxPhoneNumberLength;
+ ///
+ /// Default value: 128
+ ///
public static int MaxPasswordLength { get; set; } = 128;
+ ///
+ /// Default value: 256
+ ///
public static int MaxPasswordHashLength { get; set; } = 256;
+ ///
+ /// Default value: 256
+ ///
public static int MaxSecurityStampLength { get; set; } = 256;
-
+
+ ///
+ /// Default value: 256
+ ///
public static int MaxConcurrencyStampLength { get; set; } = 256;
}
}
diff --git a/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/IdentityUserLoginConsts.cs b/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/IdentityUserLoginConsts.cs
index 3f95dfd634..8435221fd3 100644
--- a/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/IdentityUserLoginConsts.cs
+++ b/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/IdentityUserLoginConsts.cs
@@ -2,8 +2,19 @@
{
public static class IdentityUserLoginConsts
{
+ ///
+ /// Default value: 64
+ ///
public static int MaxLoginProviderLength { get; set; } = 64;
+
+ ///
+ /// Default value: 196
+ ///
public static int MaxProviderKeyLength { get; set; } = 196;
+
+ ///
+ /// Default value: 128
+ ///
public static int MaxProviderDisplayNameLength { get; set; } = 128;
}
}
diff --git a/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/IdentityUserTokenConsts.cs b/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/IdentityUserTokenConsts.cs
index 1e4eb4794b..a585a8383b 100644
--- a/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/IdentityUserTokenConsts.cs
+++ b/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/IdentityUserTokenConsts.cs
@@ -2,8 +2,14 @@
{
public static class IdentityUserTokenConsts
{
+ ///
+ /// Default value: 64
+ ///
public static int MaxLoginProviderLength { get; set; } = 64;
+ ///
+ /// Default value: 128
+ ///
public static int MaxNameLength { get; set; } = 128;
}
}
diff --git a/modules/identityserver/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/Clients/ClientIdPRestrictionConsts.cs b/modules/identityserver/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/Clients/ClientIdPRestrictionConsts.cs
index c71301871a..b238a01935 100644
--- a/modules/identityserver/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/Clients/ClientIdPRestrictionConsts.cs
+++ b/modules/identityserver/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/Clients/ClientIdPRestrictionConsts.cs
@@ -2,6 +2,9 @@
{
public class ClientIdPRestrictionConsts
{
- public const int ProviderMaxLength = 200;
+ ///
+ /// Default value: 200
+ ///
+ public static int ProviderMaxLength { get; set; } = 200;
}
}
\ No newline at end of file
diff --git a/modules/identityserver/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/Clients/ClientPostLogoutRedirectUriConsts.cs b/modules/identityserver/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/Clients/ClientPostLogoutRedirectUriConsts.cs
index 3092232d47..7d4764e1a3 100644
--- a/modules/identityserver/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/Clients/ClientPostLogoutRedirectUriConsts.cs
+++ b/modules/identityserver/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/Clients/ClientPostLogoutRedirectUriConsts.cs
@@ -2,7 +2,10 @@
{
public class ClientPostLogoutRedirectUriConsts
{
- public const int PostLogoutRedirectUriMaxLength = 2000;
+ ///
+ /// Default value: 200
+ ///
+ public static int PostLogoutRedirectUriMaxLength { get; set; } = 2000;
public static int PostLogoutRedirectUriMaxLengthValue { get; set; } = 2000;
}
}
\ No newline at end of file
diff --git a/modules/identityserver/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/Clients/ClientPropertyConsts.cs b/modules/identityserver/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/Clients/ClientPropertyConsts.cs
index 6535304596..664e1076b0 100644
--- a/modules/identityserver/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/Clients/ClientPropertyConsts.cs
+++ b/modules/identityserver/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/Clients/ClientPropertyConsts.cs
@@ -2,7 +2,14 @@
{
public class ClientPropertyConsts
{
- public const int KeyMaxLength = 250;
- public const int ValueMaxLength = 2000;
+ ///
+ /// Default value: 250
+ ///
+ public static int KeyMaxLength { get; set; } = 250;
+
+ ///
+ /// Default value: 2000
+ ///
+ public static int ValueMaxLength { get; set; } = 2000;
}
}
\ No newline at end of file
diff --git a/modules/identityserver/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/Clients/ClientRedirectUriConsts.cs b/modules/identityserver/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/Clients/ClientRedirectUriConsts.cs
index e972388487..7650a3d952 100644
--- a/modules/identityserver/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/Clients/ClientRedirectUriConsts.cs
+++ b/modules/identityserver/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/Clients/ClientRedirectUriConsts.cs
@@ -2,7 +2,10 @@
{
public class ClientRedirectUriConsts
{
- public const int RedirectUriMaxLength = 2000;
+ ///
+ /// Default value: 2000
+ ///
+ public static int RedirectUriMaxLength { get; set; } = 2000;
public static int RedirectUriMaxLengthValue { get; set; } = 2000;
}
}
\ No newline at end of file
diff --git a/modules/identityserver/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/Clients/ClientScopeConsts.cs b/modules/identityserver/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/Clients/ClientScopeConsts.cs
index 6a5b62e692..0ec1c04595 100644
--- a/modules/identityserver/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/Clients/ClientScopeConsts.cs
+++ b/modules/identityserver/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/Clients/ClientScopeConsts.cs
@@ -2,6 +2,9 @@
{
public class ClientScopeConsts
{
- public const int ScopeMaxLength = 200;
+ ///
+ /// Default value: 200
+ ///
+ public static int ScopeMaxLength { get; set; } = 200;
}
}
\ No newline at end of file
diff --git a/modules/identityserver/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/Grants/PersistedGrantConsts.cs b/modules/identityserver/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/Grants/PersistedGrantConsts.cs
index 6d0836ab17..b1dd21d6f8 100644
--- a/modules/identityserver/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/Grants/PersistedGrantConsts.cs
+++ b/modules/identityserver/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/Grants/PersistedGrantConsts.cs
@@ -2,11 +2,34 @@
{
public class PersistedGrantConsts
{
- public const int KeyMaxLength = 200;
- public const int TypeMaxLength = 50;
- public const int SubjectIdMaxLength = 200;
- public const int ClientIdMaxLength = 200;
- public const int DataMaxLength = 50000;
- public static int DataMaxLengthValue { get; set; }= 50000;
+ ///
+ /// Default value: 200
+ ///
+ public static int KeyMaxLength { get; set; } = 200;
+
+ ///
+ /// Default value: 50
+ ///
+ public static int TypeMaxLength { get; set; } = 50;
+
+ ///
+ /// Default value: 200
+ ///
+ public static int SubjectIdMaxLength { get; set; } = 200;
+
+ ///
+ /// Default value: 200
+ ///
+ public static int ClientIdMaxLength { get; set; } = 200;
+
+ ///
+ /// Default value: 50000
+ ///
+ public static int DataMaxLength { get; set; } = 50000;
+
+ ///
+ /// Default value: 50000
+ ///
+ public static int DataMaxLengthValue { get; set; } = 50000;
}
}
\ No newline at end of file
diff --git a/modules/identityserver/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/IdentityResources/IdentityResourceConsts.cs b/modules/identityserver/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/IdentityResources/IdentityResourceConsts.cs
index c60cc34ad8..a7c713e161 100644
--- a/modules/identityserver/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/IdentityResources/IdentityResourceConsts.cs
+++ b/modules/identityserver/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/IdentityResources/IdentityResourceConsts.cs
@@ -2,8 +2,19 @@
{
public class IdentityResourceConsts
{
- public const int NameMaxLength = 200;
- public const int DisplayNameMaxLength = 200;
- public const int DescriptionMaxLength = 1000;
+ ///
+ /// Default value: 200
+ ///
+ public static int NameMaxLength { get; set; } = 200;
+
+ ///
+ /// Default value: 200
+ ///
+ public static int DisplayNameMaxLength { get; set; } = 200;
+
+ ///
+ /// Default value: 200
+ ///
+ public static int DescriptionMaxLength { get; set; } = 1000;
}
}
\ No newline at end of file
diff --git a/modules/identityserver/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/SecretConsts.cs b/modules/identityserver/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/SecretConsts.cs
index 76635e322e..156088a97b 100644
--- a/modules/identityserver/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/SecretConsts.cs
+++ b/modules/identityserver/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/SecretConsts.cs
@@ -2,9 +2,21 @@
{
public class SecretConsts
{
- public const int TypeMaxLength = 250;
- public const int ValueMaxLength = 4000;
+ ///
+ /// Default value: 250
+ ///
+ public static int TypeMaxLength { get; set; } = 250;
+
+ ///
+ /// Default value: 4000
+ ///
+ public static int ValueMaxLength { get; set; } = 4000;
+
public static int ValueMaxLengthValue { get; set; } = ValueMaxLength;
- public const int DescriptionMaxLength = 2000;
+
+ ///
+ /// Default value: 2000
+ ///
+ public static int DescriptionMaxLength { get; set; } = 2000;
}
}
\ No newline at end of file
diff --git a/modules/identityserver/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/UserClaimConsts.cs b/modules/identityserver/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/UserClaimConsts.cs
index 9133482f1f..cb0279fd2b 100644
--- a/modules/identityserver/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/UserClaimConsts.cs
+++ b/modules/identityserver/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/UserClaimConsts.cs
@@ -2,6 +2,9 @@
{
public class UserClaimConsts
{
- public const int TypeMaxLength = 200;
+ ///
+ /// Default value: 200
+ ///
+ public static int TypeMaxLength { get; set; } = 200;
}
}
\ No newline at end of file
diff --git a/modules/permission-management/src/Volo.Abp.PermissionManagement.Domain.Shared/Volo/Abp/PermissionManagement/PermissionGrantConsts.cs b/modules/permission-management/src/Volo.Abp.PermissionManagement.Domain.Shared/Volo/Abp/PermissionManagement/PermissionGrantConsts.cs
index 8d579638ec..5cb2397349 100644
--- a/modules/permission-management/src/Volo.Abp.PermissionManagement.Domain.Shared/Volo/Abp/PermissionManagement/PermissionGrantConsts.cs
+++ b/modules/permission-management/src/Volo.Abp.PermissionManagement.Domain.Shared/Volo/Abp/PermissionManagement/PermissionGrantConsts.cs
@@ -2,10 +2,19 @@
{
public static class PermissionGrantConsts
{
- public const int MaxNameLength = 128;
+ ///
+ /// Default value: 128
+ ///
+ public static int MaxNameLength { get; set; } = 128;
- public const int MaxProviderNameLength = 64;
+ ///
+ /// Default value: 64
+ ///
+ public static int MaxProviderNameLength { get; set; } = 64;
- public const int MaxProviderKeyLength = 64;
+ ///
+ /// Default value: 64
+ ///
+ public static int MaxProviderKeyLength { get; set; } = 64;
}
}
diff --git a/modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/SettingConsts.cs b/modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/SettingConsts.cs
index 44a21f3ccb..e23a0e39a5 100644
--- a/modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/SettingConsts.cs
+++ b/modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/SettingConsts.cs
@@ -2,10 +2,26 @@
{
public static class SettingConsts
{
- public const int MaxNameLength = 128;
- public const int MaxValueLength = 2048;
+ ///
+ /// Default value: 128
+ ///
+ public static int MaxNameLength { get; set; } = 128;
+
+ ///
+ /// Default value: 2048
+ ///
+ public static int MaxValueLength { get; set; } = 2048;
+
public static int MaxValueLengthValue { get; set; } = MaxValueLength;
- public const int MaxProviderNameLength = 64;
- public const int MaxProviderKeyLength = 64;
+
+ ///
+ /// Default value: 64
+ ///
+ public static int MaxProviderNameLength { get; set; } = 64;
+
+ ///
+ /// Default value: 64
+ ///
+ public static int MaxProviderKeyLength { get; set; } = 64;
}
}
diff --git a/modules/tenant-management/src/Volo.Abp.TenantManagement.Application.Contracts/Volo/Abp/TenantManagement/TenantCreateOrUpdateDtoBase.cs b/modules/tenant-management/src/Volo.Abp.TenantManagement.Application.Contracts/Volo/Abp/TenantManagement/TenantCreateOrUpdateDtoBase.cs
index 19f73b0d51..7dc805ea79 100644
--- a/modules/tenant-management/src/Volo.Abp.TenantManagement.Application.Contracts/Volo/Abp/TenantManagement/TenantCreateOrUpdateDtoBase.cs
+++ b/modules/tenant-management/src/Volo.Abp.TenantManagement.Application.Contracts/Volo/Abp/TenantManagement/TenantCreateOrUpdateDtoBase.cs
@@ -1,12 +1,13 @@
using System.ComponentModel.DataAnnotations;
using Volo.Abp.ObjectExtending;
+using Volo.Abp.Validation;
namespace Volo.Abp.TenantManagement
{
public abstract class TenantCreateOrUpdateDtoBase : ExtensibleObject
{
[Required]
- [StringLength(TenantConsts.MaxNameLength)]
+ [DynamicStringLength(typeof(TenantConsts), nameof(TenantConsts.MaxNameLength))]
public string Name { get; set; }
}
}
\ No newline at end of file
diff --git a/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/TenantConnectionStringConsts.cs b/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/TenantConnectionStringConsts.cs
index 4cdf8dee2a..b177e8d046 100644
--- a/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/TenantConnectionStringConsts.cs
+++ b/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/TenantConnectionStringConsts.cs
@@ -2,8 +2,14 @@
{
public static class TenantConnectionStringConsts
{
- public const int MaxNameLength = 64;
+ ///
+ /// Default value: 64
+ ///
+ public static int MaxNameLength { get; set; } = 64;
- public const int MaxValueLength = 1024;
+ ///
+ /// Default value: 1024
+ ///
+ public static int MaxValueLength { get; set; } = 1024;
}
}
\ No newline at end of file
diff --git a/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/TenantConsts.cs b/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/TenantConsts.cs
index 328c422ab9..10de5e8773 100644
--- a/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/TenantConsts.cs
+++ b/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/TenantConsts.cs
@@ -2,6 +2,9 @@
{
public static class TenantConsts
{
- public const int MaxNameLength = 64;
+ ///
+ /// Default value: 64
+ ///
+ public static int MaxNameLength { get; set; } = 64;
}
}
diff --git a/modules/tenant-management/src/Volo.Abp.TenantManagement.Web/Pages/TenantManagement/Tenants/ConnectionStringsModal.cshtml.cs b/modules/tenant-management/src/Volo.Abp.TenantManagement.Web/Pages/TenantManagement/Tenants/ConnectionStringsModal.cshtml.cs
index 9093437f98..45a36060e0 100644
--- a/modules/tenant-management/src/Volo.Abp.TenantManagement.Web/Pages/TenantManagement/Tenants/ConnectionStringsModal.cshtml.cs
+++ b/modules/tenant-management/src/Volo.Abp.TenantManagement.Web/Pages/TenantManagement/Tenants/ConnectionStringsModal.cshtml.cs
@@ -2,6 +2,7 @@ using System;
using System.ComponentModel.DataAnnotations;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
+using Volo.Abp.Validation;
namespace Volo.Abp.TenantManagement.Web.Pages.TenantManagement.Tenants
{
@@ -53,7 +54,7 @@ namespace Volo.Abp.TenantManagement.Web.Pages.TenantManagement.Tenants
public bool UseSharedDatabase { get; set; }
- [StringLength(TenantConnectionStringConsts.MaxValueLength)]
+ [DynamicStringLength(typeof(TenantConnectionStringConsts), nameof(TenantConnectionStringConsts.MaxValueLength))]
public string DefaultConnectionString { get; set; }
}
}
diff --git a/modules/tenant-management/src/Volo.Abp.TenantManagement.Web/Pages/TenantManagement/Tenants/CreateModal.cshtml.cs b/modules/tenant-management/src/Volo.Abp.TenantManagement.Web/Pages/TenantManagement/Tenants/CreateModal.cshtml.cs
index fa517594ee..0c1e6e0bec 100644
--- a/modules/tenant-management/src/Volo.Abp.TenantManagement.Web/Pages/TenantManagement/Tenants/CreateModal.cshtml.cs
+++ b/modules/tenant-management/src/Volo.Abp.TenantManagement.Web/Pages/TenantManagement/Tenants/CreateModal.cshtml.cs
@@ -1,6 +1,7 @@
using System.ComponentModel.DataAnnotations;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
+using Volo.Abp.Validation;
namespace Volo.Abp.TenantManagement.Web.Pages.TenantManagement.Tenants
{
@@ -34,7 +35,7 @@ namespace Volo.Abp.TenantManagement.Web.Pages.TenantManagement.Tenants
public class TenantInfoModel
{
[Required]
- [StringLength(TenantConsts.MaxNameLength)]
+ [DynamicStringLength(typeof(TenantConsts), nameof(TenantConsts.MaxNameLength))]
public string Name { get; set; }
[Required]
diff --git a/modules/tenant-management/src/Volo.Abp.TenantManagement.Web/Pages/TenantManagement/Tenants/EditModal.cshtml.cs b/modules/tenant-management/src/Volo.Abp.TenantManagement.Web/Pages/TenantManagement/Tenants/EditModal.cshtml.cs
index 74ac176b02..736d0174cf 100644
--- a/modules/tenant-management/src/Volo.Abp.TenantManagement.Web/Pages/TenantManagement/Tenants/EditModal.cshtml.cs
+++ b/modules/tenant-management/src/Volo.Abp.TenantManagement.Web/Pages/TenantManagement/Tenants/EditModal.cshtml.cs
@@ -2,6 +2,7 @@ using System;
using System.ComponentModel.DataAnnotations;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
+using Volo.Abp.Validation;
namespace Volo.Abp.TenantManagement.Web.Pages.TenantManagement.Tenants
{
@@ -42,7 +43,7 @@ namespace Volo.Abp.TenantManagement.Web.Pages.TenantManagement.Tenants
public Guid Id { get; set; }
[Required]
- [StringLength(TenantConsts.MaxNameLength)]
+ [DynamicStringLength(typeof(TenantConsts), nameof(TenantConsts.MaxNameLength))]
[Display(Name = "DisplayName:TenantName")]
public string Name { get; set; }
}
diff --git a/modules/users/src/Volo.Abp.Users.Domain.Shared/Volo/Abp/Users/AbpUserConsts.cs b/modules/users/src/Volo.Abp.Users.Domain.Shared/Volo/Abp/Users/AbpUserConsts.cs
index ee37c6c9f4..efbd2e02b2 100644
--- a/modules/users/src/Volo.Abp.Users.Domain.Shared/Volo/Abp/Users/AbpUserConsts.cs
+++ b/modules/users/src/Volo.Abp.Users.Domain.Shared/Volo/Abp/Users/AbpUserConsts.cs
@@ -2,14 +2,29 @@ namespace Volo.Abp.Users
{
public class AbpUserConsts
{
+ ///
+ /// Default value: 256
+ ///
public static int MaxUserNameLength { get; set; } = 256;
+ ///
+ /// Default value: 64
+ ///
public static int MaxNameLength { get; set; } = 64;
+ ///
+ /// Default value: 64
+ ///
public static int MaxSurnameLength { get; set; } = 64;
+ ///
+ /// Default value: 256
+ ///
public static int MaxEmailLength { get; set; } = 256;
+ ///
+ /// Default value: 16
+ ///
public static int MaxPhoneNumberLength { get; set; } = 16;
}
}
\ No newline at end of file