AcUserModelDtoDetailBase Profile.Address...
This commit is contained in:
parent
42be674be7
commit
6275a35937
|
|
@ -7,26 +7,25 @@ using AyCode.Interfaces.Users.Dtos;
|
|||
|
||||
namespace AyCode.Models.Users;
|
||||
|
||||
public abstract class AcUserModelDtoBase<TUserDto, TProfile, TProfileDto, TCompany, TUserToServiceProvider, TProfileAddress> : AcUserModelDtoMinBase<TUserDto, TProfile, TProfileDto, TProfileAddress>, IAcCompanyRelation<TCompany, TUserToServiceProvider>
|
||||
where TUserDto : class, IAcUserDtoBase<TProfile, TCompany, TUserToServiceProvider, TProfileAddress>
|
||||
where TProfile : class, IAcProfile<TProfileAddress>
|
||||
public abstract class AcUserModelDtoBase<TUserDto, TProfile, TProfileDto, TCompany, TUserToServiceProvider, TAddress> : AcUserModelDtoMinBase<TUserDto, TProfile, TProfileDto, TAddress>, IAcCompanyRelation<TCompany, TUserToServiceProvider>
|
||||
where TUserDto : class, IAcUserDtoBase<TProfile, TCompany, TUserToServiceProvider, TAddress>
|
||||
where TProfile : class, IAcProfile<TAddress>
|
||||
where TProfileDto : class, IAcProfileDtoBase
|
||||
where TCompany : class, IAcCompanyBase
|
||||
where TUserToServiceProvider : class, IAcUserToCompanyBase
|
||||
where TProfileAddress : class, IAcAddress
|
||||
where TAddress : class, IAcAddress
|
||||
{
|
||||
public List<TCompany> ServiceProviders { get; set; }
|
||||
public List<TUserToServiceProvider> UserToServiceProviders { get; set; }
|
||||
|
||||
|
||||
protected AcUserModelDtoBase() {}
|
||||
protected AcUserModelDtoBase(IAcUserDtoBase<TProfile, TCompany, TUserToServiceProvider, TProfileAddress> user) : base(user)
|
||||
protected AcUserModelDtoBase(IAcUserDtoBase<TProfile, TCompany, TUserToServiceProvider, TAddress> user) : base(user)
|
||||
{
|
||||
Profile.AddressId = user.Profile.AddressId;
|
||||
UserDto.AffiliateId = user.AffiliateId;
|
||||
if (user.ServiceProviders.Count == 0) return;
|
||||
|
||||
|
||||
//így proxy error lesz... - J.
|
||||
//ServiceProviders = new List<TCompany>(user.ServiceProviders);
|
||||
//UserToServiceProviders = new List<TUserToServiceProvider>(user.UserToServiceProviders);
|
||||
|
|
|
|||
|
|
@ -7,17 +7,21 @@ using AyCode.Interfaces.Users.Dtos;
|
|||
|
||||
namespace AyCode.Models.Users;
|
||||
|
||||
public abstract class AcUserModelDtoDetailBase<TUserDtoDetail, TProfile, TProfileDto, TCompany, TUserToServiceProvider, TProfileAddress> : AcUserModelDtoBase<TUserDtoDetail, TProfile, TProfileDto, TCompany, TUserToServiceProvider, TProfileAddress>
|
||||
where TUserDtoDetail : class, IAcUserDtoDetailBase<TProfile, TCompany, TUserToServiceProvider, TProfileAddress>
|
||||
where TProfile : class, IAcProfile<TProfileAddress>
|
||||
public abstract class AcUserModelDtoDetailBase<TUserDtoDetail, TProfile, TProfileDto, TCompany, TUserToServiceProvider, TAddress> : AcUserModelDtoBase<TUserDtoDetail, TProfile, TProfileDto, TCompany, TUserToServiceProvider, TAddress>
|
||||
where TUserDtoDetail : class, IAcUserDtoDetailBase<TProfile, TCompany, TUserToServiceProvider, TAddress>
|
||||
where TProfile : class, IAcProfile<TAddress>
|
||||
where TProfileDto : class, IAcProfileDtoBase
|
||||
where TCompany : class, IAcCompanyBase
|
||||
where TUserToServiceProvider : class, IAcUserToCompanyBase
|
||||
where TProfileAddress : class, IAcAddress
|
||||
where TAddress : class, IAcAddress
|
||||
{
|
||||
protected AcUserModelDtoDetailBase() {}
|
||||
protected AcUserModelDtoDetailBase(IAcUserDtoDetailBase<TProfile, TCompany, TUserToServiceProvider, TProfileAddress> user) : base(user)
|
||||
protected AcUserModelDtoDetailBase(IAcUserDtoDetailBase<TProfile, TCompany, TUserToServiceProvider, TAddress> user) : base(user)
|
||||
{
|
||||
Profile.Address = Activator.CreateInstance<TAddress>();
|
||||
Profile.Address.Id = user.Profile.AddressId;
|
||||
|
||||
|
||||
UserDto.EmailAddress = user.EmailAddress;
|
||||
UserDto.PhoneNumber = user.PhoneNumber;
|
||||
UserDto.Created = user.Created;
|
||||
|
|
|
|||
|
|
@ -6,14 +6,14 @@ using AyCode.Interfaces.Users.Dtos;
|
|||
|
||||
namespace AyCode.Models.Users;
|
||||
|
||||
public abstract class AcUserModelDtoMinBase<TUserDtoMin, TProfile, TProfileDto, TProfileAddress> : AcModelDtoBase, IAcUserModelDtoMinBase
|
||||
public abstract class AcUserModelDtoMinBase<TUserDtoMin, TProfile, TProfileDto, TAddress> : AcModelDtoBase, IAcUserModelDtoMinBase
|
||||
where TUserDtoMin : class, IAcUserDtoMinBase<TProfile>
|
||||
where TProfile : class, IAcProfile<TProfileAddress>
|
||||
where TProfile : class, IAcProfile<TAddress>
|
||||
where TProfileDto : class, IAcProfileDtoBase
|
||||
where TProfileAddress : class, IAcAddress
|
||||
where TAddress : class, IAcAddress
|
||||
{
|
||||
public TUserDtoMin UserDto { get; set;}
|
||||
public TProfileDto? Profile { get; set; }
|
||||
public TProfile Profile { get; set; }
|
||||
|
||||
protected AcUserModelDtoMinBase() {}
|
||||
protected AcUserModelDtoMinBase(IAcUserDtoMinBase<TProfile> user) : base(user.Id)
|
||||
|
|
@ -24,7 +24,7 @@ public abstract class AcUserModelDtoMinBase<TUserDtoMin, TProfile, TProfileDto,
|
|||
UserDto.Id = user.Id;
|
||||
UserDto.AffiliateId = user.AffiliateId;
|
||||
|
||||
Profile = Activator.CreateInstance<TProfileDto>();
|
||||
Profile = Activator.CreateInstance<TProfile>();
|
||||
Profile.Id = user.Profile.Id;
|
||||
Profile.Name = user.Profile.Name;
|
||||
Profile.FirstName = user.Profile.FirstName;
|
||||
|
|
|
|||
Loading…
Reference in New Issue