Implement AcAddress; improvements, refactoring, fixes, etc...

This commit is contained in:
jozsef.b@aycode.com 2024-01-31 07:25:31 +01:00
parent 6b1f86ed43
commit 375ec42ea2
21 changed files with 135 additions and 58 deletions

View File

@ -1,17 +1,19 @@
using AyCode.Database.DataLayers.Users;
using AyCode.Database.DbContexts;
using AyCode.Database.DbContexts.Users;
using AyCode.Interfaces.Addresses;
using AyCode.Interfaces.Profiles;
using AyCode.Interfaces.ServiceProviders;
using AyCode.Interfaces.Users;
namespace AyCode.Database.Tests.Users
{
public abstract class AcUserDalTestBase<TDal, TDbContext, TUser, TProfile, TUserToken, TServiceProvider, TUserToServiceProvider> : AcDatabaseTestModelBase<TDal, TDbContext>
where TDal : AcUserDalBase<TDbContext, TUser, TProfile, TUserToken, TServiceProvider, TUserToServiceProvider>
where TDbContext : AcDbContextBase, IAcUserDbContextBase<TUser, TProfile, TUserToken,TServiceProvider, TUserToServiceProvider>
where TUser : class, IAcUser<TProfile, TServiceProvider, TUserToServiceProvider>
where TProfile : class, IAcProfile
public abstract class AcUserDalTestBase<TDal, TDbContext, TUser, TProfile, TUserToken, TServiceProvider, TUserToServiceProvider, TProfileAddress> : AcDatabaseTestModelBase<TDal, TDbContext>
where TDal : AcUserDalBase<TDbContext, TUser, TProfile, TUserToken, TServiceProvider, TUserToServiceProvider, TProfileAddress>
where TDbContext : AcDbContextBase, IAcUserDbContextBase<TUser, TProfile, TUserToken,TServiceProvider, TUserToServiceProvider, TProfileAddress>
where TUser : class, IAcUser<TProfile, TServiceProvider, TUserToServiceProvider, TProfileAddress>
where TProfile : class, IAcProfile<TProfileAddress>
where TProfileAddress : class, IAcAddress
where TUserToken : class, IAcUserTokenBase
where TServiceProvider : class, IAcServiceProviderBase
where TUserToServiceProvider : class, IAcUserToServiceProviderBase
@ -23,6 +25,7 @@ namespace AyCode.Database.Tests.Users
Assert.IsNotNull(user, "User is null");
Assert.IsNotNull(user.Profile, "Profile is null");
Assert.IsNotNull(user.Profile.Address, "Profile.Address is null");
Assert.AreEqual(userId, user.Id);
@ -35,6 +38,7 @@ namespace AyCode.Database.Tests.Users
Assert.IsNotNull(user, "User is null");
Assert.IsNotNull(user.Profile, "Profile is null");
Assert.IsNotNull(user.Profile.Address, "Profile.Address is null");
Assert.AreEqual(email, user.EmailAddress);
@ -56,6 +60,7 @@ namespace AyCode.Database.Tests.Users
Assert.IsNotNull(user, "User is null");
Assert.IsNotNull(user.Profile, "Profile is null");
Assert.IsNotNull(user.Profile.Address, "Profile.Address is null");
Assert.AreEqual(email, user.EmailAddress);

View File

@ -11,18 +11,20 @@ using Microsoft.EntityFrameworkCore;
using AyCode.Database.Extensions;
using AyCode.Core.Consts;
using AyCode.Database.DbSets.Users;
using AyCode.Interfaces.Addresses;
using AyCode.Interfaces.Profiles;
using AyCode.Interfaces.ServiceProviders;
namespace AyCode.Database.DataLayers.Users
{
public abstract class AcUserDalBase<TDbContext, TUser, TProfile, TUserToken, TServiceProvider, TUserToServiceProvider> : AcDalBase<TDbContext>
where TDbContext : AcDbContextBase, IAcUserDbContextBase<TUser, TProfile, TUserToken, TServiceProvider, TUserToServiceProvider>
where TUser : class, IAcUser<TProfile, TServiceProvider, TUserToServiceProvider>
where TProfile : class, IAcProfile
public abstract class AcUserDalBase<TDbContext, TUser, TProfile, TUserToken, TServiceProvider, TUserToServiceProvider, TProfileAddress> : AcDalBase<TDbContext>
where TDbContext : AcDbContextBase, IAcUserDbContextBase<TUser, TProfile, TUserToken, TServiceProvider, TUserToServiceProvider, TProfileAddress>
where TUser : class, IAcUser<TProfile, TServiceProvider, TUserToServiceProvider, TProfileAddress>
where TProfile : class, IAcProfile<TProfileAddress>
where TUserToken : class, IAcUserTokenBase
where TServiceProvider : class, IAcServiceProviderBase
where TUserToServiceProvider : class, IAcUserToServiceProviderBase
where TProfileAddress : class, IAcAddress
{
public TUser? GetUserById(Guid userId) => Session(x => x.GetUserById(userId));
public Task<TUser?> GetUserByIdAsync(Guid userId) => SessionAsync(x => x.GetUserById(userId));

View File

@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using AyCode.Interfaces.Addresses;
using AyCode.Interfaces.Profiles;
using AyCode.Interfaces.ServiceProviders;
using AyCode.Interfaces.Users;
@ -10,12 +11,13 @@ using Microsoft.EntityFrameworkCore;
namespace AyCode.Database.DbContexts.Users
{
public abstract class AcUserDbContextBase<TUser, TProfile, TUserToken, TServiceProvider, TUserToServiceProvider> : AcDbContextBase, IAcUserDbContextBase<TUser, TProfile, TUserToken, TServiceProvider, TUserToServiceProvider>
where TUser : class, IAcUser<TProfile, TServiceProvider, TUserToServiceProvider>
where TProfile : class, IAcProfile
public abstract class AcUserDbContextBase<TUser, TProfile, TUserToken, TServiceProvider, TUserToServiceProvider, TProfileAddress> : AcDbContextBase, IAcUserDbContextBase<TUser, TProfile, TUserToken, TServiceProvider, TUserToServiceProvider, TProfileAddress>
where TUser : class, IAcUser<TProfile, TServiceProvider, TUserToServiceProvider, TProfileAddress>
where TProfile : class, IAcProfile<TProfileAddress>
where TUserToken : class, IAcUserTokenBase
where TServiceProvider : class, IAcServiceProviderBase
where TUserToServiceProvider : class, IAcUserToServiceProviderBase
where TProfileAddress : class, IAcAddress
{
public required DbSet<TUser> Users { get; set; }
public required DbSet<TUserToken> UserTokens { get; set; }

View File

@ -1,4 +1,5 @@
using AyCode.Database.DbSets.Users;
using AyCode.Interfaces.Addresses;
using AyCode.Interfaces.Profiles;
using AyCode.Interfaces.ServiceProviders;
using AyCode.Interfaces.Users;
@ -6,11 +7,12 @@ using Microsoft.EntityFrameworkCore;
namespace AyCode.Database.DbContexts.Users;
public interface IAcUserDbContextBase<TUser, TProfile, TUserToken, TServiceProvider, TUserToServiceProvider> : IAcUserDbSet<TUser, TProfile, TServiceProvider, TUserToServiceProvider>, IAcUserTokenDbSet<TUserToken>
where TUser : class, IAcUser<TProfile, TServiceProvider, TUserToServiceProvider>
where TProfile : class, IAcProfile
public interface IAcUserDbContextBase<TUser, TProfile, TUserToken, TServiceProvider, TUserToServiceProvider, TProfileAddress> : IAcUserDbSet<TUser, TProfile, TServiceProvider, TUserToServiceProvider, TProfileAddress>, IAcUserTokenDbSet<TUserToken>
where TUser : class, IAcUser<TProfile, TServiceProvider, TUserToServiceProvider, TProfileAddress>
where TProfile : class, IAcProfile<TProfileAddress>
where TUserToken : class, IAcUserTokenBase
where TServiceProvider : class, IAcServiceProviderBase
where TUserToServiceProvider : class, IAcUserToServiceProviderBase
where TProfileAddress : class, IAcAddress
{
}

View File

@ -1,13 +1,15 @@
using AyCode.Database.DbContexts;
using AyCode.Interfaces.Addresses;
using AyCode.Interfaces.Profiles;
using AyCode.Interfaces.ServiceProviders;
using AyCode.Interfaces.Users;
namespace AyCode.Database.DbSets.Users;
public interface IAcUserDbSet<TUser, TProfile, TServiceProvider, TUserToServiceProvider> : IAcUserDbSetBase<TUser>
where TUser : class, IAcUser<TProfile, TServiceProvider, TUserToServiceProvider>
where TProfile : class, IAcProfile
public interface IAcUserDbSet<TUser, TProfile, TServiceProvider, TUserToServiceProvider, TProfileAddress> : IAcUserDbSetBase<TUser>
where TUser : class, IAcUser<TProfile, TServiceProvider, TUserToServiceProvider, TProfileAddress>
where TProfile : class, IAcProfile<TProfileAddress>
where TServiceProvider : class, IAcServiceProviderBase
where TUserToServiceProvider : class, IAcUserToServiceProviderBase
where TProfileAddress : class, IAcAddress
{ }

View File

@ -0,0 +1,17 @@
using AyCode.Interfaces.Addresses;
using AyCode.Interfaces.Profiles;
using AyCode.Interfaces.Profiles.Dtos;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
namespace AyCode.Database.ModelBuilders.Profiles;
public static class AcProfileEntityTypeBuilderExtensions
{
public static void BuildEntityToAddressRelation<TAddressRelation, TAddress>(this EntityTypeBuilder<TAddressRelation> modelBuilder, bool autoInclude = true)
where TAddressRelation : class, IAcAddressRelation<TAddress>
where TAddress : class, IAcAddress
{
//modelBuilder.HasOne(e => e.Address).WithOne().HasForeignKey<TAddressRelation>(e => e.AddressId);
modelBuilder.Navigation(e => e.Address).AutoInclude(autoInclude);
}
}

View File

@ -0,0 +1,22 @@
using AyCode.Database.DbContexts;
using AyCode.Interfaces.Addresses;
using AyCode.Interfaces.Profiles;
using AyCode.Interfaces.ServiceProviders;
using AyCode.Interfaces.Users;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
namespace AyCode.Database.ModelBuilders.Profiles;
public abstract class AcProfileEntityTypeConfigurations
{
public abstract class AcProfileEntityTypeDefaultConfiguration<TProfile, TProfileAddress> : IAcEntityTypeConfiguration<TProfile>
where TProfile : class, IAcProfile<TProfileAddress>
where TProfileAddress : class, IAcAddress
{
public virtual void Configure(EntityTypeBuilder<TProfile> modelBuilder)
{
modelBuilder.BuildEntityToAddressRelation<TProfile, TProfileAddress>();
}
}
}

View File

@ -2,7 +2,10 @@
using AyCode.Interfaces.Users;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using System.Formats.Tar;
using AyCode.Interfaces.Addresses;
using AyCode.Interfaces.Profiles.Dtos;
using AyCode.Interfaces.ServiceProviders;
using Microsoft.EntityFrameworkCore;
namespace AyCode.Database.ModelBuilders.Users;
@ -10,7 +13,7 @@ public static class AcUserEntityTypeBuilderExtensions
{
public static void BuildEntityToProfileRelation<TProfileRelation, TProfile>(this EntityTypeBuilder<TProfileRelation> modelBuilder, bool autoInclude = true)
where TProfileRelation : class, IAcProfileRelation<TProfile>
where TProfile : class, IAcProfile
where TProfile : class, IAcProfileDtoBase
{
modelBuilder.Navigation(e => e.Profile).AutoInclude(autoInclude);
}
@ -36,11 +39,4 @@ public static class AcUserEntityTypeBuilderExtensions
modelBuilder.Navigation(e => e.ServiceProviders).AutoInclude(autoInclude);
modelBuilder.Navigation(e => e.UserToServiceProviders).AutoInclude(autoInclude);
}
public static void BuildEntityToAddressRelation<TProfileRelation, TProfile>(this EntityTypeBuilder<TProfileRelation> modelBuilder)
where TProfileRelation : class, IAcProfileRelation<TProfile>
where TProfile : class, IAcProfile
{
//throw new NotImplementedException();
}
}

View File

@ -1,4 +1,5 @@
using AyCode.Database.DbContexts;
using AyCode.Interfaces.Addresses;
using AyCode.Interfaces.Profiles;
using AyCode.Interfaces.ServiceProviders;
using AyCode.Interfaces.Users;
@ -6,16 +7,17 @@ using Microsoft.EntityFrameworkCore.Metadata.Builders;
namespace AyCode.Database.ModelBuilders.Users;
public abstract class AcUserEntityTypeDefaultConfiguration<TUser, TProfile, TServiceProvider, TUserToServiceProvider> : IAcEntityTypeConfiguration<TUser>
where TUser : class, IAcUser<TProfile, TServiceProvider, TUserToServiceProvider>
where TProfile : class, IAcProfile
public abstract class AcUserEntityTypeDefaultConfiguration<TUser, TProfile, TServiceProvider, TUserToServiceProvider, TProfileAddress> : IAcEntityTypeConfiguration<TUser>
where TUser : class, IAcUser<TProfile, TServiceProvider, TUserToServiceProvider, TProfileAddress>
where TProfile : class, IAcProfile<TProfileAddress>
where TServiceProvider : class, IAcServiceProvider<TUser, TUserToServiceProvider>
where TUserToServiceProvider : class, IAcUserToServiceProviderBase
where TProfileAddress : class, IAcAddress
{
public virtual void Configure(EntityTypeBuilder<TUser> modelBuilder)
{
modelBuilder.BuildEntityToProfileRelation<TUser, TProfile>();
modelBuilder.BuildEntityToAddressRelation<TUser, TProfile>();
//modelBuilder.BuildEntityToAddressRelation<TProfileAddress, TProfile, TProfileAddress>();
modelBuilder.BuildEntityToServiceProviderRelation<TUser, TServiceProvider, TUserToServiceProvider>();
}
}

View File

@ -6,11 +6,12 @@ using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using AyCode.Interfaces.Addresses;
namespace AyCode.Entities.Profiles
{
[Table("Profile")]
public abstract class AcProfile : IAcProfile
public abstract class AcProfile<TAddress> : IAcProfile<TAddress> where TAddress : class, IAcAddress
{
protected AcProfile() { }
@ -23,6 +24,11 @@ namespace AyCode.Entities.Profiles
public Guid Id { get; set; }
public Guid? UserMediaId { get; set; }
[Required]
public Guid AddressId { get; set; }
[ForeignKey(nameof(AddressId))]
public virtual TAddress Address { get; set; }
[Required]
public string Name { get; set; }
public string? Description { get; set; }

View File

@ -8,6 +8,7 @@ using System.Threading.Tasks;
using AyCode.Interfaces.Profiles;
using AyCode.Interfaces.Users;
using AyCode.Entities.ServiceProviders;
using AyCode.Interfaces.Addresses;
using AyCode.Interfaces.ServiceProviders;
//- szétszedni az UserToServiceProvider és UserToProduct mapping list-eket külön interface-re
@ -16,10 +17,11 @@ using AyCode.Interfaces.ServiceProviders;
namespace AyCode.Entities.Users
{
[Table("Users")]
public abstract class AcUser<TProfile, TServiceProvider, TUserToServiceProvider>() : IAcUser<TProfile, TServiceProvider, TUserToServiceProvider>
where TProfile : class, IAcProfile
public abstract class AcUser<TProfile, TServiceProvider, TUserToServiceProvider, TProfileAddress>() : IAcUser<TProfile, TServiceProvider, TUserToServiceProvider, TProfileAddress>
where TProfile : class, IAcProfile<TProfileAddress>
where TServiceProvider : class, IAcServiceProviderBase
where TUserToServiceProvider : class, IAcUserToServiceProviderBase
where TProfileAddress : class, IAcAddress
{
[Key, DatabaseGenerated(DatabaseGeneratedOption.None)]
public Guid Id { get; set; }

View File

@ -1,9 +1,10 @@
using AyCode.Interfaces.Entities;
using AyCode.Interfaces.Addresses;
using AyCode.Interfaces.Entities;
using AyCode.Interfaces.MediaInfo;
namespace AyCode.Interfaces.Profiles.Dtos;
public interface IAcProfileDtoBase : IEntityGuid, IMediaInfo
public interface IAcProfileDtoBase : IEntityGuid, IMediaInfo, IAcAddressForeignKey
{
string Name { get; set; }
string? Description { get; set; }

View File

@ -1,4 +1,5 @@
using AyCode.Interfaces;
using AyCode.Interfaces.Addresses;
using AyCode.Interfaces.TimeStampInfo;
using AyCode.Interfaces.MediaInfo;
using AyCode.Interfaces.Entities;
@ -6,6 +7,6 @@ using AyCode.Interfaces.Profiles.Dtos;
namespace AyCode.Interfaces.Profiles;
public interface IAcProfile : IAcProfileDtoBase, ITimeStampInfo
public interface IAcProfile<TAddress> : IAcProfileDtoBase, ITimeStampInfo, IAcAddressRelation<TAddress> where TAddress : class, IAcAddress
{
}

View File

@ -1,10 +1,11 @@
using AyCode.Interfaces.TimeStampInfo;
using AyCode.Interfaces.Users.Dtos;
using AyCode.Interfaces.Users;
using AyCode.Interfaces.Profiles.Dtos;
namespace AyCode.Interfaces.Profiles;
public interface IAcProfileRelation<TProfile> : IAcProfileForeignKey where TProfile : class, IAcProfile
public interface IAcProfileRelation<TProfile> : IAcProfileForeignKey where TProfile : class, IAcProfileDtoBase
{
public TProfile Profile { get; set; }
}

View File

@ -1,12 +1,16 @@
using AyCode.Interfaces.Entities;
using AyCode.Interfaces.Profiles;
using AyCode.Interfaces.Profiles.Dtos;
using AyCode.Interfaces.ServiceProviders;
using System.Net;
using AyCode.Interfaces.Addresses;
namespace AyCode.Interfaces.Users.Dtos;
public interface IAcUserDtoBase<TProfile, TServiceProvider, TUserToServiceProvider> : IAcUserDtoMinBase<TProfile>, IAcServiceProviderRelation<TServiceProvider, TUserToServiceProvider>
where TProfile : class, IAcProfile
public interface IAcUserDtoBase<TProfile, TServiceProvider, TUserToServiceProvider, TProfileAddress> : IAcUserDtoMinBase<TProfile>, IAcServiceProviderRelation<TServiceProvider, TUserToServiceProvider>
where TProfile : class, IAcProfile<TProfileAddress>
where TServiceProvider : class, IAcServiceProviderBase
where TUserToServiceProvider : class, IAcUserToServiceProviderBase
where TProfileAddress : class, IAcAddress
{
}

View File

@ -1,12 +1,14 @@
using AyCode.Interfaces.Entities;
using AyCode.Interfaces.Addresses;
using AyCode.Interfaces.Entities;
using AyCode.Interfaces.Profiles;
using AyCode.Interfaces.ServiceProviders;
namespace AyCode.Interfaces.Users.Dtos;
public interface IAcUserDtoDetailBase<TProfile, TServiceProvider, TUserToServiceProvider> : IAcUserBase, IAcUserDtoBase<TProfile, TServiceProvider, TUserToServiceProvider>
where TProfile : class, IAcProfile
public interface IAcUserDtoDetailBase<TProfile, TServiceProvider, TUserToServiceProvider, TProfileAddress> : IAcUserBase, IAcUserDtoBase<TProfile, TServiceProvider, TUserToServiceProvider, TProfileAddress>
where TProfile : class, IAcProfile<TProfileAddress>
where TServiceProvider : class, IAcServiceProviderBase
where TUserToServiceProvider : class, IAcUserToServiceProviderBase
where TProfileAddress : class, IAcAddress
{
}

View File

@ -1,10 +1,11 @@

using AyCode.Interfaces.Entities;
using AyCode.Interfaces.Profiles;
using AyCode.Interfaces.Profiles.Dtos;
namespace AyCode.Interfaces.Users.Dtos;
public interface IAcUserDtoMinBase<TProfile> : IEntityGuid, IAcProfileRelation<TProfile> where TProfile : class, IAcProfile
public interface IAcUserDtoMinBase<TProfile> : IEntityGuid, IAcProfileRelation<TProfile> where TProfile : class, IAcProfileDtoBase
{
public Guid AffiliateId { get; set; }
}

View File

@ -1,13 +1,16 @@

using AyCode.Interfaces.Addresses;
using AyCode.Interfaces.Entities;
using AyCode.Interfaces.Profiles;
using AyCode.Interfaces.Profiles.Dtos;
using AyCode.Interfaces.ServiceProviders;
using AyCode.Interfaces.Users.Dtos;
namespace AyCode.Interfaces.Users;
public interface IAcUser<TProfile, TServiceProvider, TUserToServiceProvider> : IAcUserDtoDetailBase<TProfile, TServiceProvider, TUserToServiceProvider>
where TProfile : class, IAcProfile
public interface IAcUser<TProfile, TServiceProvider, TUserToServiceProvider, TProfileAddress> : IAcUserDtoDetailBase<TProfile, TServiceProvider, TUserToServiceProvider, TProfileAddress>
where TProfile : class, IAcProfile<TProfileAddress>
where TServiceProvider : class, IAcServiceProviderBase
where TUserToServiceProvider : class, IAcUserToServiceProviderBase
where TProfileAddress : class, IAcAddress
{ }

View File

@ -1,4 +1,5 @@
using AyCode.Interfaces.Profiles;
using AyCode.Interfaces.Addresses;
using AyCode.Interfaces.Profiles;
using AyCode.Interfaces.Profiles.Dtos;
using AyCode.Interfaces.ServiceProviders;
using AyCode.Interfaces.Users;
@ -6,19 +7,20 @@ using AyCode.Interfaces.Users.Dtos;
namespace AyCode.Models.Users;
public abstract class AcUserModelDtoBase<TUserDto, TProfile, TProfileDto, TServiceProvider, TUserToServiceProvider> : AcUserModelDtoMinBase<TUserDto, TProfile, TProfileDto>, IAcServiceProviderRelation<TServiceProvider, TUserToServiceProvider>
where TUserDto : class, IAcUserDtoBase<TProfile, TServiceProvider, TUserToServiceProvider>
where TProfile : class, IAcProfile
public abstract class AcUserModelDtoBase<TUserDto, TProfile, TProfileDto, TServiceProvider, TUserToServiceProvider, TProfileAddress> : AcUserModelDtoMinBase<TUserDto, TProfile, TProfileDto, TProfileAddress>, IAcServiceProviderRelation<TServiceProvider, TUserToServiceProvider>
where TUserDto : class, IAcUserDtoBase<TProfile, TServiceProvider, TUserToServiceProvider, TProfileAddress>
where TProfile : class, IAcProfile<TProfileAddress>
where TProfileDto : class, IAcProfileDtoBase
where TServiceProvider : class, IAcServiceProviderBase
where TUserToServiceProvider : class, IAcUserToServiceProviderBase
where TProfileAddress : class, IAcAddress
{
public List<TServiceProvider> ServiceProviders { get; set; }
public List<TUserToServiceProvider> UserToServiceProviders { get; set; }
protected AcUserModelDtoBase() {}
protected AcUserModelDtoBase(IAcUserDtoBase<TProfile, TServiceProvider, TUserToServiceProvider> user) : base(user)
protected AcUserModelDtoBase(IAcUserDtoBase<TProfile, TServiceProvider, TUserToServiceProvider, TProfileAddress> user) : base(user)
{
if (user.ServiceProviders.Count == 0) return;

View File

@ -1,4 +1,5 @@
using AyCode.Interfaces.Profiles;
using AyCode.Interfaces.Addresses;
using AyCode.Interfaces.Profiles;
using AyCode.Interfaces.Profiles.Dtos;
using AyCode.Interfaces.ServiceProviders;
using AyCode.Interfaces.Users;
@ -6,15 +7,16 @@ using AyCode.Interfaces.Users.Dtos;
namespace AyCode.Models.Users;
public abstract class AcUserModelDtoDetailBase<TUserDtoDetail, TProfile, TProfileDto, TServiceProvider, TUserToServiceProvider> : AcUserModelDtoBase<TUserDtoDetail, TProfile, TProfileDto, TServiceProvider, TUserToServiceProvider>
where TUserDtoDetail : class, IAcUserDtoDetailBase<TProfile, TServiceProvider, TUserToServiceProvider>
where TProfile : class, IAcProfile
public abstract class AcUserModelDtoDetailBase<TUserDtoDetail, TProfile, TProfileDto, TServiceProvider, TUserToServiceProvider, TProfileAddress> : AcUserModelDtoBase<TUserDtoDetail, TProfile, TProfileDto, TServiceProvider, TUserToServiceProvider, TProfileAddress>
where TUserDtoDetail : class, IAcUserDtoDetailBase<TProfile, TServiceProvider, TUserToServiceProvider, TProfileAddress>
where TProfile : class, IAcProfile<TProfileAddress>
where TProfileDto : class, IAcProfileDtoBase
where TServiceProvider : class, IAcServiceProviderBase
where TUserToServiceProvider : class, IAcUserToServiceProviderBase
where TProfileAddress : class, IAcAddress
{
protected AcUserModelDtoDetailBase() {}
protected AcUserModelDtoDetailBase(IAcUserDtoDetailBase<TProfile, TServiceProvider, TUserToServiceProvider> user) : base(user)
protected AcUserModelDtoDetailBase(IAcUserDtoDetailBase<TProfile, TServiceProvider, TUserToServiceProvider, TProfileAddress> user) : base(user)
{
}
}

View File

@ -1,14 +1,16 @@
using AyCode.Interfaces.Profiles;
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, TProfile, TProfileDto> : AcModelDtoBase
public abstract class AcUserModelDtoMinBase<TUserDtoMin, TProfile, TProfileDto, TProfileAddress> : AcModelDtoBase
where TUserDtoMin : class, IAcUserDtoMinBase<TProfile>
where TProfile : class, IAcProfile
where TProfile : class, IAcProfile<TProfileAddress>
where TProfileDto : class, IAcProfileDtoBase
where TProfileAddress : class, IAcAddress
{
public TUserDtoMin UserDto { get; set;}
public TProfileDto? Profile { get; set; }