Skip to content

Commit e4ab2a2

Browse files
committed
Aligned Model for creation with SQL table setup
1 parent f559171 commit e4ab2a2

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

src/LinkDotNet.Blog.Infrastructure/Persistence/Sql/Mapping/TagsConfiguration.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ public class TagsConfiguration : IEntityTypeConfiguration<Tag>
88
{
99
public void Configure(EntityTypeBuilder<Tag> builder)
1010
{
11+
builder.HasKey(c => c.Id);
1112
builder.Property(c => c.Id).ValueGeneratedOnAdd();
1213
builder.Property(c => c.Content).HasMaxLength(64).IsRequired();
1314
}

src/LinkDotNet.Blog.Web/Features/Admin/BlogPostEditor/Components/CreateNewModel.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ public class CreateNewModel
1919
private string previewImageUrlFallback;
2020

2121
[Required]
22+
[MaxLength(256)]
2223
public string Title
2324
{
2425
get => title;
@@ -52,6 +53,7 @@ public string Content
5253
}
5354

5455
[Required]
56+
[MaxLength(1024)]
5557
public string PreviewImageUrl
5658
{
5759
get => previewImageUrl;
@@ -94,6 +96,7 @@ public string Tags
9496
}
9597
}
9698

99+
[MaxLength(256)]
97100
public string PreviewImageUrlFallback
98101
{
99102
get => previewImageUrlFallback;

0 commit comments

Comments
 (0)