Skip to content

Commit

Permalink
refactor: Mapeia as propriedades do modelo de categoria
Browse files Browse the repository at this point in the history
  • Loading branch information
renebentes committed Oct 6, 2022
1 parent 0232d73 commit 5fb8bb4
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Blog/Data/Mappings/CategoryMap.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,15 @@ public void Configure(EntityTypeBuilder<Category> builder)
builder.Property(c => c.Id)
.ValueGeneratedOnAdd()
.UseIdentityColumn();

builder.Property(c => c.Title)
.IsRequired()
.HasColumnType("NVARCHAR")
.HasMaxLength(80);

builder.Property(c => c.Slug)
.IsRequired()
.HasColumnType("VARCHAR")
.HasMaxLength(80);
}
}

0 comments on commit 5fb8bb4

Please sign in to comment.