Browse Source

调整项目

pull/8/head
王军 4 years ago
parent
commit
ec65ef4630
  1. 7
      aspnet-core/CompanyName.ProjectName.sln
  2. 12
      aspnet-core/frameworks/Extensions/src/Lion.Abp.Domain/Lion.Abp.Domain.csproj
  3. 13
      aspnet-core/frameworks/Extensions/src/Lion.Abp.Domain/LionAbpDomainModule.cs
  4. 1
      aspnet-core/modules/DataDictionaryManagement/src/CompanyName.ProjectName.DataDictionaryManagement.Domain/CompanyName.ProjectName.DataDictionaryManagement.Domain.csproj
  5. 2
      aspnet-core/modules/DataDictionaryManagement/src/CompanyName.ProjectName.DataDictionaryManagement.Domain/DataDictionaries/DataDictionaryManager.cs
  6. 36
      aspnet-core/modules/DataDictionaryManagement/src/CompanyName.ProjectName.DataDictionaryManagement.Domain/DataDictionaryDomainService.cs
  7. 6
      aspnet-core/modules/DataDictionaryManagement/src/CompanyName.ProjectName.DataDictionaryManagement.Domain/DataDictionaryManagementDomainModule.cs
  8. 13
      aspnet-core/modules/DataDictionaryManagement/src/CompanyName.ProjectName.DataDictionaryManagement.EntityFrameworkCore/EntityFrameworkCore/DataDictionaryManagementDbContextModelCreatingExtensions.cs
  9. 1
      aspnet-core/modules/NotificationManagement/src/CompanyName.ProjectName.NotificationManagement.Domain/CompanyName.ProjectName.NotificationManagement.Domain.csproj
  10. 35
      aspnet-core/modules/NotificationManagement/src/CompanyName.ProjectName.NotificationManagement.Domain/NotificationManagementDomainService.cs
  11. 2
      aspnet-core/modules/NotificationManagement/src/CompanyName.ProjectName.NotificationManagement.EntityFrameworkCore/EntityFrameworkCore/INotificationManagementDbContext.cs
  12. 2
      aspnet-core/modules/NotificationManagement/src/CompanyName.ProjectName.NotificationManagement.EntityFrameworkCore/EntityFrameworkCore/NotificationManagementDbContext.cs
  13. 30
      aspnet-core/modules/NotificationManagement/src/CompanyName.ProjectName.NotificationManagement.EntityFrameworkCore/EntityFrameworkCore/NotificationManagementDbContextModelCreatingExtensions.cs
  14. 2
      aspnet-core/services/src/CompanyName.ProjectName.Domain/IdentityServer/IdenityServerApiResourceManager.cs
  15. 2
      aspnet-core/services/src/CompanyName.ProjectName.Domain/IdentityServer/IdenityServerApiScopeManager.cs
  16. 2
      aspnet-core/services/src/CompanyName.ProjectName.Domain/IdentityServer/IdenityServerClientManager.cs
  17. 2
      aspnet-core/services/src/CompanyName.ProjectName.Domain/IdentityServer/IdentityResourceManager.cs
  18. 4
      aspnet-core/services/src/CompanyName.ProjectName.Domain/ProjectNameDomainModule.cs
  19. 4
      aspnet-core/services/src/CompanyName.ProjectName.Domain/ProjectNameDomainService.cs
  20. 63
      aspnet-core/services/src/CompanyName.ProjectName.Domain/Users/AppUser.cs
  21. 44
      aspnet-core/services/test/CompanyName.ProjectName.EntityFrameworkCore.Tests/EntityFrameworkCore/Samples/SampleRepositoryTests.cs

7
aspnet-core/CompanyName.ProjectName.sln

@ -139,8 +139,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Lion.Abp.Cap", "frameworks\
EndProject 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}" 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 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}" Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "gateways", "gateways", "{5C304CBC-F30D-413C-A0AF-8B6814A2D4A3}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CompanyName.ProjectName.PublicGateway", "gateways\CompanyName.ProjectName.PublicGateway\CompanyName.ProjectName.PublicGateway.csproj", "{870364BA-DD5C-4597-9047-BD8A0CA1CFBA}" 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}.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.ActiveCfg = Release|Any CPU
{6848FA46-EFFF-4E0C-8EAA-145D8C440333}.Release|Any CPU.Build.0 = 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.ActiveCfg = Debug|Any CPU
{870364BA-DD5C-4597-9047-BD8A0CA1CFBA}.Debug|Any CPU.Build.0 = 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 {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} {48D938A1-36E4-4AC1-9AF2-645CB75D4A05} = {1A57338B-65B1-4B8F-ABBD-83F4E8321D8F}
{800F4482-EAC3-472B-AF07-53980D47AA41} = {11ED8435-B5AE-4BF3-9D4B-51FA1E4A18A6} {800F4482-EAC3-472B-AF07-53980D47AA41} = {11ED8435-B5AE-4BF3-9D4B-51FA1E4A18A6}
{6848FA46-EFFF-4E0C-8EAA-145D8C440333} = {C4AC9352-C9F5-4096-8D73-13638232CFB9} {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} {870364BA-DD5C-4597-9047-BD8A0CA1CFBA} = {5C304CBC-F30D-413C-A0AF-8B6814A2D4A3}
{D9108313-8D05-4F5F-9AA0-B443EC3374B6} = {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} {FC30B17B-F671-4E55-90C6-9F37E40B483D} = {CA9AC87F-097E-4F15-8393-4BC07735A5B0}

12
aspnet-core/frameworks/Extensions/src/Lion.Abp.Domain/Lion.Abp.Domain.csproj

@ -1,12 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.Ddd.Domain" Version="4.4.0" />
<PackageReference Include="Volo.Abp.AutoMapper" Version="4.4.0" />
<PackageReference Include="Volo.Abp.ObjectMapping" Version="4.4.0" />
</ItemGroup>
</Project>

13
aspnet-core/frameworks/Extensions/src/Lion.Abp.Domain/LionAbpDomainModule.cs

@ -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
{
}
}

1
aspnet-core/modules/DataDictionaryManagement/src/CompanyName.ProjectName.DataDictionaryManagement.Domain/CompanyName.ProjectName.DataDictionaryManagement.Domain.csproj

@ -9,7 +9,6 @@
<ItemGroup> <ItemGroup>
<PackageReference Include="Volo.Abp.Ddd.Domain" Version="$(AbpPackageVersion)" /> <PackageReference Include="Volo.Abp.Ddd.Domain" Version="$(AbpPackageVersion)" />
<ProjectReference Include="..\..\..\..\frameworks\Extensions\src\Lion.Abp.Domain\Lion.Abp.Domain.csproj" />
<ProjectReference Include="..\CompanyName.ProjectName.DataDictionaryManagement.Domain.Shared\CompanyName.ProjectName.DataDictionaryManagement.Domain.Shared.csproj" /> <ProjectReference Include="..\CompanyName.ProjectName.DataDictionaryManagement.Domain.Shared\CompanyName.ProjectName.DataDictionaryManagement.Domain.Shared.csproj" />

2
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 namespace CompanyName.ProjectName.DataDictionaryManagement.DataDictionaries
{ {
public class DataDictionaryManager : DomainService public class DataDictionaryManager : DataDictionaryDomainService
{ {
private readonly IDataDictionaryRepository _dataDictionaryRepository; private readonly IDataDictionaryRepository _dataDictionaryRepository;

36
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; }
/// <summary>
/// 工作单元管理器
/// </summary>
protected IUnitOfWorkManager UnitOfWorkManager =>
LazyServiceProvider.LazyGetRequiredService<IUnitOfWorkManager>();
/// <summary>
/// 分布式事件总线
/// </summary>
protected IDistributedEventBus DistributedEventBus =>
LazyServiceProvider.LazyGetRequiredService<IDistributedEventBus>();
/// <summary>
/// 对象映射器
/// </summary>
protected IObjectMapper ObjectMapper => LazyServiceProvider.LazyGetService<IObjectMapper>(
provider =>
ObjectMapperContext == null
? provider.GetRequiredService<IObjectMapper>()
: (IObjectMapper)provider.GetRequiredService(
typeof(IObjectMapper<>).MakeGenericType(ObjectMapperContext)));
}
}

6
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; using Volo.Abp.Modularity;
namespace CompanyName.ProjectName.DataDictionaryManagement namespace CompanyName.ProjectName.DataDictionaryManagement
{ {
[DependsOn( [DependsOn(
typeof(AbpDddDomainModule), typeof(AbpDddDomainModule),
typeof(DataDictionaryManagementDomainSharedModule), typeof(DataDictionaryManagementDomainSharedModule)
typeof(LionAbpDomainModule)
)] )]
public class DataDictionaryManagementDomainModule : AbpModule public class DataDictionaryManagementDomainModule : AbpModule
{ {

13
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 class DataDictionaryManagementDbContextModelCreatingExtensions
{ {
public static void ConfigureDataDictionaryManagement( public static void ConfigureDataDictionaryManagement(
this ModelBuilder builder, this ModelBuilder builder)
Action<DataDictionaryManagementModelBuilderConfigurationOptions> optionsAction = null)
{ {
Check.NotNull(builder, nameof(builder)); Check.NotNull(builder, nameof(builder));
var options = new DataDictionaryManagementModelBuilderConfigurationOptions(
DataDictionaryManagementDbProperties.DbTablePrefix,
DataDictionaryManagementDbProperties.DbSchema
);
optionsAction?.Invoke(options);
builder.Entity<DataDictionary>(b => builder.Entity<DataDictionary>(b =>
{ {

1
aspnet-core/modules/NotificationManagement/src/CompanyName.ProjectName.NotificationManagement.Domain/CompanyName.ProjectName.NotificationManagement.Domain.csproj

@ -9,7 +9,6 @@
<ItemGroup> <ItemGroup>
<PackageReference Include="Volo.Abp.Ddd.Domain" Version="$(AbpPackageVersion)" /> <PackageReference Include="Volo.Abp.Ddd.Domain" Version="$(AbpPackageVersion)" />
<ProjectReference Include="..\..\..\..\frameworks\Extensions\src\Lion.Abp.Domain\Lion.Abp.Domain.csproj" />
<ProjectReference Include="..\CompanyName.ProjectName.NotificationManagement.Domain.Shared\CompanyName.ProjectName.NotificationManagement.Domain.Shared.csproj" /> <ProjectReference Include="..\CompanyName.ProjectName.NotificationManagement.Domain.Shared\CompanyName.ProjectName.NotificationManagement.Domain.Shared.csproj" />
</ItemGroup> </ItemGroup>

35
aspnet-core/modules/NotificationManagement/src/CompanyName.ProjectName.NotificationManagement.Domain/NotificationManagementDomainService.cs

@ -1,13 +1,36 @@
using System; 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 namespace CompanyName.ProjectName.NotificationManagement
{ {
public abstract class NotificationManagementDomainService : LionAbpDomainService public abstract class NotificationManagementDomainService : DomainService
{ {
protected NotificationManagementDomainService() protected Type ObjectMapperContext { get; set; }
{
ObjectMapperContext = typeof(NotificationManagementDomainModule); /// <summary>
} /// 工作单元管理器
/// </summary>
protected IUnitOfWorkManager UnitOfWorkManager =>
LazyServiceProvider.LazyGetRequiredService<IUnitOfWorkManager>();
/// <summary>
/// 分布式事件总线
/// </summary>
protected IDistributedEventBus DistributedEventBus =>
LazyServiceProvider.LazyGetRequiredService<IDistributedEventBus>();
/// <summary>
/// 对象映射器
/// </summary>
protected IObjectMapper ObjectMapper => LazyServiceProvider.LazyGetService<IObjectMapper>(
provider =>
ObjectMapperContext == null
? provider.GetRequiredService<IObjectMapper>()
: (IObjectMapper)provider.GetRequiredService(
typeof(IObjectMapper<>).MakeGenericType(ObjectMapperContext)));
} }
} }

2
aspnet-core/modules/NotificationManagement/src/CompanyName.ProjectName.NotificationManagement.EntityFrameworkCore/EntityFrameworkCore/INotificationManagementDbContext.cs

@ -12,6 +12,6 @@ namespace CompanyName.ProjectName.NotificationManagement.EntityFrameworkCore
* DbSet<Question> Questions { get; } * DbSet<Question> Questions { get; }
*/ */
DbSet<Notification> Questions { get; set; } DbSet<Notification> Notifications { get; set; }
} }
} }

2
aspnet-core/modules/NotificationManagement/src/CompanyName.ProjectName.NotificationManagement.EntityFrameworkCore/EntityFrameworkCore/NotificationManagementDbContext.cs

@ -17,7 +17,7 @@ namespace CompanyName.ProjectName.NotificationManagement.EntityFrameworkCore
{ {
} }
public DbSet<Notification> Questions { get; set; } public DbSet<Notification> Notifications { get; set; }
protected override void OnModelCreating(ModelBuilder builder) protected override void OnModelCreating(ModelBuilder builder)
{ {

30
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 class NotificationManagementDbContextModelCreatingExtensions
{ {
public static void ConfigureNotificationManagement( public static void ConfigureNotificationManagement(
this ModelBuilder builder, this ModelBuilder builder)
Action<NotificationManagementModelBuilderConfigurationOptions> optionsAction = null)
{ {
Check.NotNull(builder, nameof(builder)); Check.NotNull(builder, nameof(builder));
var options = new NotificationManagementModelBuilderConfigurationOptions(
NotificationManagementDbProperties.DbTablePrefix,
NotificationManagementDbProperties.DbSchema
);
optionsAction?.Invoke(options);
/* Configure all entities here. Example:
builder.Entity<Question>(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<Notification>(b => builder.Entity<Notification>(b =>
{ {
b.ToTable(NotificationManagementDbProperties.DbTablePrefix + nameof(Notification), b.ToTable(NotificationManagementDbProperties.DbTablePrefix + nameof(Notification),

2
aspnet-core/services/src/CompanyName.ProjectName.Domain/IdentityServer/IdenityServerApiResourceManager.cs

@ -11,7 +11,7 @@ using IdentityModel;
namespace CompanyName.ProjectName.IdentityServer namespace CompanyName.ProjectName.IdentityServer
{ {
public class IdenityServerApiResourceManager : DomainService public class IdenityServerApiResourceManager : ProjectNameDomainService
{ {
private readonly IApiResourceRepository _apiResourceRepository; private readonly IApiResourceRepository _apiResourceRepository;

2
aspnet-core/services/src/CompanyName.ProjectName.Domain/IdentityServer/IdenityServerApiScopeManager.cs

@ -8,7 +8,7 @@ using Volo.Abp.IdentityServer.ApiScopes;
namespace CompanyName.ProjectName.IdentityServer namespace CompanyName.ProjectName.IdentityServer
{ {
public class IdenityServerApiScopeManager : DomainService public class IdenityServerApiScopeManager : ProjectNameDomainService
{ {
private readonly IApiScopeRepository _apiScopeRepository; private readonly IApiScopeRepository _apiScopeRepository;

2
aspnet-core/services/src/CompanyName.ProjectName.Domain/IdentityServer/IdenityServerClientManager.cs

@ -10,7 +10,7 @@ using Volo.Abp.IdentityServer.Clients;
namespace CompanyName.ProjectName.IdentityServer namespace CompanyName.ProjectName.IdentityServer
{ {
public class IdenityServerClientManager : DomainService public class IdenityServerClientManager : ProjectNameDomainService
{ {
private readonly IClientRepository _clientRepository; private readonly IClientRepository _clientRepository;

2
aspnet-core/services/src/CompanyName.ProjectName.Domain/IdentityServer/IdentityResourceManager.cs

@ -8,7 +8,7 @@ using Volo.Abp.IdentityServer.IdentityResources;
namespace CompanyName.ProjectName.IdentityServer namespace CompanyName.ProjectName.IdentityServer
{ {
public class IdentityResourceManager : DomainService public class IdentityResourceManager : ProjectNameDomainService
{ {
private readonly IIdentityResourceRepository _identityResourceRepository; private readonly IIdentityResourceRepository _identityResourceRepository;

4
aspnet-core/services/src/CompanyName.ProjectName.Domain/ProjectNameDomainModule.cs

@ -3,7 +3,6 @@ using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions; using Microsoft.Extensions.DependencyInjection.Extensions;
using CompanyName.ProjectName.MultiTenancy; using CompanyName.ProjectName.MultiTenancy;
using CompanyName.ProjectName.NotificationManagement; using CompanyName.ProjectName.NotificationManagement;
using Lion.Abp.Domain;
using Volo.Abp.AuditLogging; using Volo.Abp.AuditLogging;
using Volo.Abp.BackgroundJobs; using Volo.Abp.BackgroundJobs;
using Volo.Abp.Emailing; using Volo.Abp.Emailing;
@ -32,8 +31,7 @@ namespace CompanyName.ProjectName
typeof(AbpTenantManagementDomainModule), typeof(AbpTenantManagementDomainModule),
typeof(AbpEmailingModule), typeof(AbpEmailingModule),
typeof(DataDictionaryManagementDomainModule), typeof(DataDictionaryManagementDomainModule),
typeof(NotificationManagementDomainModule), typeof(NotificationManagementDomainModule)
typeof(LionAbpDomainModule)
)] )]
public class ProjectNameDomainModule : AbpModule public class ProjectNameDomainModule : AbpModule
{ {

4
aspnet-core/frameworks/Extensions/src/Lion.Abp.Domain/LionAbpDomainService.cs → 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.ObjectMapping;
using Volo.Abp.Uow; 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; } protected Type ObjectMapperContext { get; set; }

63
aspnet-core/services/src/CompanyName.ProjectName.Domain/Users/AppUser.cs

@ -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<Guid>, 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()
{
}
}
}

44
aspnet-core/services/test/CompanyName.ProjectName.EntityFrameworkCore.Tests/EntityFrameworkCore/Samples/SampleRepositoryTests.cs

@ -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<AppUser, Guid> here).
* Only test your custom repository methods.
*/
public class SampleRepositoryTests : ProjectNameEntityFrameworkCoreTestBase
{
private readonly IRepository<AppUser, Guid> _appUserRepository;
public SampleRepositoryTests()
{
_appUserRepository = GetRequiredService<IRepository<AppUser, Guid>>();
}
[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();
});
}
}
}
Loading…
Cancel
Save