refactoring, improvements, fixes, etc...
This commit is contained in:
parent
93482b5ba6
commit
fa4b55f7e8
|
|
@ -9,9 +9,7 @@ using AyCode.Interfaces.Addresses.Dtos;
|
|||
[assembly: InternalsVisibleTo("AyCode.Database.Tests.Users.Internals.UserDbContext")]
|
||||
namespace AyCode.Core.Tests.Internal.Entities;
|
||||
|
||||
/// <summary>
|
||||
/// DON'T USE!!!
|
||||
/// </summary>
|
||||
|
||||
public class Address : AcAddress, IAcAddress, IAcAddressDtoBase
|
||||
{
|
||||
|
||||
|
|
|
|||
|
|
@ -8,9 +8,6 @@ using AyCode.Entities.ServiceProviders;
|
|||
|
||||
namespace AyCode.Core.Tests.Internal.Entities;
|
||||
|
||||
/// <summary>
|
||||
/// DON'T USE!!!
|
||||
/// </summary>
|
||||
public class Company : AcServiceProvider<User, UserToCompany>
|
||||
{
|
||||
|
||||
|
|
|
|||
|
|
@ -8,9 +8,6 @@ using AyCode.Entities.Messages;
|
|||
|
||||
namespace AyCode.Core.Tests.Internal.Entities;
|
||||
|
||||
/// <summary>
|
||||
/// DON'T USE!!!
|
||||
/// </summary>
|
||||
public class EmailMessage : AcEmailMessage<EmailRecipient>
|
||||
{
|
||||
|
||||
|
|
|
|||
|
|
@ -2,9 +2,6 @@
|
|||
|
||||
namespace AyCode.Core.Tests.Internal.Entities;
|
||||
|
||||
/// <summary>
|
||||
/// DON'T USE!!!
|
||||
/// </summary>
|
||||
public class EmailRecipient : AcEmailRecipient<EmailMessage>
|
||||
{
|
||||
public EmailRecipient()
|
||||
|
|
|
|||
|
|
@ -8,9 +8,6 @@ using AyCode.Entities.Profiles;
|
|||
|
||||
namespace AyCode.Core.Tests.Internal.Entities;
|
||||
|
||||
/// <summary>
|
||||
/// DON'T USE!!!
|
||||
/// </summary>
|
||||
public class Profile : AcProfile<Address>
|
||||
{
|
||||
|
||||
|
|
|
|||
|
|
@ -8,10 +8,15 @@ using AyCode.Entities.Users;
|
|||
|
||||
namespace AyCode.Core.Tests.Internal.Entities;
|
||||
|
||||
/// <summary>
|
||||
/// DON'T USE!!!
|
||||
/// </summary>
|
||||
|
||||
public class User : AcUser<Profile, Company, UserToCompany, Address>
|
||||
{
|
||||
|
||||
public User() { }
|
||||
public User(string email, string password) : this(Guid.NewGuid(), email, password) { }
|
||||
public User(Guid id, string email, string password) : base(id, email, password)
|
||||
{ }
|
||||
public User(Guid id, string email, string phoneNumber, string password) : base(id, email, phoneNumber, password)
|
||||
{ }
|
||||
public User(Guid id, string email, string phoneNumber, string password, string refreshToken) : base(id, email, phoneNumber, password, refreshToken)
|
||||
{ }
|
||||
}
|
||||
|
|
@ -8,9 +8,6 @@ using AyCode.Entities.Users;
|
|||
|
||||
namespace AyCode.Core.Tests.Internal.Entities;
|
||||
|
||||
/// <summary>
|
||||
/// DON'T USE!!!
|
||||
/// </summary>
|
||||
public class UserToCompany: AcUserToServiceProvider<User, Company>
|
||||
{
|
||||
|
||||
|
|
|
|||
|
|
@ -8,9 +8,6 @@ using AyCode.Entities.Users;
|
|||
|
||||
namespace AyCode.Core.Tests.Internal.Entities;
|
||||
|
||||
/// <summary>
|
||||
/// DON'T USE!!!
|
||||
/// </summary>
|
||||
public class UserToken : AcUserTokenBase
|
||||
{
|
||||
|
||||
|
|
|
|||
|
|
@ -1,24 +1,12 @@
|
|||
using Microsoft.Extensions.Configuration;
|
||||
using AyCode.Core.Consts;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
|
||||
namespace AyCode.Core.Tests;
|
||||
|
||||
public abstract class TestModelBase
|
||||
{
|
||||
protected IConfiguration AppSettingsConfiguration;
|
||||
|
||||
protected TestModelBase()
|
||||
{
|
||||
//if (IsProductVersion) throw new Exception("IsProductVersion!!!!!");
|
||||
|
||||
AppSettingsConfiguration = InitAppSettingsConfiguration();
|
||||
}
|
||||
|
||||
protected IConfiguration InitAppSettingsConfiguration(string appSettingsFileName = "appsettings.json")
|
||||
{
|
||||
var config = new ConfigurationBuilder()
|
||||
.AddJsonFile(appSettingsFileName)
|
||||
.AddEnvironmentVariables()
|
||||
.Build();
|
||||
return config;
|
||||
}
|
||||
}
|
||||
|
|
@ -15,6 +15,8 @@
|
|||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="8.0.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="8.0.0" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
||||
</ItemGroup>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
//using Anata.Logger;
|
||||
|
||||
using Microsoft.Extensions.Configuration;
|
||||
|
||||
namespace AyCode.Core.Consts
|
||||
{
|
||||
//TODO: Adatbázisból kéne a környezeti beállításokat - J.
|
||||
|
|
@ -18,5 +20,19 @@ namespace AyCode.Core.Consts
|
|||
//public static LogLevel LogLevel = LogLevel.Detail;
|
||||
|
||||
public static ulong MaxLogItemsPerSession = 250;
|
||||
|
||||
private static IConfiguration? _appConfiguration = null;
|
||||
public static IConfiguration AppConfiguration => _appConfiguration ??= GetAppSettingsConfiguration();
|
||||
|
||||
public static IConfiguration GetAppSettingsConfiguration(string appSettingsFileName = "appsettings.json")
|
||||
{
|
||||
var config = new ConfigurationBuilder()
|
||||
.AddJsonFile(appSettingsFileName)
|
||||
.AddEnvironmentVariables()
|
||||
.Build();
|
||||
|
||||
return config;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -9,6 +9,16 @@
|
|||
<IsTestProject>true</IsTestProject>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Remove="appsettings.json" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Content Include="appsettings.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="coverlet.collector" Version="6.0.2">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
|
|
|
|||
|
|
@ -1,9 +1,10 @@
|
|||
using AyCode.Database.DbContexts;
|
||||
using AyCode.Database.Tests.Internal.Users;
|
||||
|
||||
namespace AyCode.Database.Tests.Internal
|
||||
{
|
||||
[TestClass]
|
||||
public class DatabaseTestBase : AcDatabaseTestBase<AcDbContextBase>
|
||||
public class DatabaseTestBase : AcDatabaseTestBase<UserDbContext>
|
||||
{
|
||||
[TestInitialize]
|
||||
public void Setup()
|
||||
|
|
|
|||
|
|
@ -3,9 +3,6 @@ using AyCode.Database.DataLayers.Users;
|
|||
|
||||
namespace AyCode.Database.Tests.Internal.Users;
|
||||
|
||||
/// <summary>
|
||||
/// DON'T USE!!!
|
||||
/// </summary>
|
||||
public sealed class UserDal : AcUserDalBase<UserDbContext, User, Profile, UserToken, Company, UserToCompany, Address, EmailMessage>
|
||||
{
|
||||
|
||||
|
|
|
|||
|
|
@ -3,14 +3,22 @@ using AyCode.Database.Tests.Users;
|
|||
|
||||
namespace AyCode.Database.Tests.Internal.Users;
|
||||
|
||||
/// <summary>
|
||||
/// DON'T USE!!!
|
||||
/// </summary>
|
||||
[TestClass]
|
||||
public sealed class UserDalTests : AcUserDalTestBase<UserDal, UserDbContext, User, Profile, UserToken, Company, UserToCompany, Address, EmailMessage>
|
||||
{
|
||||
[TestMethod]
|
||||
[DataTestMethod]
|
||||
[DataRow("test@tiam.hu")]
|
||||
public override void AcBase_GetUserByEmail_ReturnsUser_WhenUserExists(string email)
|
||||
=> base.AcBase_GetUserByEmail_ReturnsUser_WhenUserExists(email);
|
||||
|
||||
[DataTestMethod]
|
||||
[DataRow("540271F6-C604-4C16-8160-D5A7CAFEDF00")]
|
||||
public override void AcBase_GetUserById_ReturnsUser_WhenUserExists(string userIdString)
|
||||
=> base.AcBase_GetUserById_ReturnsUser_WhenUserExists(userIdString);
|
||||
|
||||
[DataTestMethod]
|
||||
[DataRow(["e31044d7-1771-4a32-8dd9-6f9853ed53c6", "0a831191-70a3-4504-9ec4-c5902affaba7", "8eed080c-d2ce-4cc3-bcfe-2268c220bba7", "addUser_test9432@tiam.hu"])]
|
||||
public override async Task AcBase_AddUserTest(string[] userIdProfileIdAddressIdEmailStrings)
|
||||
=> await base.AcBase_AddUserTest(userIdProfileIdAddressIdEmailStrings);
|
||||
|
||||
}
|
||||
|
|
@ -4,9 +4,6 @@ using Microsoft.EntityFrameworkCore;
|
|||
|
||||
namespace AyCode.Database.Tests.Internal.Users;
|
||||
|
||||
/// <summary>
|
||||
/// DON'T USE!!!
|
||||
/// </summary>
|
||||
public sealed class UserDbContext : AcUserDbContextBase<User, Profile, UserToken, Company, UserToCompany, Address, EmailMessage>
|
||||
{
|
||||
public UserDbContext() //: this(string.Empty)
|
||||
|
|
@ -33,10 +30,6 @@ public sealed class UserDbContext : AcUserDbContextBase<User, Profile, UserToken
|
|||
|
||||
optionsBuilder.UseLazyLoadingProxies(true);
|
||||
optionsBuilder.EnableDetailedErrors(true);
|
||||
|
||||
//optionsBuilder.UseSqlServer(Configuration.GetConnectionString("DeveloperDbConnection"));
|
||||
var connString = "Data Source=185.51.190.197;Initial Catalog=TIAM_DEV;Trusted_Connection=false;Encrypt=false;TrustServerCertificate=True;Connect Timeout=200;User ID=Anata_Development_Team;Password=v6f_?xNfg9N1;MultipleActiveResultSets=true";
|
||||
optionsBuilder.UseSqlServer(connString);
|
||||
}
|
||||
|
||||
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"ConnectionStrings": {
|
||||
"DeveloperDbConnection": "Data Source=185.51.190.197;Initial Catalog=TIAM_DEV;Trusted_Connection=False;Connect Timeout=200;User ID=Anata_Development_Team;Password=v6f_?xNfg9N1;MultipleActiveResultSets=true"
|
||||
"DeveloperDbConnection": "Data Source=185.51.190.197;Initial Catalog=TIAM_DEV;Trusted_Connection=false;Encrypt=false;TrustServerCertificate=True;Connect Timeout=200;User ID=Anata_Development_Team;Password=v6f_?xNfg9N1;MultipleActiveResultSets=true"
|
||||
},
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
|
|
@ -9,16 +9,6 @@
|
|||
<IsTestProject>true</IsTestProject>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Remove="appsettings.json" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Content Include="appsettings.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.4" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="8.0.0" />
|
||||
|
|
|
|||
|
|
@ -24,7 +24,11 @@ namespace AyCode.Database.Tests.Users
|
|||
where TUserToServiceProvider : class, IAcUserToServiceProviderBase
|
||||
where TEmailMessage : class, IAcEmailMessageBase
|
||||
{
|
||||
protected TUser AcBase_GetUserById_ReturnsUser_WhenUserExists(string userIdString)
|
||||
[DataTestMethod]
|
||||
public virtual void AcBase_GetUserById_ReturnsUser_WhenUserExists(string userIdString) => AcBase_GetUserById(userIdString);
|
||||
|
||||
// ReSharper disable once MemberCanBePrivate.Global
|
||||
protected TUser AcBase_GetUserById(string userIdString)
|
||||
{
|
||||
var userId = Guid.Parse(userIdString);
|
||||
var user = Dal.GetUserById(userId, false);
|
||||
|
|
@ -38,8 +42,7 @@ namespace AyCode.Database.Tests.Users
|
|||
return user;
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
[DataRow("2test@tiam.hu")]
|
||||
[DataTestMethod]
|
||||
public virtual void AcBase_GetUserByEmail_ReturnsUser_WhenUserExists(string email) => AcBase_GetUserByEmail(email);
|
||||
|
||||
// ReSharper disable once MemberCanBePrivate.Global
|
||||
|
|
@ -77,5 +80,51 @@ namespace AyCode.Database.Tests.Users
|
|||
|
||||
return user;
|
||||
}
|
||||
|
||||
[DataTestMethod]
|
||||
public virtual async Task AcBase_AddUserTest(string[] userIdProfileIdAddressIdEmailStrings)
|
||||
{
|
||||
var userId = Guid.Parse(userIdProfileIdAddressIdEmailStrings[0]);
|
||||
var profileId = Guid.Parse(userIdProfileIdAddressIdEmailStrings[1]);
|
||||
var addressId = Guid.Parse(userIdProfileIdAddressIdEmailStrings[2]);
|
||||
var email = userIdProfileIdAddressIdEmailStrings[3];
|
||||
|
||||
var fromAddress = "Budapest, Liszt Ferenc tér";
|
||||
var toAddress = "1211 Budapest, Kossuth Lajos utca 145";
|
||||
//var userProductToCarId = Guid.Parse("97179a87-d99f-4f12-b7b2-75e21aaec6ab");
|
||||
|
||||
await Dal.RemoveUserAsync(userId); //kitöröljük a szemetet, ha korábbról bentmaradt - J.
|
||||
|
||||
var user = Activator.CreateInstance(typeof(TUser), userId, email, "235664", "dsfglfjg45r34903t3kggvq") as TUser;
|
||||
Assert.IsNotNull(user);
|
||||
|
||||
user.ProfileId = profileId;
|
||||
|
||||
var profile = Activator.CreateInstance<TProfile>();
|
||||
profile.Id = profileId;;
|
||||
profile.Name = "Add user test name";
|
||||
|
||||
var address = Activator.CreateInstance<TProfileAddress>();
|
||||
address.Id = addressId;
|
||||
address.Latitude = 5362.2341652256;
|
||||
address.Longitude = 5362.2341333317;
|
||||
address.AddressText = "1214 Kossuth Lajos utca 124.";
|
||||
|
||||
user.Profile = profile;
|
||||
user.Profile.AddressId = addressId;
|
||||
user.Profile.Address = address;
|
||||
|
||||
Assert.IsTrue(await Dal.AddUserAsync(user));
|
||||
user = Dal.GetUserById(userId, false);
|
||||
|
||||
Assert.IsNotNull(user);
|
||||
Assert.IsNotNull(user.Profile);
|
||||
Assert.IsNotNull(user.Profile.Address);
|
||||
|
||||
Assert.IsTrue(await Dal.RemoveUserAsync(userId)); //mielőbb kitöröljük, h ne maradjon szemét a db-ben - J.
|
||||
|
||||
user = Dal.GetUserById(userId, false);
|
||||
Assert.IsNull(user); //a korábbi törlés miatt NULL kell legyen - J.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,8 @@
|
|||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.4" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Proxies" Version="8.0.4" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.4" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration" Version="8.0.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
|||
|
|
@ -1,16 +1,21 @@
|
|||
using Microsoft.EntityFrameworkCore;
|
||||
using AyCode.Core.Consts;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using AyCode.Interfaces.TimeStampInfo;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
|
||||
|
||||
namespace AyCode.Database.DbContexts;
|
||||
|
||||
public abstract class AcDbContextBase : DbContext
|
||||
{
|
||||
private readonly string? _connString;
|
||||
public string Name { get; set; }
|
||||
|
||||
public Guid SessionId { get; protected set; } = Guid.NewGuid();
|
||||
|
||||
protected AcDbContextBase()
|
||||
{
|
||||
_connString = AcEnv.AppConfiguration.GetConnectionString("DeveloperDbConnection");
|
||||
//DbInterception.Add(new UtcDateTimeDbCommandInterceptor());
|
||||
}
|
||||
|
||||
|
|
@ -22,11 +27,15 @@ public abstract class AcDbContextBase : DbContext
|
|||
protected AcDbContextBase(DbContextOptions<DbContext> options, string name) : base(options)
|
||||
{
|
||||
Name = name;
|
||||
|
||||
_connString = AcEnv.AppConfiguration.GetConnectionString("DeveloperDbConnection");
|
||||
}
|
||||
|
||||
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
||||
{
|
||||
optionsBuilder.UseLazyLoadingProxies(true);
|
||||
|
||||
optionsBuilder.UseSqlServer(_connString);
|
||||
}
|
||||
|
||||
public override int SaveChanges()
|
||||
|
|
|
|||
|
|
@ -1,4 +1,6 @@
|
|||
using AyCode.Interfaces.Addresses;
|
||||
using AyCode.Database.ModelBuilders.Profiles;
|
||||
using AyCode.Database.ModelBuilders.Users;
|
||||
using AyCode.Interfaces.Addresses;
|
||||
using AyCode.Interfaces.Messages;
|
||||
using AyCode.Interfaces.Profiles;
|
||||
using AyCode.Interfaces.ServiceProviders;
|
||||
|
|
@ -11,7 +13,7 @@ namespace AyCode.Database.DbContexts.Users
|
|||
where TUser : class, IAcUser<TProfile, TServiceProvider, TUserToServiceProvider, TProfileAddress>
|
||||
where TProfile : class, IAcProfile<TProfileAddress>
|
||||
where TUserToken : class, IAcUserTokenBase
|
||||
where TServiceProvider : class, IAcServiceProviderBase
|
||||
where TServiceProvider : class, IAcServiceProvider<TUser, TUserToServiceProvider>//IAcServiceProviderBase
|
||||
where TUserToServiceProvider : class, IAcUserToServiceProviderBase
|
||||
where TProfileAddress : class, IAcAddress
|
||||
where TEmailMessage : class, IAcEmailMessageBase
|
||||
|
|
@ -32,5 +34,22 @@ namespace AyCode.Database.DbContexts.Users
|
|||
protected AcUserDbContextBase(DbContextOptions<DbContext> options, string name) : base(options, name)
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
||||
{
|
||||
base.OnConfiguring(optionsBuilder);
|
||||
|
||||
optionsBuilder.UseLazyLoadingProxies(true);
|
||||
}
|
||||
|
||||
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||
{
|
||||
base.OnModelCreating(modelBuilder);
|
||||
|
||||
new AcUserEntityTypeDefaultConfiguration<TUser, TProfile, TServiceProvider, TUserToServiceProvider, TProfileAddress>().Configure(modelBuilder.Entity<TUser>());
|
||||
new AcProfileEntityTypeDefaultConfiguration<TProfile, TProfileAddress>().Configure(modelBuilder.Entity<TProfile>());
|
||||
|
||||
//new EmailMessageEntityTypeDefaultConfigurations().Configure(modelBuilder.Entity<EmailMessage>());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,16 +7,12 @@ using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
|||
|
||||
namespace AyCode.Database.ModelBuilders.Profiles;
|
||||
|
||||
public abstract class AcProfileEntityTypeConfigurations
|
||||
public class AcProfileEntityTypeDefaultConfiguration<TProfile, TProfileAddress> : IAcEntityTypeConfiguration<TProfile>
|
||||
where TProfile : class, IAcProfile<TProfileAddress>
|
||||
where TProfileAddress : class, IAcAddress
|
||||
{
|
||||
public abstract class AcProfileEntityTypeDefaultConfiguration<TProfile, TProfileAddress> : IAcEntityTypeConfiguration<TProfile>
|
||||
where TProfile : class, IAcProfile<TProfileAddress>
|
||||
where TProfileAddress : class, IAcAddress
|
||||
public virtual void Configure(EntityTypeBuilder<TProfile> modelBuilder)
|
||||
{
|
||||
public virtual void Configure(EntityTypeBuilder<TProfile> modelBuilder)
|
||||
{
|
||||
modelBuilder.BuildEntityToAddressRelation<TProfile, TProfileAddress>();
|
||||
}
|
||||
modelBuilder.BuildEntityToAddressRelation<TProfile, TProfileAddress>();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
|||
|
||||
namespace AyCode.Database.ModelBuilders.Users;
|
||||
|
||||
public abstract class AcUserEntityTypeDefaultConfiguration<TUser, TProfile, TServiceProvider, TUserToServiceProvider, TProfileAddress> : IAcEntityTypeConfiguration<TUser>
|
||||
public 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>
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ using System.Net;
|
|||
|
||||
namespace AyCode.Interfaces.Addresses;
|
||||
|
||||
public interface IAcAddressRelation<TAddress> : IAcAddressForeignKey where TAddress : class, IAcAddress
|
||||
public interface IAcAddressRelation<TAddress> : IAcAddressForeignKey where TAddress : IAcAddress
|
||||
{
|
||||
public TAddress Address { get; set; }
|
||||
}
|
||||
|
|
@ -4,7 +4,7 @@ using AyCode.Interfaces.Profiles.Dtos;
|
|||
|
||||
namespace AyCode.Interfaces.Profiles;
|
||||
|
||||
public interface IAcProfile<TAddress> : IAcProfileDtoBase, ITimeStampInfo, IAcAddressRelation<TAddress> where TAddress : class, IAcAddress
|
||||
public interface IAcProfile<TAddress> : IAcProfileDtoBase, ITimeStampInfo, IAcAddressRelation<TAddress> where TAddress : IAcAddress
|
||||
{
|
||||
public string? GetFullName(string lang = "ENG");
|
||||
}
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
namespace AyCode.Interfaces.Profiles;
|
||||
|
||||
public interface IAcProfileRelation<TProfile> : IAcProfileForeignKey where TProfile : class, IAcProfileDtoBase
|
||||
public interface IAcProfileRelation<TProfile> : IAcProfileForeignKey where TProfile : IAcProfileDtoBase
|
||||
{
|
||||
public TProfile Profile { get; set; }
|
||||
}
|
||||
|
|
@ -3,6 +3,6 @@
|
|||
namespace AyCode.Interfaces.ServiceProviders;
|
||||
|
||||
public interface IAcServiceProvider<TUser, TUserToServiceProvider> : IAcServiceProviderBase, IAcUsersRelation<TUser, TUserToServiceProvider>
|
||||
where TUser : class, IAcUserBase
|
||||
where TUserToServiceProvider : class, IAcUserToServiceProviderBase
|
||||
where TUser : IAcUserBase
|
||||
where TUserToServiceProvider : IAcUserToServiceProviderBase
|
||||
{}
|
||||
|
|
@ -3,8 +3,8 @@
|
|||
namespace AyCode.Interfaces.ServiceProviders;
|
||||
|
||||
public interface IAcServiceProviderRelation<TServiceProvider, TUserToServiceProvider>
|
||||
where TServiceProvider : class, IAcServiceProviderBase
|
||||
where TUserToServiceProvider : class, IAcUserToServiceProviderBase
|
||||
where TServiceProvider : IAcServiceProviderBase
|
||||
where TUserToServiceProvider : IAcUserToServiceProviderBase
|
||||
{
|
||||
public List<TServiceProvider> ServiceProviders { get; set; }
|
||||
public List<TUserToServiceProvider> UserToServiceProviders { get; set; }
|
||||
|
|
|
|||
|
|
@ -5,9 +5,9 @@ using AyCode.Interfaces.Addresses;
|
|||
namespace AyCode.Interfaces.Users.Dtos;
|
||||
|
||||
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
|
||||
where TProfile : IAcProfile<TProfileAddress>
|
||||
where TServiceProvider : IAcServiceProviderBase
|
||||
where TUserToServiceProvider : IAcUserToServiceProviderBase
|
||||
where TProfileAddress : IAcAddress
|
||||
{
|
||||
}
|
||||
|
|
@ -5,9 +5,9 @@ using AyCode.Interfaces.ServiceProviders;
|
|||
namespace AyCode.Interfaces.Users.Dtos;
|
||||
|
||||
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
|
||||
where TProfile : IAcProfile<TProfileAddress>
|
||||
where TServiceProvider : IAcServiceProviderBase
|
||||
where TUserToServiceProvider : IAcUserToServiceProviderBase
|
||||
where TProfileAddress : IAcAddress
|
||||
{
|
||||
}
|
||||
|
|
@ -5,7 +5,7 @@ using AyCode.Interfaces.Profiles.Dtos;
|
|||
|
||||
namespace AyCode.Interfaces.Users.Dtos;
|
||||
|
||||
public interface IAcUserDtoMinBase<TProfile> : IEntityGuid, IAcProfileRelation<TProfile> where TProfile : class, IAcProfileDtoBase
|
||||
public interface IAcUserDtoMinBase<TProfile> : IEntityGuid, IAcProfileRelation<TProfile> where TProfile : IAcProfileDtoBase
|
||||
{
|
||||
public Guid AffiliateId { get; set; }
|
||||
}
|
||||
|
|
@ -6,9 +6,9 @@ using AyCode.Interfaces.Users.Dtos;
|
|||
|
||||
namespace AyCode.Interfaces.Users;
|
||||
|
||||
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
|
||||
public interface IAcUser<TProfile, TServiceProvider, TUserToServiceProvider, TProfileAddress> : IAcUserDtoDetailBase<TProfile, TServiceProvider, TUserToServiceProvider, TProfileAddress>, IAcProfileForeignKey
|
||||
where TProfile : IAcProfile<TProfileAddress>
|
||||
where TServiceProvider : IAcServiceProviderBase
|
||||
where TUserToServiceProvider : IAcUserToServiceProviderBase
|
||||
where TProfileAddress : IAcAddress
|
||||
{ }
|
||||
|
|
@ -1,8 +1,8 @@
|
|||
namespace AyCode.Interfaces.Users;
|
||||
|
||||
public interface IAcUsersRelation<TUser, TUserToServiceProvider>
|
||||
where TUser : class, IAcUserBase
|
||||
where TUserToServiceProvider : class, IAcUserToServiceProviderBase
|
||||
where TUser : IAcUserBase
|
||||
where TUserToServiceProvider : IAcUserToServiceProviderBase
|
||||
{
|
||||
public List<TUser> Users { get; set; }
|
||||
public List<TUserToServiceProvider> UserToServiceProviders { get; set; }
|
||||
|
|
|
|||
Loading…
Reference in New Issue