diff --git a/aspnet-core/CompanyName.ProjectName.sln b/aspnet-core/CompanyName.ProjectName.sln index 97d91200..085e899f 100644 --- a/aspnet-core/CompanyName.ProjectName.sln +++ b/aspnet-core/CompanyName.ProjectName.sln @@ -139,8 +139,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Lion.Abp.Cap", "frameworks\ EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Lion.Abp.Extension", "frameworks\Extensions\src\Lion.Abp.Extension\Lion.Abp.Extension.csproj", "{6848FA46-EFFF-4E0C-8EAA-145D8C440333}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Lion.Abp.Domain", "frameworks\Extensions\src\Lion.Abp.Domain\Lion.Abp.Domain.csproj", "{1EF5EF2B-323C-4DB0-B08A-37312A68E9DB}" -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "gateways", "gateways", "{5C304CBC-F30D-413C-A0AF-8B6814A2D4A3}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CompanyName.ProjectName.PublicGateway", "gateways\CompanyName.ProjectName.PublicGateway\CompanyName.ProjectName.PublicGateway.csproj", "{870364BA-DD5C-4597-9047-BD8A0CA1CFBA}" @@ -331,10 +329,6 @@ Global {6848FA46-EFFF-4E0C-8EAA-145D8C440333}.Debug|Any CPU.Build.0 = Debug|Any CPU {6848FA46-EFFF-4E0C-8EAA-145D8C440333}.Release|Any CPU.ActiveCfg = Release|Any CPU {6848FA46-EFFF-4E0C-8EAA-145D8C440333}.Release|Any CPU.Build.0 = Release|Any CPU - {1EF5EF2B-323C-4DB0-B08A-37312A68E9DB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {1EF5EF2B-323C-4DB0-B08A-37312A68E9DB}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1EF5EF2B-323C-4DB0-B08A-37312A68E9DB}.Release|Any CPU.ActiveCfg = Release|Any CPU - {1EF5EF2B-323C-4DB0-B08A-37312A68E9DB}.Release|Any CPU.Build.0 = Release|Any CPU {870364BA-DD5C-4597-9047-BD8A0CA1CFBA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {870364BA-DD5C-4597-9047-BD8A0CA1CFBA}.Debug|Any CPU.Build.0 = Debug|Any CPU {870364BA-DD5C-4597-9047-BD8A0CA1CFBA}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -412,7 +406,6 @@ Global {48D938A1-36E4-4AC1-9AF2-645CB75D4A05} = {1A57338B-65B1-4B8F-ABBD-83F4E8321D8F} {800F4482-EAC3-472B-AF07-53980D47AA41} = {11ED8435-B5AE-4BF3-9D4B-51FA1E4A18A6} {6848FA46-EFFF-4E0C-8EAA-145D8C440333} = {C4AC9352-C9F5-4096-8D73-13638232CFB9} - {1EF5EF2B-323C-4DB0-B08A-37312A68E9DB} = {C4AC9352-C9F5-4096-8D73-13638232CFB9} {870364BA-DD5C-4597-9047-BD8A0CA1CFBA} = {5C304CBC-F30D-413C-A0AF-8B6814A2D4A3} {D9108313-8D05-4F5F-9AA0-B443EC3374B6} = {5C304CBC-F30D-413C-A0AF-8B6814A2D4A3} {FC30B17B-F671-4E55-90C6-9F37E40B483D} = {CA9AC87F-097E-4F15-8393-4BC07735A5B0} diff --git a/aspnet-core/frameworks/Extensions/src/Lion.Abp.Domain/Lion.Abp.Domain.csproj b/aspnet-core/frameworks/Extensions/src/Lion.Abp.Domain/Lion.Abp.Domain.csproj deleted file mode 100644 index a34a15b3..00000000 --- a/aspnet-core/frameworks/Extensions/src/Lion.Abp.Domain/Lion.Abp.Domain.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - net5.0 - - - - - - - - diff --git a/aspnet-core/frameworks/Extensions/src/Lion.Abp.Domain/LionAbpDomainModule.cs b/aspnet-core/frameworks/Extensions/src/Lion.Abp.Domain/LionAbpDomainModule.cs deleted file mode 100644 index 24820528..00000000 --- a/aspnet-core/frameworks/Extensions/src/Lion.Abp.Domain/LionAbpDomainModule.cs +++ /dev/null @@ -1,13 +0,0 @@ -using Volo.Abp.Domain; -using Volo.Abp.Modularity; -using Volo.Abp.ObjectMapping; - -namespace Lion.Abp.Domain -{ - [DependsOn( - typeof(AbpDddDomainModule), - typeof(AbpObjectMappingModule))] - public class LionAbpDomainModule : AbpModule - { - } -} \ No newline at end of file diff --git a/aspnet-core/modules/DataDictionaryManagement/src/CompanyName.ProjectName.DataDictionaryManagement.Domain/CompanyName.ProjectName.DataDictionaryManagement.Domain.csproj b/aspnet-core/modules/DataDictionaryManagement/src/CompanyName.ProjectName.DataDictionaryManagement.Domain/CompanyName.ProjectName.DataDictionaryManagement.Domain.csproj index 8a63951d..ab34e685 100644 --- a/aspnet-core/modules/DataDictionaryManagement/src/CompanyName.ProjectName.DataDictionaryManagement.Domain/CompanyName.ProjectName.DataDictionaryManagement.Domain.csproj +++ b/aspnet-core/modules/DataDictionaryManagement/src/CompanyName.ProjectName.DataDictionaryManagement.Domain/CompanyName.ProjectName.DataDictionaryManagement.Domain.csproj @@ -9,7 +9,6 @@ - diff --git a/aspnet-core/modules/DataDictionaryManagement/src/CompanyName.ProjectName.DataDictionaryManagement.Domain/DataDictionaries/DataDictionaryManager.cs b/aspnet-core/modules/DataDictionaryManagement/src/CompanyName.ProjectName.DataDictionaryManagement.Domain/DataDictionaries/DataDictionaryManager.cs index 6181438b..f435224a 100644 --- a/aspnet-core/modules/DataDictionaryManagement/src/CompanyName.ProjectName.DataDictionaryManagement.Domain/DataDictionaries/DataDictionaryManager.cs +++ b/aspnet-core/modules/DataDictionaryManagement/src/CompanyName.ProjectName.DataDictionaryManagement.Domain/DataDictionaries/DataDictionaryManager.cs @@ -8,7 +8,7 @@ using Volo.Abp.Domain.Services; namespace CompanyName.ProjectName.DataDictionaryManagement.DataDictionaries { - public class DataDictionaryManager : DomainService + public class DataDictionaryManager : DataDictionaryDomainService { private readonly IDataDictionaryRepository _dataDictionaryRepository; diff --git a/aspnet-core/modules/DataDictionaryManagement/src/CompanyName.ProjectName.DataDictionaryManagement.Domain/DataDictionaryDomainService.cs b/aspnet-core/modules/DataDictionaryManagement/src/CompanyName.ProjectName.DataDictionaryManagement.Domain/DataDictionaryDomainService.cs new file mode 100644 index 00000000..8787ce7a --- /dev/null +++ b/aspnet-core/modules/DataDictionaryManagement/src/CompanyName.ProjectName.DataDictionaryManagement.Domain/DataDictionaryDomainService.cs @@ -0,0 +1,36 @@ +using System; +using Microsoft.Extensions.DependencyInjection; +using Volo.Abp.Domain.Services; +using Volo.Abp.EventBus.Distributed; +using Volo.Abp.ObjectMapping; +using Volo.Abp.Uow; + +namespace CompanyName.ProjectName.DataDictionaryManagement +{ + public abstract class DataDictionaryDomainService : DomainService + { + protected Type ObjectMapperContext { get; set; } + + /// + /// 工作单元管理器 + /// + protected IUnitOfWorkManager UnitOfWorkManager => + LazyServiceProvider.LazyGetRequiredService(); + + /// + /// 分布式事件总线 + /// + protected IDistributedEventBus DistributedEventBus => + LazyServiceProvider.LazyGetRequiredService(); + + /// + /// 对象映射器 + /// + protected IObjectMapper ObjectMapper => LazyServiceProvider.LazyGetService( + provider => + ObjectMapperContext == null + ? provider.GetRequiredService() + : (IObjectMapper)provider.GetRequiredService( + typeof(IObjectMapper<>).MakeGenericType(ObjectMapperContext))); + } +} \ No newline at end of file diff --git a/aspnet-core/modules/DataDictionaryManagement/src/CompanyName.ProjectName.DataDictionaryManagement.Domain/DataDictionaryManagementDomainModule.cs b/aspnet-core/modules/DataDictionaryManagement/src/CompanyName.ProjectName.DataDictionaryManagement.Domain/DataDictionaryManagementDomainModule.cs index a4155a49..0cc1c567 100644 --- a/aspnet-core/modules/DataDictionaryManagement/src/CompanyName.ProjectName.DataDictionaryManagement.Domain/DataDictionaryManagementDomainModule.cs +++ b/aspnet-core/modules/DataDictionaryManagement/src/CompanyName.ProjectName.DataDictionaryManagement.Domain/DataDictionaryManagementDomainModule.cs @@ -1,13 +1,11 @@ -using Lion.Abp.Domain; -using Volo.Abp.Domain; +using Volo.Abp.Domain; using Volo.Abp.Modularity; namespace CompanyName.ProjectName.DataDictionaryManagement { [DependsOn( typeof(AbpDddDomainModule), - typeof(DataDictionaryManagementDomainSharedModule), - typeof(LionAbpDomainModule) + typeof(DataDictionaryManagementDomainSharedModule) )] public class DataDictionaryManagementDomainModule : AbpModule { diff --git a/aspnet-core/modules/DataDictionaryManagement/src/CompanyName.ProjectName.DataDictionaryManagement.EntityFrameworkCore/EntityFrameworkCore/DataDictionaryManagementDbContextModelCreatingExtensions.cs b/aspnet-core/modules/DataDictionaryManagement/src/CompanyName.ProjectName.DataDictionaryManagement.EntityFrameworkCore/EntityFrameworkCore/DataDictionaryManagementDbContextModelCreatingExtensions.cs index 359394c4..15c1fc86 100644 --- a/aspnet-core/modules/DataDictionaryManagement/src/CompanyName.ProjectName.DataDictionaryManagement.EntityFrameworkCore/EntityFrameworkCore/DataDictionaryManagementDbContextModelCreatingExtensions.cs +++ b/aspnet-core/modules/DataDictionaryManagement/src/CompanyName.ProjectName.DataDictionaryManagement.EntityFrameworkCore/EntityFrameworkCore/DataDictionaryManagementDbContextModelCreatingExtensions.cs @@ -9,20 +9,9 @@ namespace CompanyName.ProjectName.DataDictionaryManagement.EntityFrameworkCore public static class DataDictionaryManagementDbContextModelCreatingExtensions { public static void ConfigureDataDictionaryManagement( - this ModelBuilder builder, - Action optionsAction = null) + this ModelBuilder builder) { Check.NotNull(builder, nameof(builder)); - - var options = new DataDictionaryManagementModelBuilderConfigurationOptions( - DataDictionaryManagementDbProperties.DbTablePrefix, - DataDictionaryManagementDbProperties.DbSchema - ); - - optionsAction?.Invoke(options); - - - builder.Entity(b => { diff --git a/aspnet-core/modules/NotificationManagement/src/CompanyName.ProjectName.NotificationManagement.Domain/CompanyName.ProjectName.NotificationManagement.Domain.csproj b/aspnet-core/modules/NotificationManagement/src/CompanyName.ProjectName.NotificationManagement.Domain/CompanyName.ProjectName.NotificationManagement.Domain.csproj index b68988eb..0fb22869 100644 --- a/aspnet-core/modules/NotificationManagement/src/CompanyName.ProjectName.NotificationManagement.Domain/CompanyName.ProjectName.NotificationManagement.Domain.csproj +++ b/aspnet-core/modules/NotificationManagement/src/CompanyName.ProjectName.NotificationManagement.Domain/CompanyName.ProjectName.NotificationManagement.Domain.csproj @@ -9,7 +9,6 @@ - diff --git a/aspnet-core/modules/NotificationManagement/src/CompanyName.ProjectName.NotificationManagement.Domain/NotificationManagementDomainService.cs b/aspnet-core/modules/NotificationManagement/src/CompanyName.ProjectName.NotificationManagement.Domain/NotificationManagementDomainService.cs index 322431b5..3a23b73a 100644 --- a/aspnet-core/modules/NotificationManagement/src/CompanyName.ProjectName.NotificationManagement.Domain/NotificationManagementDomainService.cs +++ b/aspnet-core/modules/NotificationManagement/src/CompanyName.ProjectName.NotificationManagement.Domain/NotificationManagementDomainService.cs @@ -1,13 +1,36 @@ using System; -using Lion.Abp.Domain; +using Microsoft.Extensions.DependencyInjection; +using Volo.Abp.Domain.Services; +using Volo.Abp.EventBus.Distributed; +using Volo.Abp.ObjectMapping; +using Volo.Abp.Uow; namespace CompanyName.ProjectName.NotificationManagement { - public abstract class NotificationManagementDomainService : LionAbpDomainService + public abstract class NotificationManagementDomainService : DomainService { - protected NotificationManagementDomainService() - { - ObjectMapperContext = typeof(NotificationManagementDomainModule); - } + protected Type ObjectMapperContext { get; set; } + + /// + /// 工作单元管理器 + /// + protected IUnitOfWorkManager UnitOfWorkManager => + LazyServiceProvider.LazyGetRequiredService(); + + /// + /// 分布式事件总线 + /// + protected IDistributedEventBus DistributedEventBus => + LazyServiceProvider.LazyGetRequiredService(); + + /// + /// 对象映射器 + /// + protected IObjectMapper ObjectMapper => LazyServiceProvider.LazyGetService( + provider => + ObjectMapperContext == null + ? provider.GetRequiredService() + : (IObjectMapper)provider.GetRequiredService( + typeof(IObjectMapper<>).MakeGenericType(ObjectMapperContext))); } } \ No newline at end of file diff --git a/aspnet-core/modules/NotificationManagement/src/CompanyName.ProjectName.NotificationManagement.EntityFrameworkCore/EntityFrameworkCore/INotificationManagementDbContext.cs b/aspnet-core/modules/NotificationManagement/src/CompanyName.ProjectName.NotificationManagement.EntityFrameworkCore/EntityFrameworkCore/INotificationManagementDbContext.cs index 0911100c..57f40c57 100644 --- a/aspnet-core/modules/NotificationManagement/src/CompanyName.ProjectName.NotificationManagement.EntityFrameworkCore/EntityFrameworkCore/INotificationManagementDbContext.cs +++ b/aspnet-core/modules/NotificationManagement/src/CompanyName.ProjectName.NotificationManagement.EntityFrameworkCore/EntityFrameworkCore/INotificationManagementDbContext.cs @@ -12,6 +12,6 @@ namespace CompanyName.ProjectName.NotificationManagement.EntityFrameworkCore * DbSet Questions { get; } */ - DbSet Questions { get; set; } + DbSet Notifications { get; set; } } } \ No newline at end of file diff --git a/aspnet-core/modules/NotificationManagement/src/CompanyName.ProjectName.NotificationManagement.EntityFrameworkCore/EntityFrameworkCore/NotificationManagementDbContext.cs b/aspnet-core/modules/NotificationManagement/src/CompanyName.ProjectName.NotificationManagement.EntityFrameworkCore/EntityFrameworkCore/NotificationManagementDbContext.cs index 645a2b9b..6fc23c53 100644 --- a/aspnet-core/modules/NotificationManagement/src/CompanyName.ProjectName.NotificationManagement.EntityFrameworkCore/EntityFrameworkCore/NotificationManagementDbContext.cs +++ b/aspnet-core/modules/NotificationManagement/src/CompanyName.ProjectName.NotificationManagement.EntityFrameworkCore/EntityFrameworkCore/NotificationManagementDbContext.cs @@ -17,7 +17,7 @@ namespace CompanyName.ProjectName.NotificationManagement.EntityFrameworkCore { } - public DbSet Questions { get; set; } + public DbSet Notifications { get; set; } protected override void OnModelCreating(ModelBuilder builder) { diff --git a/aspnet-core/modules/NotificationManagement/src/CompanyName.ProjectName.NotificationManagement.EntityFrameworkCore/EntityFrameworkCore/NotificationManagementDbContextModelCreatingExtensions.cs b/aspnet-core/modules/NotificationManagement/src/CompanyName.ProjectName.NotificationManagement.EntityFrameworkCore/EntityFrameworkCore/NotificationManagementDbContextModelCreatingExtensions.cs index e57ffed2..da6dc690 100644 --- a/aspnet-core/modules/NotificationManagement/src/CompanyName.ProjectName.NotificationManagement.EntityFrameworkCore/EntityFrameworkCore/NotificationManagementDbContextModelCreatingExtensions.cs +++ b/aspnet-core/modules/NotificationManagement/src/CompanyName.ProjectName.NotificationManagement.EntityFrameworkCore/EntityFrameworkCore/NotificationManagementDbContextModelCreatingExtensions.cs @@ -9,38 +9,10 @@ namespace CompanyName.ProjectName.NotificationManagement.EntityFrameworkCore public static class NotificationManagementDbContextModelCreatingExtensions { public static void ConfigureNotificationManagement( - this ModelBuilder builder, - Action optionsAction = null) + this ModelBuilder builder) { Check.NotNull(builder, nameof(builder)); - var options = new NotificationManagementModelBuilderConfigurationOptions( - NotificationManagementDbProperties.DbTablePrefix, - NotificationManagementDbProperties.DbSchema - ); - - optionsAction?.Invoke(options); - - /* Configure all entities here. Example: - - builder.Entity(b => - { - //Configure table & schema name - b.ToTable(options.TablePrefix + "Questions", options.Schema); - - b.ConfigureByConvention(); - - //Properties - b.Property(q => q.Title).IsRequired().HasMaxLength(QuestionConsts.MaxTitleLength); - - //Relations - b.HasMany(question => question.Tags).WithOne().HasForeignKey(qt => qt.QuestionId); - - //Indexes - b.HasIndex(q => q.CreationTime); - }); - */ - builder.Entity(b => { b.ToTable(NotificationManagementDbProperties.DbTablePrefix + nameof(Notification), diff --git a/aspnet-core/services/src/CompanyName.ProjectName.Domain/IdentityServer/IdenityServerApiResourceManager.cs b/aspnet-core/services/src/CompanyName.ProjectName.Domain/IdentityServer/IdenityServerApiResourceManager.cs index 232d627d..71f46521 100644 --- a/aspnet-core/services/src/CompanyName.ProjectName.Domain/IdentityServer/IdenityServerApiResourceManager.cs +++ b/aspnet-core/services/src/CompanyName.ProjectName.Domain/IdentityServer/IdenityServerApiResourceManager.cs @@ -11,7 +11,7 @@ using IdentityModel; namespace CompanyName.ProjectName.IdentityServer { - public class IdenityServerApiResourceManager : DomainService + public class IdenityServerApiResourceManager : ProjectNameDomainService { private readonly IApiResourceRepository _apiResourceRepository; diff --git a/aspnet-core/services/src/CompanyName.ProjectName.Domain/IdentityServer/IdenityServerApiScopeManager.cs b/aspnet-core/services/src/CompanyName.ProjectName.Domain/IdentityServer/IdenityServerApiScopeManager.cs index 6900348a..1a45b37d 100644 --- a/aspnet-core/services/src/CompanyName.ProjectName.Domain/IdentityServer/IdenityServerApiScopeManager.cs +++ b/aspnet-core/services/src/CompanyName.ProjectName.Domain/IdentityServer/IdenityServerApiScopeManager.cs @@ -8,7 +8,7 @@ using Volo.Abp.IdentityServer.ApiScopes; namespace CompanyName.ProjectName.IdentityServer { - public class IdenityServerApiScopeManager : DomainService + public class IdenityServerApiScopeManager : ProjectNameDomainService { private readonly IApiScopeRepository _apiScopeRepository; diff --git a/aspnet-core/services/src/CompanyName.ProjectName.Domain/IdentityServer/IdenityServerClientManager.cs b/aspnet-core/services/src/CompanyName.ProjectName.Domain/IdentityServer/IdenityServerClientManager.cs index a7ed4a31..6b34e9e5 100644 --- a/aspnet-core/services/src/CompanyName.ProjectName.Domain/IdentityServer/IdenityServerClientManager.cs +++ b/aspnet-core/services/src/CompanyName.ProjectName.Domain/IdentityServer/IdenityServerClientManager.cs @@ -10,7 +10,7 @@ using Volo.Abp.IdentityServer.Clients; namespace CompanyName.ProjectName.IdentityServer { - public class IdenityServerClientManager : DomainService + public class IdenityServerClientManager : ProjectNameDomainService { private readonly IClientRepository _clientRepository; diff --git a/aspnet-core/services/src/CompanyName.ProjectName.Domain/IdentityServer/IdentityResourceManager.cs b/aspnet-core/services/src/CompanyName.ProjectName.Domain/IdentityServer/IdentityResourceManager.cs index 4e1a6826..ba93d0fb 100644 --- a/aspnet-core/services/src/CompanyName.ProjectName.Domain/IdentityServer/IdentityResourceManager.cs +++ b/aspnet-core/services/src/CompanyName.ProjectName.Domain/IdentityServer/IdentityResourceManager.cs @@ -8,7 +8,7 @@ using Volo.Abp.IdentityServer.IdentityResources; namespace CompanyName.ProjectName.IdentityServer { - public class IdentityResourceManager : DomainService + public class IdentityResourceManager : ProjectNameDomainService { private readonly IIdentityResourceRepository _identityResourceRepository; diff --git a/aspnet-core/services/src/CompanyName.ProjectName.Domain/ProjectNameDomainModule.cs b/aspnet-core/services/src/CompanyName.ProjectName.Domain/ProjectNameDomainModule.cs index b12d04a3..3e48701b 100644 --- a/aspnet-core/services/src/CompanyName.ProjectName.Domain/ProjectNameDomainModule.cs +++ b/aspnet-core/services/src/CompanyName.ProjectName.Domain/ProjectNameDomainModule.cs @@ -3,7 +3,6 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection.Extensions; using CompanyName.ProjectName.MultiTenancy; using CompanyName.ProjectName.NotificationManagement; -using Lion.Abp.Domain; using Volo.Abp.AuditLogging; using Volo.Abp.BackgroundJobs; using Volo.Abp.Emailing; @@ -32,8 +31,7 @@ namespace CompanyName.ProjectName typeof(AbpTenantManagementDomainModule), typeof(AbpEmailingModule), typeof(DataDictionaryManagementDomainModule), - typeof(NotificationManagementDomainModule), - typeof(LionAbpDomainModule) + typeof(NotificationManagementDomainModule) )] public class ProjectNameDomainModule : AbpModule { diff --git a/aspnet-core/frameworks/Extensions/src/Lion.Abp.Domain/LionAbpDomainService.cs b/aspnet-core/services/src/CompanyName.ProjectName.Domain/ProjectNameDomainService.cs similarity index 91% rename from aspnet-core/frameworks/Extensions/src/Lion.Abp.Domain/LionAbpDomainService.cs rename to aspnet-core/services/src/CompanyName.ProjectName.Domain/ProjectNameDomainService.cs index 1a3f4c75..e400064f 100644 --- a/aspnet-core/frameworks/Extensions/src/Lion.Abp.Domain/LionAbpDomainService.cs +++ b/aspnet-core/services/src/CompanyName.ProjectName.Domain/ProjectNameDomainService.cs @@ -5,9 +5,9 @@ using Volo.Abp.EventBus.Distributed; using Volo.Abp.ObjectMapping; using Volo.Abp.Uow; -namespace Lion.Abp.Domain +namespace CompanyName.ProjectName { - public abstract class LionAbpDomainService : DomainService + public abstract class ProjectNameDomainService : DomainService { protected Type ObjectMapperContext { get; set; } diff --git a/aspnet-core/services/src/CompanyName.ProjectName.Domain/Users/AppUser.cs b/aspnet-core/services/src/CompanyName.ProjectName.Domain/Users/AppUser.cs deleted file mode 100644 index 1093d497..00000000 --- a/aspnet-core/services/src/CompanyName.ProjectName.Domain/Users/AppUser.cs +++ /dev/null @@ -1,63 +0,0 @@ -using System; -using Volo.Abp.Domain.Entities.Auditing; -using Volo.Abp.Users; - -namespace CompanyName.ProjectName.Users -{ - /* This entity shares the same table/collection ("AbpUsers" by default) with the - * IdentityUser entity of the Identity module. - * - * - You can define your custom properties into this class. - * - You never create or delete this entity, because it is Identity module's job. - * - You can query users from database with this entity. - * - You can update values of your custom properties. - */ - public class AppUser : FullAuditedAggregateRoot, IUser - { - #region Base properties - - /* These properties are shared with the IdentityUser entity of the Identity module. - * Do not change these properties through this class. Instead, use Identity module - * services (like IdentityUserManager) to change them. - * So, this properties are designed as read only! - */ - - public virtual Guid? TenantId { get; private set; } - - public virtual string UserName { get; private set; } - - public virtual string Name { get; private set; } - - public virtual string Surname { get; private set; } - - public virtual string Email { get; private set; } - - public virtual bool EmailConfirmed { get; private set; } - - public virtual string PhoneNumber { get; private set; } - - public virtual bool PhoneNumberConfirmed { get; private set; } - - #endregion - - /* Add your own properties here. Example: - * - * public string MyProperty { get; set; } - * - * If you add a property and using the EF Core, remember these; - * - * 1. Update ProjectNameDbContext.OnModelCreating - * to configure the mapping for your new property - * 2. Update ProjectNameEfCoreEntityExtensionMappings to extend the IdentityUser entity - * and add your new property to the migration. - * 3. Use the Add-Migration to add a new database migration. - * 4. Run the .DbMigrator project (or use the Update-Database command) to apply - * schema change to the database. - */ - - private AppUser() - { - - } - } -} diff --git a/aspnet-core/services/test/CompanyName.ProjectName.EntityFrameworkCore.Tests/EntityFrameworkCore/Samples/SampleRepositoryTests.cs b/aspnet-core/services/test/CompanyName.ProjectName.EntityFrameworkCore.Tests/EntityFrameworkCore/Samples/SampleRepositoryTests.cs deleted file mode 100644 index 7c3c49fd..00000000 --- a/aspnet-core/services/test/CompanyName.ProjectName.EntityFrameworkCore.Tests/EntityFrameworkCore/Samples/SampleRepositoryTests.cs +++ /dev/null @@ -1,44 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using CompanyName.ProjectName.Users; -using Shouldly; -using System; -using System.Linq; -using System.Threading.Tasks; -using Volo.Abp.Domain.Repositories; -using Xunit; - -namespace CompanyName.ProjectName.EntityFrameworkCore.Samples -{ - /* This is just an example test class. - * Normally, you don't test ABP framework code - * (like default AppUser repository IRepository here). - * Only test your custom repository methods. - */ - public class SampleRepositoryTests : ProjectNameEntityFrameworkCoreTestBase - { - private readonly IRepository _appUserRepository; - - public SampleRepositoryTests() - { - _appUserRepository = GetRequiredService>(); - } - - [Fact] - public async Task Should_Query_AppUser() - { - /* Need to manually start Unit Of Work because - * FirstOrDefaultAsync should be executed while db connection / context is available. - */ - await WithUnitOfWorkAsync(async () => - { - //Act - var adminUser = await (await _appUserRepository.GetQueryableAsync()) - .Where(u => u.UserName == "admin") - .FirstOrDefaultAsync(); - - //Assert - adminUser.ShouldNotBeNull(); - }); - } - } -}