43 lines
1.1 KiB
C#
43 lines
1.1 KiB
C#
using AyCode.Interfaces;
|
|
using TIAM.Entities.Profiles;
|
|
using TIAM.Entities.ServiceProviders;
|
|
using TIAM.Entities.Users;
|
|
|
|
namespace TIAM.Models.Dtos.Users;
|
|
|
|
public class UserDto : IUserDto<Profile, Company, UserToCompany>, IAcModelDtoBase<User>
|
|
{
|
|
public Guid Id { get; set; }
|
|
|
|
public Guid ProfileId { get; set; }
|
|
public Profile Profile { get; set; }
|
|
|
|
public Guid AffiliateId { get; set; }
|
|
|
|
public List<Company> ServiceProviders { get; set; }
|
|
public List<UserToCompany> UserToServiceProviders { get; set; }
|
|
|
|
public UserDto() {}
|
|
|
|
public UserDto(User user) : this()
|
|
{
|
|
//TODO: Models... - J.
|
|
throw new NotImplementedException("UserDto(User user)");
|
|
|
|
Id = user.Id;
|
|
ProfileId = user.ProfileId;
|
|
AffiliateId = AffiliateId;
|
|
}
|
|
|
|
public virtual User CreateMainEntity()
|
|
{
|
|
return new User
|
|
{
|
|
Id = Id,
|
|
ProfileId = ProfileId,
|
|
AffiliateId = AffiliateId,
|
|
ServiceProviders = ServiceProviders.ToList(),
|
|
UserToServiceProviders = UserToServiceProviders.ToList()
|
|
};
|
|
}
|
|
} |