Skip to content

Commit f5591ee

Browse files
committed
feat(Models): define modelos de dados para produtos e categorias
1 parent 9655f2f commit f5591ee

File tree

2 files changed

+45
-0
lines changed

2 files changed

+45
-0
lines changed

src/BlazingShop/Models/Category.cs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
namespace BlazingShop.Models;
2+
3+
public class Category
4+
{
5+
public Category()
6+
{
7+
}
8+
9+
public Category(int id, string title)
10+
{
11+
Id = id;
12+
Title = title;
13+
}
14+
public int Id { get; set; }
15+
16+
public string Title { get; set; } = string.Empty;
17+
}

src/BlazingShop/Models/Product.cs

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
namespace BlazingShop.Models;
2+
3+
public class Product
4+
{
5+
public Product(int id, string title, decimal price, int categoryId, Category category)
6+
{
7+
Id = id;
8+
Title = title;
9+
Price = price;
10+
CategoryId = categoryId;
11+
Category = category;
12+
}
13+
14+
public Product()
15+
{
16+
17+
}
18+
19+
public int Id { get; set; }
20+
21+
public string Title { get; set; } = string.Empty;
22+
23+
public decimal Price { get; set; }
24+
25+
public int CategoryId { get; set; }
26+
27+
public Category Category { get; set; } = new();
28+
}

0 commit comments

Comments
 (0)