Skip to content

Commit 5cf6297

Browse files
committed
Entities added
1 parent 59dfbb3 commit 5cf6297

File tree

4 files changed

+60
-0
lines changed

4 files changed

+60
-0
lines changed

AspnetRunBasics/AspnetRunBasics.csproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.9.10" />
1111
</ItemGroup>
1212

13+
<ItemGroup>
14+
<Folder Include="Data\" />
15+
</ItemGroup>
16+
1317

1418

1519
</Project>

AspnetRunBasics/Entities/Category.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
using System.ComponentModel.DataAnnotations;
2+
3+
namespace AspnetRunBasics.Entities
4+
{
5+
public class Category
6+
{
7+
public int Id { get; set; }
8+
9+
[Required, StringLength(80)]
10+
public string Name { get; set; }
11+
public string Description { get; set; }
12+
public string ImageName { get; set; }
13+
}
14+
}

AspnetRunBasics/Entities/Contact.cs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
using System.ComponentModel.DataAnnotations;
2+
3+
namespace AspnetRunBasics.Entities
4+
{
5+
public class Contact
6+
{
7+
public int Id { get; set; }
8+
9+
[Required]
10+
public string Name { get; set; }
11+
12+
[Phone]
13+
[Required]
14+
public string Phone { get; set; }
15+
16+
[Required]
17+
public string Email { get; set; }
18+
19+
[MinLength(10)]
20+
[Required]
21+
public string Message { get; set; }
22+
}
23+
}

AspnetRunBasics/Entities/Product.cs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
using System.ComponentModel.DataAnnotations;
2+
3+
namespace AspnetRunBasics.Entities
4+
{
5+
public class Product
6+
{
7+
public int Id { get; set; }
8+
9+
[Required, StringLength(80)]
10+
public string Name { get; set; }
11+
12+
public string Summary { get; set; }
13+
public string Description { get; set; }
14+
public string ImageFile { get; set; }
15+
public double Price { get; set; }
16+
public int CategoryId { get; set; }
17+
public Category Category { get; set; }
18+
}
19+
}

0 commit comments

Comments
 (0)