Skip to content

Commit

Permalink
Increase unnecessarily small limits
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidLazarescu committed Feb 29, 2024
1 parent 93076da commit 830da86
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 32 deletions.
8 changes: 4 additions & 4 deletions src/Application/Common/DTOs/Books/BookForUpdateDto.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,20 @@ public class BookForUpdateDto
public Guid Guid { get; set; }

[MinLength(2, ErrorMessage = "The title is too short")]
[MaxLength(200, ErrorMessage = "The title is too long")]
[MaxLength(2000, ErrorMessage = "The title is too long")]
public string Title { get; set; }

[Range(0, int.MaxValue)]
public int CurrentPage { get; set; }

[EmptyOrMinLength(2, ErrorMessage = "The language is too short")]
[MaxLength(60, ErrorMessage = "The language is too long")]
[MaxLength(100, ErrorMessage = "The language is too long")]
public string Language { get; set; }

[MaxLength(200, ErrorMessage = "The creator is too long")]
[MaxLength(2000, ErrorMessage = "The creator is too long")]
public string Creator { get; set; }

[MaxLength(400, ErrorMessage = "The authors are too long")]
[MaxLength(2000, ErrorMessage = "The authors are too long")]
public string Authors { get; set; }

[MaxLength(100, ErrorMessage = "The creation date is too long")]
Expand Down
14 changes: 7 additions & 7 deletions src/Application/Common/DTOs/Books/BookInDto.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class BookInDto

[Required]
[MinLength(2, ErrorMessage = "The title is too short")]
[MaxLength(200, ErrorMessage = "The title is too long")]
[MaxLength(2000, ErrorMessage = "The title is too long")]
public string Title { get; set; }

[Required]
Expand All @@ -28,11 +28,11 @@ public class BookInDto

[Required]
[MinLength(2, ErrorMessage = "The format is too short")]
[MaxLength(60, ErrorMessage = "The format is too long")]
[MaxLength(100, ErrorMessage = "The format is too long")]
public string Format { get; set; }

[EmptyOrMinLength(2, ErrorMessage = "The language is too short")]
[MaxLength(60, ErrorMessage = "The language is too long")]
[MaxLength(100, ErrorMessage = "The language is too long")]
public string Language { get; set; }

[Required]
Expand All @@ -41,16 +41,16 @@ public class BookInDto
public string DocumentSize { get; set; }

[EmptyOrMinLength(2, ErrorMessage = "The pages size is too short")]
[MaxLength(100, ErrorMessage = "The pages size is too long")]
[MaxLength(600, ErrorMessage = "The pages size is too long")]
public string PagesSize { get; set; }

[MaxLength(200, ErrorMessage = "The creator is too long")]
[MaxLength(2000, ErrorMessage = "The creator is too long")]
public string Creator { get; set; }

[MaxLength(400, ErrorMessage = "The authors are too long")]
[MaxLength(2000, ErrorMessage = "The authors are too long")]
public string Authors { get; set; }

[MaxLength(100, ErrorMessage = "The creation date is too long")]
[MaxLength(140, ErrorMessage = "The creation date is too long")]
public string CreationDate { get; set; }

[Required]
Expand Down
14 changes: 7 additions & 7 deletions src/Domain/Entities/Book.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class Book

[Required]
[MinLength(2, ErrorMessage = "The book title is too short")]
[MaxLength(200, ErrorMessage = "The book title is too long")]
[MaxLength(2000, ErrorMessage = "The book title is too long")]
public string Title { get; set; }

[Required]
Expand All @@ -24,27 +24,27 @@ public class Book

[Required]
[MinLength(1, ErrorMessage = "The format is too short")]
[MaxLength(40, ErrorMessage = "The format is too long")]
[MaxLength(100, ErrorMessage = "The format is too long")]
public string Format { get; set; }

[MinLength(2, ErrorMessage = "The language is too short")]
[MaxLength(50, ErrorMessage = "The language is too long")]
[MaxLength(100, ErrorMessage = "The language is too long")]
public string Language { get; set; }

[Required]
[MinLength(2, ErrorMessage = "The document size is too short")]
[MaxLength(30, ErrorMessage = "The document size is too long")]
[MaxLength(60, ErrorMessage = "The document size is too long")]
public string DocumentSize { get; set; }

[Required]
[MinLength(2, ErrorMessage = "The pages size is too short")]
[MaxLength(100, ErrorMessage = "The pages size is too long")]
[MaxLength(600, ErrorMessage = "The pages size is too long")]
public string PagesSize { get; set; }

[MaxLength(140, ErrorMessage = "The creator is too long")]
[MaxLength(2000, ErrorMessage = "The creator is too long")]
public string Creator { get; set; }

[MaxLength(400, ErrorMessage = "The authors are too long")]
[MaxLength(2000, ErrorMessage = "The authors are too long")]
public string Authors { get; set; }

[MaxLength(140, ErrorMessage = "The creation date is too long")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ protected override void BuildModel(ModelBuilder modelBuilder)
.HasColumnType("nvarchar(max)");
b.Property<string>("Authors")
.HasMaxLength(400)
.HasColumnType("nvarchar(400)");
.HasMaxLength(2000)
.HasColumnType("nvarchar(2000)");
b.Property<string>("ColorTheme")
.IsRequired()
Expand All @@ -53,16 +53,16 @@ protected override void BuildModel(ModelBuilder modelBuilder)
.HasColumnType("nvarchar(140)");
b.Property<string>("Creator")
.HasMaxLength(140)
.HasColumnType("nvarchar(140)");
.HasMaxLength(2000)
.HasColumnType("nvarchar(2000)");
b.Property<int>("CurrentPage")
.HasColumnType("int");
b.Property<string>("DocumentSize")
.IsRequired()
.HasMaxLength(30)
.HasColumnType("nvarchar(30)");
.HasMaxLength(60)
.HasColumnType("nvarchar(60)");
b.Property<string>("FileHash")
.IsRequired()
Expand All @@ -72,15 +72,15 @@ protected override void BuildModel(ModelBuilder modelBuilder)
b.Property<string>("Format")
.IsRequired()
.HasMaxLength(40)
.HasColumnType("nvarchar(40)");
.HasMaxLength(100)
.HasColumnType("nvarchar(100)");
b.Property<bool>("HasCover")
.HasColumnType("bit");
b.Property<string>("Language")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
.HasMaxLength(100)
.HasColumnType("nvarchar(100)");
b.Property<string>("LastModified")
.IsRequired()
Expand All @@ -94,8 +94,8 @@ protected override void BuildModel(ModelBuilder modelBuilder)
b.Property<string>("PagesSize")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("nvarchar(100)");
.HasMaxLength(600)
.HasColumnType("nvarchar(600)");
b.Property<string>("ParentFolderId")
.HasMaxLength(200)
Expand All @@ -108,8 +108,8 @@ protected override void BuildModel(ModelBuilder modelBuilder)
b.Property<string>("Title")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("nvarchar(200)");
.HasMaxLength(2000)
.HasColumnType("nvarchar(2000)");
b.Property<string>("UserId")
.IsRequired()
Expand Down

0 comments on commit 830da86

Please sign in to comment.