diff --git a/AyCode.Models/AcModelDtoBase.cs b/AyCode.Models/AcModelDtoBase.cs index 2efdb34..2d3d483 100644 --- a/AyCode.Models/AcModelDtoBase.cs +++ b/AyCode.Models/AcModelDtoBase.cs @@ -13,12 +13,15 @@ public abstract class AcModelDtoBase : IAcModelDtoBase public abstract class AcModelDtoBase : AcModelDtoBase, IAcModelDtoBase where TMainEntity : IEntityGuid { - protected AcModelDtoBase() { } - protected AcModelDtoBase(Guid id) : this() => Id = id; + protected AcModelDtoBase() : base() { } + protected AcModelDtoBase(Guid id) : base(id) { } protected AcModelDtoBase(TMainEntity mainEntity) : this(mainEntity.Id) { } public virtual TMainEntity CreateMainEntity() { - throw new NotImplementedException(); + var mainEntity = Activator.CreateInstance(); + mainEntity.Id = Id; + + return mainEntity; } } \ No newline at end of file diff --git a/AyCode.Models/Users/AcUserModelDtoMinBase.cs b/AyCode.Models/Users/AcUserModelDtoMinBase.cs index 7a5261d..d393d68 100644 --- a/AyCode.Models/Users/AcUserModelDtoMinBase.cs +++ b/AyCode.Models/Users/AcUserModelDtoMinBase.cs @@ -6,7 +6,7 @@ using AyCode.Interfaces.Users.Dtos; namespace AyCode.Models.Users; -public abstract class AcUserModelDtoMinBase : AcModelDtoBase, IAcUserModelDtoMinBase +public abstract class AcUserModelDtoMinBase : AcModelDtoBase, /*AcModelDtoBase>,*/ IAcUserModelDtoMinBase where TUserDtoMin : class, IAcUserDtoMinBase //where TProfile : class, IAcProfileDtoBase where TProfileDto : class, IAcProfileDtoBase @@ -31,4 +31,15 @@ public abstract class AcUserModelDtoMinBase : AcModelD ProfileDto.LastName = user.Profile.LastName; //Profile.NickName = user.Profile.NickName; } + + //public virtual TUserDtoMin CreateMainEntity() + //{ + // var user = base.CreateMainEntity(); + + // user.AffiliateId = UserDto.AffiliateId; + // user.ProfileId = ProfileDto.Id; + + // user.Profile = Activator.CreateInstance<>() + + //} } \ No newline at end of file