2024-11-25 17:51:16 +04:00
|
|
|
using System.Reflection.Metadata.Ecma335;
|
|
|
|
using Contracts.DTO;
|
|
|
|
|
|
|
|
namespace Infrastructure.Models;
|
|
|
|
|
|
|
|
public class User
|
|
|
|
{
|
|
|
|
public Guid Id { get; set; }
|
|
|
|
public string Name { get; set; } = null!;
|
|
|
|
public string Password { get; set; } = null!;
|
|
|
|
public decimal Balance { get; set; }
|
2024-11-26 20:23:59 +04:00
|
|
|
public List<SpendingGroup>? SpendingGroups { get; set; }
|
2024-11-25 17:51:16 +04:00
|
|
|
|
|
|
|
public void Update(UserDto userDto)
|
|
|
|
{
|
|
|
|
Id = userDto.Id;
|
|
|
|
if (!string.IsNullOrWhiteSpace(userDto.Name))
|
|
|
|
{
|
|
|
|
Name = userDto.Name;
|
|
|
|
}
|
|
|
|
if (!string.IsNullOrWhiteSpace(userDto.Password))
|
|
|
|
{
|
|
|
|
Password = userDto.Password;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|