mirror of https://github.com/abpframework/abp.git
62 changed files with 1207 additions and 0 deletions
@ -0,0 +1,37 @@ |
|||
<Project Sdk="Microsoft.NET.Sdk.Web"> |
|||
|
|||
<PropertyGroup> |
|||
<TargetFramework>netcoreapp2.2</TargetFramework> |
|||
<AssetTargetFallback>$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;</AssetTargetFallback> |
|||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects> |
|||
<GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType> |
|||
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles> |
|||
<PreserveCompilationContext>true</PreserveCompilationContext> |
|||
<MvcRazorExcludeRefAssembliesFromPublish>false</MvcRazorExcludeRefAssembliesFromPublish> |
|||
<MvcRazorCompileOnPublish>true</MvcRazorCompileOnPublish> |
|||
</PropertyGroup> |
|||
|
|||
<ItemGroup> |
|||
<PackageReference Include="Microsoft.AspNetCore.App" Version="2.2.0" /> |
|||
<PackageReference Include="Serilog.AspNetCore" Version="2.1.1" /> |
|||
<PackageReference Include="Serilog.Sinks.File" Version="4.0.0" /> |
|||
<PackageReference Include="Swashbuckle.AspNetCore" Version="4.0.1" /> |
|||
<PackageReference Include="IdentityServer4.AccessTokenValidation" Version="2.7.0" /> |
|||
</ItemGroup> |
|||
|
|||
<ItemGroup> |
|||
<ProjectReference Include="..\..\..\..\..\framework\src\Volo.Abp.Autofac\Volo.Abp.Autofac.csproj" /> |
|||
<ProjectReference Include="..\..\..\..\..\framework\src\Volo.Abp.EntityFrameworkCore.SqlServer\Volo.Abp.EntityFrameworkCore.SqlServer.csproj" /> |
|||
<ProjectReference Include="..\..\..\..\..\modules\audit-logging\src\Volo.Abp.AuditLogging.EntityFrameworkCore\Volo.Abp.AuditLogging.EntityFrameworkCore.csproj" /> |
|||
<ProjectReference Include="..\..\..\..\..\modules\permission-management\src\Volo.Abp.PermissionManagement.EntityFrameworkCore\Volo.Abp.PermissionManagement.EntityFrameworkCore.csproj" /> |
|||
<ProjectReference Include="..\..\..\..\..\modules\setting-management\src\Volo.Abp.SettingManagement.EntityFrameworkCore\Volo.Abp.SettingManagement.EntityFrameworkCore.csproj" /> |
|||
</ItemGroup> |
|||
|
|||
<ItemGroup> |
|||
<Compile Remove="Logs\**" /> |
|||
<Content Remove="Logs\**" /> |
|||
<EmbeddedResource Remove="Logs\**" /> |
|||
<None Remove="Logs\**" /> |
|||
</ItemGroup> |
|||
|
|||
</Project> |
|||
@ -0,0 +1,24 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.IO; |
|||
using System.Linq; |
|||
using System.Threading.Tasks; |
|||
using Microsoft.AspNetCore; |
|||
using Microsoft.AspNetCore.Hosting; |
|||
using Microsoft.Extensions.Configuration; |
|||
using Microsoft.Extensions.Logging; |
|||
|
|||
namespace ProductService.Host |
|||
{ |
|||
public class Program |
|||
{ |
|||
public static void Main(string[] args) |
|||
{ |
|||
CreateWebHostBuilder(args).Build().Run(); |
|||
} |
|||
|
|||
public static IWebHostBuilder CreateWebHostBuilder(string[] args) => |
|||
WebHost.CreateDefaultBuilder(args) |
|||
.UseStartup<Startup>(); |
|||
} |
|||
} |
|||
@ -0,0 +1,27 @@ |
|||
{ |
|||
"iisSettings": { |
|||
"windowsAuthentication": false, |
|||
"anonymousAuthentication": true, |
|||
"iisExpress": { |
|||
"applicationUrl": "http://localhost:60244", |
|||
"sslPort": 0 |
|||
} |
|||
}, |
|||
"profiles": { |
|||
"IIS Express": { |
|||
"commandName": "IISExpress", |
|||
"launchBrowser": true, |
|||
"environmentVariables": { |
|||
"ASPNETCORE_ENVIRONMENT": "Development" |
|||
} |
|||
}, |
|||
"ProductService.Host": { |
|||
"commandName": "Project", |
|||
"launchBrowser": true, |
|||
"applicationUrl": "http://localhost:5000", |
|||
"environmentVariables": { |
|||
"ASPNETCORE_ENVIRONMENT": "Development" |
|||
} |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,34 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using System.Threading.Tasks; |
|||
using Microsoft.AspNetCore.Builder; |
|||
using Microsoft.AspNetCore.Hosting; |
|||
using Microsoft.AspNetCore.Http; |
|||
using Microsoft.Extensions.DependencyInjection; |
|||
|
|||
namespace ProductService.Host |
|||
{ |
|||
public class Startup |
|||
{ |
|||
// This method gets called by the runtime. Use this method to add services to the container.
|
|||
// For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940
|
|||
public void ConfigureServices(IServiceCollection services) |
|||
{ |
|||
} |
|||
|
|||
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
|
|||
public void Configure(IApplicationBuilder app, IHostingEnvironment env) |
|||
{ |
|||
if (env.IsDevelopment()) |
|||
{ |
|||
app.UseDeveloperExceptionPage(); |
|||
} |
|||
|
|||
app.Run(async (context) => |
|||
{ |
|||
await context.Response.WriteAsync("Hello World!"); |
|||
}); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,9 @@ |
|||
{ |
|||
"Logging": { |
|||
"LogLevel": { |
|||
"Default": "Debug", |
|||
"System": "Information", |
|||
"Microsoft": "Information" |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,11 @@ |
|||
{ |
|||
"ConnectionStrings": { |
|||
"Default": "Server=localhost;Database=MsDemo_Product;Trusted_Connection=True;MultipleActiveResultSets=true" |
|||
}, |
|||
"Logging": { |
|||
"LogLevel": { |
|||
"Default": "Warning" |
|||
} |
|||
}, |
|||
"AllowedHosts": "*" |
|||
} |
|||
@ -0,0 +1,6 @@ |
|||
{ |
|||
"culture": "en", |
|||
"texts": { |
|||
"Permission:ProductManagement": "ProductManagement" |
|||
} |
|||
} |
|||
@ -0,0 +1,6 @@ |
|||
{ |
|||
"culture": "pt-BR", |
|||
"texts": { |
|||
"Permission:ProductManagement": "ProductManagement" |
|||
} |
|||
} |
|||
@ -0,0 +1,6 @@ |
|||
{ |
|||
"culture": "zh-Hans", |
|||
"texts": { |
|||
"Permission:ProductManagement": "ProductManagement" |
|||
} |
|||
} |
|||
@ -0,0 +1,37 @@ |
|||
using Microsoft.Extensions.DependencyInjection; |
|||
using ProductManagement.Localization; |
|||
using Volo.Abp.Application; |
|||
using Volo.Abp.Authorization.Permissions; |
|||
using Volo.Abp.Localization; |
|||
using Volo.Abp.Modularity; |
|||
using Volo.Abp.VirtualFileSystem; |
|||
|
|||
namespace ProductManagement |
|||
{ |
|||
[DependsOn( |
|||
typeof(ProductManagementDomainSharedModule), |
|||
typeof(AbpDddApplicationModule) |
|||
)] |
|||
public class ProductManagementApplicationContractsModule : AbpModule |
|||
{ |
|||
public override void ConfigureServices(ServiceConfigurationContext context) |
|||
{ |
|||
Configure<PermissionOptions>(options => |
|||
{ |
|||
options.DefinitionProviders.Add<ProductManagementPermissionDefinitionProvider>(); |
|||
}); |
|||
|
|||
Configure<VirtualFileSystemOptions>(options => |
|||
{ |
|||
options.FileSets.AddEmbedded<ProductManagementApplicationContractsModule>(); |
|||
}); |
|||
|
|||
Configure<AbpLocalizationOptions>(options => |
|||
{ |
|||
options.Resources |
|||
.Get<ProductManagementResource>() |
|||
.AddVirtualJson("/MyCompanyName/ProductManagement/Localization/ApplicationContracts"); |
|||
}); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,19 @@ |
|||
using ProductManagement.Localization; |
|||
using Volo.Abp.Authorization.Permissions; |
|||
using Volo.Abp.Localization; |
|||
|
|||
namespace ProductManagement |
|||
{ |
|||
public class ProductManagementPermissionDefinitionProvider : PermissionDefinitionProvider |
|||
{ |
|||
public override void Define(IPermissionDefinitionContext context) |
|||
{ |
|||
//var moduleGroup = context.AddGroup(ProductManagementPermissions.GroupName, L("Permission:ProductManagement"));
|
|||
} |
|||
|
|||
private static LocalizableString L(string name) |
|||
{ |
|||
return LocalizableString.Create<ProductManagementResource>(name); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,15 @@ |
|||
namespace ProductManagement |
|||
{ |
|||
public class ProductManagementPermissions |
|||
{ |
|||
public const string GroupName = "ProductManagement"; |
|||
|
|||
public static string[] GetAll() |
|||
{ |
|||
return new[] |
|||
{ |
|||
GroupName |
|||
}; |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,21 @@ |
|||
<Project Sdk="Microsoft.NET.Sdk"> |
|||
|
|||
<PropertyGroup> |
|||
<TargetFramework>netstandard2.0</TargetFramework> |
|||
<RootNamespace /> |
|||
</PropertyGroup> |
|||
|
|||
<ItemGroup> |
|||
<ProjectReference Include="..\ProductManagement.Domain.Shared\ProductManagement.Domain.Shared.csproj" /> |
|||
<PackageReference Include="Volo.Abp.Ddd.Application" Version="0.12.0" /> |
|||
</ItemGroup> |
|||
|
|||
<ItemGroup> |
|||
<EmbeddedResource Include="MyCompanyName\ProductManagement\Localization\ApplicationContracts\*.json" /> |
|||
</ItemGroup> |
|||
|
|||
<ItemGroup> |
|||
<Content Remove="MyCompanyName\ProductManagement\Localization\ApplicationContracts\*.json" /> |
|||
</ItemGroup> |
|||
|
|||
</Project> |
|||
@ -0,0 +1,12 @@ |
|||
using AutoMapper; |
|||
|
|||
namespace ProductManagement |
|||
{ |
|||
public class ProductManagementApplicationAutoMapperProfile : Profile |
|||
{ |
|||
public ProductManagementApplicationAutoMapperProfile() |
|||
{ |
|||
|
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,28 @@ |
|||
using Microsoft.Extensions.DependencyInjection; |
|||
using Volo.Abp.AutoMapper; |
|||
using Volo.Abp.Modularity; |
|||
using Volo.Abp.Settings; |
|||
|
|||
namespace ProductManagement |
|||
{ |
|||
[DependsOn( |
|||
typeof(ProductManagementDomainModule), |
|||
typeof(ProductManagementApplicationContractsModule), |
|||
typeof(AbpAutoMapperModule) |
|||
)] |
|||
public class ProductManagementApplicationModule : AbpModule |
|||
{ |
|||
public override void ConfigureServices(ServiceConfigurationContext context) |
|||
{ |
|||
Configure<AbpAutoMapperOptions>(options => |
|||
{ |
|||
options.AddProfile<ProductManagementApplicationAutoMapperProfile>(validate: true); |
|||
}); |
|||
|
|||
Configure<SettingOptions>(options => |
|||
{ |
|||
options.DefinitionProviders.Add<ProductManagementSettingDefinitionProvider>(); |
|||
}); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,14 @@ |
|||
using Volo.Abp.Settings; |
|||
|
|||
namespace ProductManagement |
|||
{ |
|||
public class ProductManagementSettingDefinitionProvider : SettingDefinitionProvider |
|||
{ |
|||
public override void Define(ISettingDefinitionContext context) |
|||
{ |
|||
/* Define module settings here. |
|||
* Use names from ProductManagementSettings class. |
|||
*/ |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,11 @@ |
|||
namespace ProductManagement |
|||
{ |
|||
public static class ProductManagementSettings |
|||
{ |
|||
public const string GroupName = "ProductManagement"; |
|||
|
|||
/* Add constants for setting names. Example: |
|||
* public const string MySettingName = GroupName + ".MySettingName"; |
|||
*/ |
|||
} |
|||
} |
|||
@ -0,0 +1,14 @@ |
|||
<Project Sdk="Microsoft.NET.Sdk"> |
|||
|
|||
<PropertyGroup> |
|||
<TargetFramework>netstandard2.0</TargetFramework> |
|||
<RootNamespace /> |
|||
</PropertyGroup> |
|||
|
|||
<ItemGroup> |
|||
<PackageReference Include="Volo.Abp.AutoMapper" Version="0.12.0" /> |
|||
<ProjectReference Include="..\ProductManagement.Application.Contracts\ProductManagement.Application.Contracts.csproj" /> |
|||
<ProjectReference Include="..\ProductManagement.Domain\ProductManagement.Domain.csproj" /> |
|||
</ItemGroup> |
|||
|
|||
</Project> |
|||
@ -0,0 +1,12 @@ |
|||
<Project Sdk="Microsoft.NET.Sdk"> |
|||
|
|||
<PropertyGroup> |
|||
<TargetFramework>netstandard2.0</TargetFramework> |
|||
<RootNamespace /> |
|||
</PropertyGroup> |
|||
|
|||
<ItemGroup> |
|||
<PackageReference Include="Volo.Abp.Localization" Version="0.12.0" /> |
|||
</ItemGroup> |
|||
|
|||
</Project> |
|||
@ -0,0 +1,10 @@ |
|||
using Volo.Abp.Localization; |
|||
|
|||
namespace ProductManagement.Localization |
|||
{ |
|||
[LocalizationResourceName("ProductManagement")] |
|||
public class ProductManagementResource |
|||
{ |
|||
|
|||
} |
|||
} |
|||
@ -0,0 +1,7 @@ |
|||
namespace ProductManagement |
|||
{ |
|||
public static class ProductManagementDomainErrorCodes |
|||
{ |
|||
//Add your business exception error codes here...
|
|||
} |
|||
} |
|||
@ -0,0 +1,21 @@ |
|||
using Microsoft.Extensions.DependencyInjection; |
|||
using Volo.Abp.Modularity; |
|||
using Volo.Abp.Localization; |
|||
using ProductManagement.Localization; |
|||
|
|||
namespace ProductManagement |
|||
{ |
|||
[DependsOn( |
|||
typeof(AbpLocalizationModule) |
|||
)] |
|||
public class ProductManagementDomainSharedModule : AbpModule |
|||
{ |
|||
public override void ConfigureServices(ServiceConfigurationContext context) |
|||
{ |
|||
Configure<AbpLocalizationOptions>(options => |
|||
{ |
|||
options.Resources.Add<ProductManagementResource>("en"); |
|||
}); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,6 @@ |
|||
{ |
|||
"culture": "en", |
|||
"texts": { |
|||
|
|||
} |
|||
} |
|||
@ -0,0 +1,6 @@ |
|||
{ |
|||
"culture": "pt-BR", |
|||
"texts": { |
|||
|
|||
} |
|||
} |
|||
@ -0,0 +1,6 @@ |
|||
{ |
|||
"culture": "zh-Hans", |
|||
"texts": { |
|||
|
|||
} |
|||
} |
|||
@ -0,0 +1,9 @@ |
|||
namespace ProductManagement |
|||
{ |
|||
public static class ProductManagementConsts |
|||
{ |
|||
public const string DefaultDbTablePrefix = "ProductManagement"; |
|||
|
|||
public const string DefaultDbSchema = null; |
|||
} |
|||
} |
|||
@ -0,0 +1,33 @@ |
|||
using Microsoft.Extensions.DependencyInjection; |
|||
using ProductManagement.Localization; |
|||
using Volo.Abp.Localization; |
|||
using Volo.Abp.Localization.ExceptionHandling; |
|||
using Volo.Abp.Modularity; |
|||
using Volo.Abp.VirtualFileSystem; |
|||
|
|||
namespace ProductManagement |
|||
{ |
|||
[DependsOn( |
|||
typeof(ProductManagementDomainSharedModule) |
|||
)] |
|||
public class ProductManagementDomainModule : AbpModule |
|||
{ |
|||
public override void ConfigureServices(ServiceConfigurationContext context) |
|||
{ |
|||
Configure<VirtualFileSystemOptions>(options => |
|||
{ |
|||
options.FileSets.AddEmbedded<ProductManagementDomainModule>(); |
|||
}); |
|||
|
|||
Configure<AbpLocalizationOptions>(options => |
|||
{ |
|||
options.Resources.Get<ProductManagementResource>().AddVirtualJson("/MyCompanyName/ProductManagement/Localization/Domain"); |
|||
}); |
|||
|
|||
Configure<ExceptionLocalizationOptions>(options => |
|||
{ |
|||
options.MapCodeNamespace("ProductManagement", typeof(ProductManagementResource)); |
|||
}); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,21 @@ |
|||
<Project Sdk="Microsoft.NET.Sdk"> |
|||
|
|||
<PropertyGroup> |
|||
<TargetFramework>netstandard2.0</TargetFramework> |
|||
<RootNamespace /> |
|||
</PropertyGroup> |
|||
|
|||
<ItemGroup> |
|||
<ProjectReference Include="..\ProductManagement.Domain.Shared\ProductManagement.Domain.Shared.csproj" /> |
|||
<PackageReference Include="Volo.Abp.Ddd.Domain" Version="0.12.0" /> |
|||
</ItemGroup> |
|||
|
|||
<ItemGroup> |
|||
<EmbeddedResource Include="MyCompanyName\ProductManagement\Localization\Domain\*.json" /> |
|||
</ItemGroup> |
|||
|
|||
<ItemGroup> |
|||
<Content Remove="MyCompanyName\ProductManagement\Localization\Domain\*.json" /> |
|||
</ItemGroup> |
|||
|
|||
</Project> |
|||
@ -0,0 +1,13 @@ |
|||
using Volo.Abp.Data; |
|||
using Volo.Abp.EntityFrameworkCore; |
|||
|
|||
namespace ProductManagement.EntityFrameworkCore |
|||
{ |
|||
[ConnectionStringName("ProductManagement")] |
|||
public interface IProductManagementDbContext : IEfCoreDbContext |
|||
{ |
|||
/* Add DbSet for each Aggregate Root here. Example: |
|||
* DbSet<Question> Questions { get; } |
|||
*/ |
|||
} |
|||
} |
|||
@ -0,0 +1,35 @@ |
|||
using Microsoft.EntityFrameworkCore; |
|||
using Volo.Abp.Data; |
|||
using Volo.Abp.EntityFrameworkCore; |
|||
|
|||
namespace ProductManagement.EntityFrameworkCore |
|||
{ |
|||
[ConnectionStringName("ProductManagement")] |
|||
public class ProductManagementDbContext : AbpDbContext<ProductManagementDbContext>, IProductManagementDbContext |
|||
{ |
|||
public static string TablePrefix { get; set; } = ProductManagementConsts.DefaultDbTablePrefix; |
|||
|
|||
public static string Schema { get; set; } = ProductManagementConsts.DefaultDbSchema; |
|||
|
|||
/* Add DbSet for each Aggregate Root here. Example: |
|||
* public DbSet<Question> Questions { get; set; } |
|||
*/ |
|||
|
|||
public ProductManagementDbContext(DbContextOptions<ProductManagementDbContext> options) |
|||
: base(options) |
|||
{ |
|||
|
|||
} |
|||
|
|||
protected override void OnModelCreating(ModelBuilder builder) |
|||
{ |
|||
base.OnModelCreating(builder); |
|||
|
|||
builder.ConfigureProductManagement(options => |
|||
{ |
|||
options.TablePrefix = TablePrefix; |
|||
options.Schema = Schema; |
|||
}); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,38 @@ |
|||
using System; |
|||
using Microsoft.EntityFrameworkCore; |
|||
using Volo.Abp; |
|||
|
|||
namespace ProductManagement.EntityFrameworkCore |
|||
{ |
|||
public static class ProductManagementDbContextModelCreatingExtensions |
|||
{ |
|||
public static void ConfigureProductManagement( |
|||
this ModelBuilder builder, |
|||
Action<ProductManagementModelBuilderConfigurationOptions> optionsAction = null) |
|||
{ |
|||
Check.NotNull(builder, nameof(builder)); |
|||
|
|||
var options = new ProductManagementModelBuilderConfigurationOptions(); |
|||
|
|||
optionsAction?.Invoke(options); |
|||
|
|||
/* Configure all entities here. Example: |
|||
|
|||
builder.Entity<Question>(b => |
|||
{ |
|||
//Configure table & schema name
|
|||
//b.ToTable(options.TablePrefix + "Questions", options.Schema);
|
|||
|
|||
//Properties
|
|||
//b.Property(q => q.Title).IsRequired().HasMaxLength(QuestionConsts.MaxTitleLength);
|
|||
|
|||
//Configure relations
|
|||
//b.HasMany(question => question.Tags).WithOne().HasForeignKey(qt => qt.QuestionId);
|
|||
|
|||
//Configure indexes
|
|||
//b.HasIndex(q => q.CreationTime);
|
|||
}); |
|||
*/ |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,23 @@ |
|||
using Microsoft.Extensions.DependencyInjection; |
|||
using Volo.Abp.EntityFrameworkCore; |
|||
using Volo.Abp.Modularity; |
|||
|
|||
namespace ProductManagement.EntityFrameworkCore |
|||
{ |
|||
[DependsOn( |
|||
typeof(ProductManagementDomainModule), |
|||
typeof(AbpEntityFrameworkCoreModule) |
|||
)] |
|||
public class ProductManagementEntityFrameworkCoreModule : AbpModule |
|||
{ |
|||
public override void ConfigureServices(ServiceConfigurationContext context) |
|||
{ |
|||
context.Services.AddAbpDbContext<ProductManagementDbContext>(options => |
|||
{ |
|||
/* Add custom repositories here. Example: |
|||
* options.AddRepository<Question, EfCoreQuestionRepository>(); |
|||
*/ |
|||
}); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,18 @@ |
|||
using JetBrains.Annotations; |
|||
using Volo.Abp.EntityFrameworkCore.Modeling; |
|||
|
|||
namespace ProductManagement.EntityFrameworkCore |
|||
{ |
|||
public class ProductManagementModelBuilderConfigurationOptions : ModelBuilderConfigurationOptions |
|||
{ |
|||
public ProductManagementModelBuilderConfigurationOptions( |
|||
[NotNull] string tablePrefix = ProductManagementConsts.DefaultDbTablePrefix, |
|||
[CanBeNull] string schema = ProductManagementConsts.DefaultDbSchema) |
|||
: base( |
|||
tablePrefix, |
|||
schema) |
|||
{ |
|||
|
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,13 @@ |
|||
<Project Sdk="Microsoft.NET.Sdk"> |
|||
|
|||
<PropertyGroup> |
|||
<TargetFramework>netstandard2.0</TargetFramework> |
|||
<RootNamespace /> |
|||
</PropertyGroup> |
|||
|
|||
<ItemGroup> |
|||
<ProjectReference Include="..\ProductManagement.Domain\ProductManagement.Domain.csproj" /> |
|||
<PackageReference Include="Volo.Abp.EntityFrameworkCore" Version="0.12.0" /> |
|||
</ItemGroup> |
|||
|
|||
</Project> |
|||
@ -0,0 +1,22 @@ |
|||
using Microsoft.Extensions.DependencyInjection; |
|||
using Volo.Abp.Http.Client; |
|||
using Volo.Abp.Modularity; |
|||
|
|||
namespace ProductManagement |
|||
{ |
|||
[DependsOn( |
|||
typeof(ProductManagementApplicationContractsModule), |
|||
typeof(AbpHttpClientModule))] |
|||
public class ProductManagementHttpApiClientModule : AbpModule |
|||
{ |
|||
public const string RemoteServiceName = "ProductManagement"; |
|||
|
|||
public override void ConfigureServices(ServiceConfigurationContext context) |
|||
{ |
|||
context.Services.AddHttpClientProxies( |
|||
typeof(ProductManagementApplicationContractsModule).Assembly, |
|||
RemoteServiceName |
|||
); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,13 @@ |
|||
<Project Sdk="Microsoft.NET.Sdk"> |
|||
|
|||
<PropertyGroup> |
|||
<TargetFramework>netstandard2.0</TargetFramework> |
|||
<RootNamespace /> |
|||
</PropertyGroup> |
|||
|
|||
<ItemGroup> |
|||
<ProjectReference Include="..\ProductManagement.Application.Contracts\ProductManagement.Application.Contracts.csproj" /> |
|||
<PackageReference Include="Volo.Abp.Http.Client" Version="0.12.0" /> |
|||
</ItemGroup> |
|||
|
|||
</Project> |
|||
@ -0,0 +1,13 @@ |
|||
using Volo.Abp.AspNetCore.Mvc; |
|||
using Volo.Abp.Modularity; |
|||
|
|||
namespace ProductManagement |
|||
{ |
|||
[DependsOn( |
|||
typeof(ProductManagementApplicationContractsModule), |
|||
typeof(AbpAspNetCoreMvcModule))] |
|||
public class ProductManagementHttpApiModule : AbpModule |
|||
{ |
|||
|
|||
} |
|||
} |
|||
@ -0,0 +1,13 @@ |
|||
<Project Sdk="Microsoft.NET.Sdk"> |
|||
|
|||
<PropertyGroup> |
|||
<TargetFramework>netstandard2.0</TargetFramework> |
|||
<RootNamespace /> |
|||
</PropertyGroup> |
|||
|
|||
<ItemGroup> |
|||
<ProjectReference Include="..\ProductManagement.Application.Contracts\ProductManagement.Application.Contracts.csproj" /> |
|||
<PackageReference Include="Volo.Abp.AspNetCore.Mvc" Version="0.12.0" /> |
|||
</ItemGroup> |
|||
|
|||
</Project> |
|||
@ -0,0 +1,6 @@ |
|||
{ |
|||
"culture": "en", |
|||
"texts": { |
|||
|
|||
} |
|||
} |
|||
@ -0,0 +1,6 @@ |
|||
{ |
|||
"culture": "pt-BR", |
|||
"texts": { |
|||
|
|||
} |
|||
} |
|||
@ -0,0 +1,6 @@ |
|||
{ |
|||
"culture": "zh-Hans", |
|||
"texts": { |
|||
|
|||
} |
|||
} |
|||
@ -0,0 +1,4 @@ |
|||
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers |
|||
@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI |
|||
@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI.Bootstrap |
|||
@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI.Bundling |
|||
@ -0,0 +1,35 @@ |
|||
<Project Sdk="Microsoft.NET.Sdk.Web"> |
|||
|
|||
<PropertyGroup> |
|||
<TargetFramework>netstandard2.0</TargetFramework> |
|||
<AssetTargetFallback>$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;</AssetTargetFallback> |
|||
<IsPackable>true</IsPackable> |
|||
<OutputType>Library</OutputType> |
|||
<RootNamespace>ProductManagement</RootNamespace> |
|||
</PropertyGroup> |
|||
|
|||
<ItemGroup> |
|||
<EmbeddedResource Include="wwwroot\**\*.*" /> |
|||
<EmbeddedResource Include="Pages\**\*.cshtml" Exclude="*.cs" /> |
|||
<EmbeddedResource Include="Localization\Resources\**\*.json" /> |
|||
</ItemGroup> |
|||
|
|||
<ItemGroup> |
|||
<Content Remove="wwwroot\**\*.*" /> |
|||
<Content Remove="Pages\**\*.cshtml" /> |
|||
<Content Remove="Localization\Resources\**\*.json" /> |
|||
<Content Remove="Properties\launchSettings.json" /> |
|||
<None Include="Properties\launchSettings.json" /> |
|||
</ItemGroup> |
|||
|
|||
<ItemGroup> |
|||
<ProjectReference Include="..\ProductManagement.HttpApi\ProductManagement.HttpApi.csproj" /> |
|||
<PackageReference Include="Volo.Abp.AutoMapper" Version="0.12.0" /> |
|||
<PackageReference Include="Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared" Version="0.12.0" /> |
|||
</ItemGroup> |
|||
|
|||
<ItemGroup> |
|||
<Folder Include="wwwroot\" /> |
|||
</ItemGroup> |
|||
|
|||
</Project> |
|||
@ -0,0 +1,23 @@ |
|||
using System.Threading.Tasks; |
|||
using Volo.Abp.UI.Navigation; |
|||
|
|||
namespace ProductManagement |
|||
{ |
|||
public class ProductManagementMenuContributor : IMenuContributor |
|||
{ |
|||
public async Task ConfigureMenuAsync(MenuConfigurationContext context) |
|||
{ |
|||
if (context.Menu.Name == StandardMenus.Main) |
|||
{ |
|||
await ConfigureMainMenu(context); |
|||
} |
|||
} |
|||
|
|||
private Task ConfigureMainMenu(MenuConfigurationContext context) |
|||
{ |
|||
//Add main menu items.
|
|||
|
|||
return Task.CompletedTask; |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,12 @@ |
|||
using AutoMapper; |
|||
|
|||
namespace ProductManagement |
|||
{ |
|||
public class ProductManagementWebAutoMapperProfile : Profile |
|||
{ |
|||
public ProductManagementWebAutoMapperProfile() |
|||
{ |
|||
//Create mappings.
|
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,62 @@ |
|||
using Localization.Resources.AbpUi; |
|||
using Microsoft.AspNetCore.Mvc.RazorPages; |
|||
using Microsoft.Extensions.DependencyInjection; |
|||
using ProductManagement.Localization; |
|||
using Volo.Abp.AspNetCore.Mvc.Localization; |
|||
using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared; |
|||
using Volo.Abp.AutoMapper; |
|||
using Volo.Abp.Localization; |
|||
using Volo.Abp.Localization.Resources.AbpValidation; |
|||
using Volo.Abp.Modularity; |
|||
using Volo.Abp.UI.Navigation; |
|||
using Volo.Abp.VirtualFileSystem; |
|||
|
|||
namespace ProductManagement |
|||
{ |
|||
[DependsOn(typeof(ProductManagementHttpApiModule))] |
|||
[DependsOn(typeof(AbpAspNetCoreMvcUiThemeSharedModule))] |
|||
[DependsOn(typeof(AbpAutoMapperModule))] |
|||
public class ProductManagementWebModule : AbpModule |
|||
{ |
|||
public override void PreConfigureServices(ServiceConfigurationContext context) |
|||
{ |
|||
context.Services.PreConfigure<AbpMvcDataAnnotationsLocalizationOptions>(options => |
|||
{ |
|||
options.AddAssemblyResource(typeof(ProductManagementResource), typeof(ProductManagementWebModule).Assembly); |
|||
}); |
|||
} |
|||
|
|||
public override void ConfigureServices(ServiceConfigurationContext context) |
|||
{ |
|||
Configure<NavigationOptions>(options => |
|||
{ |
|||
options.MenuContributors.Add(new ProductManagementMenuContributor()); |
|||
}); |
|||
|
|||
Configure<VirtualFileSystemOptions>(options => |
|||
{ |
|||
options.FileSets.AddEmbedded<ProductManagementWebModule>("ProductManagement"); |
|||
}); |
|||
|
|||
Configure<AbpLocalizationOptions>(options => |
|||
{ |
|||
options.Resources |
|||
.Get<ProductManagementResource>() |
|||
.AddBaseTypes( |
|||
typeof(AbpValidationResource), |
|||
typeof(AbpUiResource) |
|||
).AddVirtualJson("/Localization/Resources/ProductManagement"); |
|||
}); |
|||
|
|||
Configure<AbpAutoMapperOptions>(options => |
|||
{ |
|||
options.AddProfile<ProductManagementWebAutoMapperProfile>(validate: true); |
|||
}); |
|||
|
|||
Configure<RazorPagesOptions>(options => |
|||
{ |
|||
//Configure authorization.
|
|||
}); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,27 @@ |
|||
{ |
|||
"iisSettings": { |
|||
"windowsAuthentication": false, |
|||
"anonymousAuthentication": true, |
|||
"iisExpress": { |
|||
"applicationUrl": "http://localhost:56993/", |
|||
"sslPort": 0 |
|||
} |
|||
}, |
|||
"profiles": { |
|||
"IIS Express": { |
|||
"commandName": "IISExpress", |
|||
"launchBrowser": true, |
|||
"environmentVariables": { |
|||
"ASPNETCORE_ENVIRONMENT": "Development" |
|||
} |
|||
}, |
|||
"ProductManagement.Web": { |
|||
"commandName": "Project", |
|||
"launchBrowser": true, |
|||
"environmentVariables": { |
|||
"ASPNETCORE_ENVIRONMENT": "Development" |
|||
}, |
|||
"applicationUrl": "http://localhost:56994/" |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,13 @@ |
|||
using Volo.Abp.Modularity; |
|||
|
|||
namespace ProductManagement |
|||
{ |
|||
[DependsOn( |
|||
typeof(ProductManagementApplicationModule), |
|||
typeof(ProductManagementDomainTestModule) |
|||
)] |
|||
public class ProductManagementApplicationTestModule : AbpModule |
|||
{ |
|||
|
|||
} |
|||
} |
|||
@ -0,0 +1,17 @@ |
|||
<Project Sdk="Microsoft.NET.Sdk"> |
|||
|
|||
<PropertyGroup> |
|||
<TargetFramework>netcoreapp2.2</TargetFramework> |
|||
<RootNamespace /> |
|||
</PropertyGroup> |
|||
|
|||
<ItemGroup> |
|||
<ProjectReference Include="..\..\src\ProductManagement.Application\ProductManagement.Application.csproj" /> |
|||
<ProjectReference Include="..\ProductManagement.Domain.Tests\ProductManagement.Domain.Tests.csproj" /> |
|||
</ItemGroup> |
|||
|
|||
<ItemGroup> |
|||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" /> |
|||
</ItemGroup> |
|||
|
|||
</Project> |
|||
@ -0,0 +1,7 @@ |
|||
namespace ProductManagement |
|||
{ |
|||
public abstract class ProductManagementDomainTestBase : ProductManagementTestBase<ProductManagementDomainTestModule> |
|||
{ |
|||
|
|||
} |
|||
} |
|||
@ -0,0 +1,13 @@ |
|||
using ProductManagement.EntityFrameworkCore; |
|||
using Volo.Abp.Modularity; |
|||
|
|||
namespace ProductManagement |
|||
{ |
|||
[DependsOn( |
|||
typeof(ProductManagementEntityFrameworkCoreTestModule) |
|||
)] |
|||
public class ProductManagementDomainTestModule : AbpModule |
|||
{ |
|||
|
|||
} |
|||
} |
|||
@ -0,0 +1,16 @@ |
|||
<Project Sdk="Microsoft.NET.Sdk"> |
|||
|
|||
<PropertyGroup> |
|||
<TargetFramework>netcoreapp2.2</TargetFramework> |
|||
<RootNamespace /> |
|||
</PropertyGroup> |
|||
|
|||
<ItemGroup> |
|||
<ProjectReference Include="..\ProductManagement.EntityFrameworkCore.Tests\ProductManagement.EntityFrameworkCore.Tests.csproj" /> |
|||
</ItemGroup> |
|||
|
|||
<ItemGroup> |
|||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" /> |
|||
</ItemGroup> |
|||
|
|||
</Project> |
|||
@ -0,0 +1,7 @@ |
|||
namespace ProductManagement.EntityFrameworkCore |
|||
{ |
|||
public class MyEntityRepository_Tests : MyEntityRepository_Tests<ProductManagementEntityFrameworkCoreTestModule> |
|||
{ |
|||
|
|||
} |
|||
} |
|||
@ -0,0 +1,42 @@ |
|||
using Microsoft.Data.Sqlite; |
|||
using Microsoft.EntityFrameworkCore; |
|||
using Microsoft.EntityFrameworkCore.Infrastructure; |
|||
using Microsoft.EntityFrameworkCore.Storage; |
|||
using Microsoft.Extensions.DependencyInjection; |
|||
using Volo.Abp.EntityFrameworkCore; |
|||
using Volo.Abp.Modularity; |
|||
|
|||
namespace ProductManagement.EntityFrameworkCore |
|||
{ |
|||
[DependsOn( |
|||
typeof(ProductManagementTestBaseModule), |
|||
typeof(ProductManagementEntityFrameworkCoreModule) |
|||
)] |
|||
public class ProductManagementEntityFrameworkCoreTestModule : AbpModule |
|||
{ |
|||
public override void ConfigureServices(ServiceConfigurationContext context) |
|||
{ |
|||
var sqliteConnection = CreateDatabaseAndGetConnection(); |
|||
|
|||
Configure<AbpDbContextOptions>(options => |
|||
{ |
|||
options.Configure(abpDbContextConfigurationContext => |
|||
{ |
|||
abpDbContextConfigurationContext.DbContextOptions.UseSqlite(sqliteConnection); |
|||
}); |
|||
}); |
|||
} |
|||
|
|||
private static SqliteConnection CreateDatabaseAndGetConnection() |
|||
{ |
|||
var connection = new SqliteConnection("Data Source=:memory:"); |
|||
connection.Open(); |
|||
|
|||
new ProductManagementDbContext( |
|||
new DbContextOptionsBuilder<ProductManagementDbContext>().UseSqlite(connection).Options |
|||
).GetService<IRelationalDatabaseCreator>().CreateTables(); |
|||
|
|||
return connection; |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,20 @@ |
|||
<Project Sdk="Microsoft.NET.Sdk"> |
|||
|
|||
<PropertyGroup> |
|||
<TargetFramework>netcoreapp2.2</TargetFramework> |
|||
<RootNamespace /> |
|||
</PropertyGroup> |
|||
|
|||
<ItemGroup> |
|||
<ProjectReference Include="..\..\src\ProductManagement.EntityFrameworkCore\ProductManagement.EntityFrameworkCore.csproj" /> |
|||
<ProjectReference Include="..\ProductManagement.TestBase\ProductManagement.TestBase.csproj" /> |
|||
</ItemGroup> |
|||
|
|||
<ItemGroup> |
|||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" /> |
|||
<PackageReference Include="Microsoft.Data.Sqlite" Version="2.2.0" /> |
|||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.2.0" /> |
|||
<PackageReference Include="Microsoft.EntityFrameworkCore.Proxies" Version="2.2.0" /> |
|||
</ItemGroup> |
|||
|
|||
</Project> |
|||
@ -0,0 +1,16 @@ |
|||
using System.Threading.Tasks; |
|||
using Volo.Abp.Modularity; |
|||
using Xunit; |
|||
|
|||
namespace ProductManagement |
|||
{ |
|||
public abstract class MyEntityRepository_Tests<TStartupModule> : ProductManagementTestBase<TStartupModule> |
|||
where TStartupModule : IAbpModule |
|||
{ |
|||
[Fact] |
|||
public async Task Test1() |
|||
{ |
|||
|
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,14 @@ |
|||
using Volo.Abp; |
|||
using Volo.Abp.Modularity; |
|||
|
|||
namespace ProductManagement |
|||
{ |
|||
public abstract class ProductManagementTestBase<TStartupModule> : AbpIntegratedTest<TStartupModule> |
|||
where TStartupModule : IAbpModule |
|||
{ |
|||
protected override void SetAbpApplicationCreationOptions(AbpApplicationCreationOptions options) |
|||
{ |
|||
options.UseAutofac(); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,37 @@ |
|||
using Microsoft.Extensions.DependencyInjection; |
|||
using Volo.Abp; |
|||
using Volo.Abp.Authorization; |
|||
using Volo.Abp.Autofac; |
|||
using Volo.Abp.Modularity; |
|||
|
|||
namespace ProductManagement |
|||
{ |
|||
[DependsOn( |
|||
typeof(AbpAutofacModule), |
|||
typeof(AbpTestBaseModule), |
|||
typeof(AbpAuthorizationModule), |
|||
typeof(ProductManagementDomainModule) |
|||
)] |
|||
public class ProductManagementTestBaseModule : AbpModule |
|||
{ |
|||
public override void ConfigureServices(ServiceConfigurationContext context) |
|||
{ |
|||
context.Services.AddAlwaysAllowAuthorization(); |
|||
} |
|||
|
|||
public override void OnApplicationInitialization(ApplicationInitializationContext context) |
|||
{ |
|||
SeedTestData(context); |
|||
} |
|||
|
|||
private static void SeedTestData(ApplicationInitializationContext context) |
|||
{ |
|||
using (var scope = context.ServiceProvider.CreateScope()) |
|||
{ |
|||
scope.ServiceProvider |
|||
.GetRequiredService<ProductManagementTestDataBuilder>() |
|||
.Build(); |
|||
} |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,8 @@ |
|||
using Volo.Abp.DependencyInjection; |
|||
|
|||
namespace ProductManagement |
|||
{ |
|||
public class ProductManagementTestData : ISingletonDependency |
|||
{ |
|||
} |
|||
} |
|||
@ -0,0 +1,24 @@ |
|||
using Volo.Abp.DependencyInjection; |
|||
using Volo.Abp.Guids; |
|||
|
|||
namespace ProductManagement |
|||
{ |
|||
public class ProductManagementTestDataBuilder : ITransientDependency |
|||
{ |
|||
private readonly IGuidGenerator _guidGenerator; |
|||
private ProductManagementTestData _testData; |
|||
|
|||
public ProductManagementTestDataBuilder( |
|||
IGuidGenerator guidGenerator, |
|||
ProductManagementTestData testData) |
|||
{ |
|||
_guidGenerator = guidGenerator; |
|||
_testData = testData; |
|||
} |
|||
|
|||
public void Build() |
|||
{ |
|||
|
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,24 @@ |
|||
<Project Sdk="Microsoft.NET.Sdk"> |
|||
|
|||
<PropertyGroup> |
|||
<TargetFramework>netcoreapp2.2</TargetFramework> |
|||
<RootNamespace /> |
|||
</PropertyGroup> |
|||
|
|||
<ItemGroup> |
|||
<PackageReference Include="Volo.Abp.Autofac" Version="0.12.0" /> |
|||
<PackageReference Include="Volo.Abp.Authorization" Version="0.12.0" /> |
|||
<PackageReference Include="Volo.Abp.TestBase" Version="0.12.0" /> |
|||
<ProjectReference Include="..\..\src\ProductManagement.Domain\ProductManagement.Domain.csproj" /> |
|||
</ItemGroup> |
|||
|
|||
<ItemGroup> |
|||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" /> |
|||
<PackageReference Include="NSubstitute" Version="3.1.0" /> |
|||
<PackageReference Include="Shouldly" Version="3.0.2" /> |
|||
<PackageReference Include="xunit" Version="2.4.1" /> |
|||
<PackageReference Include="xunit.extensibility.execution" Version="2.4.1" /> |
|||
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1" /> |
|||
</ItemGroup> |
|||
|
|||
</Project> |
|||
Loading…
Reference in new issue