Skip to content

Commit

Permalink
Added extension
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidLazarescu committed Mar 14, 2024
1 parent 830da86 commit b9ab10e
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Application/Common/DTOs/Books/BookInDto.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ public class BookInDto
[MinLength(2, ErrorMessage = "The format is too short")]
[MaxLength(100, ErrorMessage = "The format is too long")]
public string Format { get; set; }

[MaxLength(500, ErrorMessage = "The extension is too long")]
public string Extension { get; set; }

[EmptyOrMinLength(2, ErrorMessage = "The language is too short")]
[MaxLength(100, ErrorMessage = "The language is too long")]
Expand Down
2 changes: 2 additions & 0 deletions src/Application/Common/DTOs/Books/BookOutDto.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ public class BookOutDto

public string Format { get; set; }

public string Extension { get; set; }

public string Language { get; set; }

public string DocumentSize { get; set; }
Expand Down
3 changes: 3 additions & 0 deletions src/Domain/Entities/Book.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ public class Book
[MaxLength(100, ErrorMessage = "The format is too long")]
public string Format { get; set; }

[MaxLength(500, ErrorMessage = "The extension is too long")]
public string Extension { get; set; }

[MinLength(2, ErrorMessage = "The language is too short")]
[MaxLength(100, ErrorMessage = "The language is too long")]
public string Language { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ protected override void BuildModel(ModelBuilder modelBuilder)
.HasMaxLength(60)
.HasColumnType("nvarchar(60)");
b.Property<string>("Extension")
.HasMaxLength(500)
.HasColumnType("nvarchar(500)");
b.Property<string>("FileHash")
.IsRequired()
.ValueGeneratedOnAdd()
Expand Down

0 comments on commit b9ab10e

Please sign in to comment.