25 lines
567 B
C#
25 lines
567 B
C#
|
using Contracts.DTO;
|
||
|
using Infrastructure.Models;
|
||
|
|
||
|
namespace Infrastructure.Support.Mappers;
|
||
|
|
||
|
public static class UserMapper
|
||
|
{
|
||
|
public static UserDto ToDto(this User user)
|
||
|
=> new()
|
||
|
{
|
||
|
Id = user.Id,
|
||
|
Name = user.Name,
|
||
|
Balance = user.Balance,
|
||
|
Password = user.Password
|
||
|
};
|
||
|
|
||
|
public static User ToModel(this UserDto user)
|
||
|
=> new()
|
||
|
{
|
||
|
Id = user.Id,
|
||
|
Name = user.Name,
|
||
|
Balance = user.Balance,
|
||
|
Password = user.Password
|
||
|
};
|
||
|
}
|