52 lines
1.3 KiB
C#
52 lines
1.3 KiB
C#
using Nop.Core.Domain.Common;
|
|
using Nop.Core.Domain.Customers;
|
|
|
|
namespace Mango.Nop.Core.Dtos;
|
|
|
|
public class CustomerDto : ModelDtoBase<Customer>, ISoftDeletedEntity
|
|
{
|
|
public string Username { get; set; }
|
|
public string Email { get; set; }
|
|
public string FirstName { get; set; }
|
|
public string LastName { get; set; }
|
|
|
|
public string FullName => $"{LastName} {FirstName}";
|
|
|
|
public int RegisteredInStoreId { get; set; }
|
|
public bool Deleted { get; set; }
|
|
|
|
public CustomerDto() :base()
|
|
{ }
|
|
public CustomerDto(int customerId) : base(customerId)
|
|
{ }
|
|
|
|
public CustomerDto(Customer customer) : base(customer)
|
|
{
|
|
}
|
|
|
|
public override void CopyDtoValuesToEntity(Customer entity)
|
|
{
|
|
base.CopyDtoValuesToEntity(entity);
|
|
|
|
entity.Username = Username;
|
|
entity.FirstName = FirstName;
|
|
entity.LastName = LastName;
|
|
entity.Email = Email;
|
|
entity.RegisteredInStoreId = RegisteredInStoreId;
|
|
|
|
entity.Deleted = Deleted;
|
|
}
|
|
|
|
public override void CopyEntityValuesToDto(Customer entity)
|
|
{
|
|
base.CopyEntityValuesToDto(entity);
|
|
|
|
Username = entity.Username;
|
|
FirstName = entity.FirstName;
|
|
LastName = entity.LastName;
|
|
Email = entity.Email;
|
|
RegisteredInStoreId = entity.RegisteredInStoreId;
|
|
|
|
Deleted = entity.Deleted;
|
|
}
|
|
} |