Skip to content

Commit 54a909d

Browse files
committed
updated DTOs
1 parent f8622cb commit 54a909d

File tree

4 files changed

+15
-14
lines changed

4 files changed

+15
-14
lines changed

WebApp/Components/Pages/AdminUsers.razor

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<PropertyColumn Property="u => u.Name" />
2121
<PropertyColumn Property="u => u.Username" />
2222
<PropertyColumn Property="u => u.BirthDate" />
23-
<PropertyColumn Property="u => u.BankAccounts.Count" Title="Accounts" />
23+
<PropertyColumn Property="u => u.BankAccounts == null ? 0 : u.BankAccounts.Count" Title="Accounts" />
2424
</Columns>
2525
<PagerContent>
2626
<MudDataGridPager T="UserDto" />

WebApp/DTOs/TransactionDTO.cs

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
namespace WebApp.DTOs;
2+
23
public class TransactionDto
3-
{
4-
public int Id { get; set; }
5-
public decimal Amount { get; set; }
6-
public DateTime TransactionDate { get; set; }
7-
public BankAccountDto From { get; set; }
8-
public BankAccountDto To { get; set; }
4+
{
5+
public required decimal Amount { get; init; }
6+
public required DateTime TransactionDate { get; init; }
7+
public required BankAccountDto From { get; init; }
8+
public required BankAccountDto To { get; init; }
99
}

WebApp/DTOs/UserDTO.cs

+6-5
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
namespace WebApp.DTOs;
2+
23
public class UserDto
34
{
4-
public string Username { get; set; }
5-
public string Name { get; set; }
6-
public DateTime BirthDate { get; set; }
7-
public ICollection<BankAccountDto> BankAccounts { get; set; }
8-
public ICollection<UserLoginDto> UserLogins { get; set; }
5+
public required string Username { get; init; }
6+
public required string Name { get; init; }
7+
public required DateTime BirthDate { get; init; }
8+
public ICollection<BankAccountDto>? BankAccounts { get; init; }
9+
public ICollection<UserLoginDto>? UserLogins { get; init; }
910
}

WebApp/DTOs/UserLoginDto.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ namespace WebApp.DTOs;
22

33
public class UserLoginDto
44
{
5-
public DateTime LoginDateTime { get; set; }
6-
public UserDto User { get; set; }
5+
public required DateTime LoginDateTime { get; init; }
6+
public required UserDto User { get; init; }
77
}

0 commit comments

Comments
 (0)