AyCode.Core/AyCode.Models/Users/AcUserModelDtoMinBase.cs

34 lines
1.2 KiB
C#

using AyCode.Interfaces.Addresses;
using AyCode.Interfaces.Profiles;
using AyCode.Interfaces.Profiles.Dtos;
using AyCode.Interfaces.Users;
using AyCode.Interfaces.Users.Dtos;
namespace AyCode.Models.Users;
public abstract class AcUserModelDtoMinBase<TUserDtoMin, TProfileDto> : AcModelDtoBase, IAcUserModelDtoMinBase
where TUserDtoMin : class, IAcUserDtoMinBase
//where TProfile : class, IAcProfileDtoBase
where TProfileDto : class, IAcProfileDtoBase
//where TAddress : class, IAcAddress
{
public TUserDtoMin UserDto { get; set;}
public TProfileDto ProfileDto { get; set; }
protected AcUserModelDtoMinBase() {}
protected AcUserModelDtoMinBase(IAcUserDtoMinBase<TProfileDto> user) : base(user.Id)
{
Id = user.Id;
UserDto = Activator.CreateInstance<TUserDtoMin>();
UserDto.Id = user.Id;
UserDto.AffiliateId = user.AffiliateId;
ProfileDto = Activator.CreateInstance<TProfileDto>();
ProfileDto.Id = user.Profile.Id;
ProfileDto.Name = user.Profile.Name;
ProfileDto.FirstName = user.Profile.FirstName;
ProfileDto.LastName = user.Profile.LastName;
//Profile.NickName = user.Profile.NickName;
}
}