-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: Remove mapeamento com DataAnnotations
- Loading branch information
1 parent
7831b15
commit 4e2d2a4
Showing
4 changed files
with
0 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,8 @@ | ||
using System.ComponentModel.DataAnnotations; | ||
using System.ComponentModel.DataAnnotations.Schema; | ||
|
||
namespace Blog.Models; | ||
|
||
[Table(nameof(Category))] | ||
public class Category : ModelBase | ||
{ | ||
[Required] | ||
[MinLength(3)] | ||
[MaxLength(80)] | ||
[Column(nameof(Slug), TypeName = "VARCHAR")] | ||
public string Slug { get; set; } = string.Empty; | ||
|
||
[Required] | ||
[MinLength(3)] | ||
[MaxLength(80)] | ||
[Column(nameof(Title), TypeName = "NVARCHAR")] | ||
public string Title { get; set; } = string.Empty; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,6 @@ | ||
using System.ComponentModel.DataAnnotations; | ||
using System.ComponentModel.DataAnnotations.Schema; | ||
|
||
namespace Blog.Models; | ||
|
||
public abstract class ModelBase | ||
{ | ||
[Key] | ||
[DatabaseGenerated(DatabaseGeneratedOption.Identity)] | ||
public int Id { get; set; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters