Skip to content

Commit abec848

Browse files
committed
Mapper Dtos
Dtos added
1 parent 1976a13 commit abec848

File tree

7 files changed

+125
-0
lines changed

7 files changed

+125
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.ComponentModel.DataAnnotations;
4+
using System.Linq;
5+
using System.Threading.Tasks;
6+
7+
namespace Supermarket.V1.Dtos.AccountDtos
8+
{
9+
public class LoginDto
10+
{
11+
[Required]
12+
[EmailAddress]
13+
public string Email { get; set; }
14+
15+
[Required]
16+
public string Password { get; set; }
17+
}
18+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.ComponentModel.DataAnnotations;
4+
using System.Linq;
5+
using System.Threading.Tasks;
6+
7+
namespace Supermarket.V1.Dtos.AccountDtos
8+
{
9+
public class RegisterDto
10+
{
11+
[Required]
12+
[DataType(DataType.EmailAddress)]
13+
[EmailAddress]
14+
public string Email { get; set; }
15+
16+
[Required]
17+
[DataType(DataType.Password)]
18+
public string Password { get; set; }
19+
20+
[Required]
21+
[Compare("Password")]
22+
[DataType(DataType.Password)]
23+
public string ConfirmPassword { get; set; }
24+
25+
[Required]
26+
public string FullName { get; set; }
27+
}
28+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Threading.Tasks;
5+
6+
namespace Supermarket.V1.Dtos.AccountDtos
7+
{
8+
public class UserInfoDto
9+
{
10+
public string FullName { get; set; }
11+
12+
public string Email { get; set; }
13+
}
14+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Threading.Tasks;
5+
6+
namespace Supermarket.V1.Dtos.CategoryDtos
7+
{
8+
public class CategoryDto
9+
{
10+
public int Id { get; set; }
11+
12+
public string Name { get; set; }
13+
14+
public DateTime DateAdded { get; set; }
15+
16+
public DateTime DateModified { get; set; }
17+
}
18+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
using System;
2+
using System.ComponentModel.DataAnnotations;
3+
4+
namespace Supermarket.V1.Dtos.CategoryDtos
5+
{
6+
public class CreateCategoryDto
7+
{
8+
[Required]
9+
[MaxLength(30)]
10+
public string Name { get; set; }
11+
12+
public DateTime DateAdded { get; private set; } = DateTime.Now;
13+
14+
public DateTime DateModified { get; private set; } = DateTime.Now;
15+
}
16+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
using System;
2+
using System.ComponentModel.DataAnnotations;
3+
4+
namespace Supermarket.V1.Dtos.CategoryDtos
5+
{
6+
public class SaveCategoryDto
7+
{
8+
[Required]
9+
[MaxLength(30)]
10+
public string Name { get; set; }
11+
12+
public DateTime DateModified { get; private set; } = DateTime.Now;
13+
}
14+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
using Supermarket.V1.Dtos.CategoryDtos;
2+
3+
namespace Supermarket.V1.Dtos.ProductDtos
4+
{
5+
public class ProductDto
6+
{
7+
public int Id { get; set; }
8+
9+
public string Name { get; set; }
10+
11+
public int QuantityInPackage { get; set; }
12+
13+
public string UnitOfMeasurement { get; set; }
14+
15+
public CategoryDto Category { get; set; }
16+
}
17+
}

0 commit comments

Comments
 (0)