From 0a7975eef13413ed24e60c48699d495b5d9c304e Mon Sep 17 00:00:00 2001 From: Nokecy Date: Thu, 20 Dec 2018 21:53:02 +0800 Subject: [PATCH 001/127] ProfileController Should inherit AbpController --- .../Volo/Abp/Identity/ProfileController.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/identity/src/Volo.Abp.Identity.HttpApi/Volo/Abp/Identity/ProfileController.cs b/modules/identity/src/Volo.Abp.Identity.HttpApi/Volo/Abp/Identity/ProfileController.cs index 449383956b..30f356cac4 100644 --- a/modules/identity/src/Volo.Abp.Identity.HttpApi/Volo/Abp/Identity/ProfileController.cs +++ b/modules/identity/src/Volo.Abp.Identity.HttpApi/Volo/Abp/Identity/ProfileController.cs @@ -9,7 +9,7 @@ namespace Volo.Abp.Identity [RemoteService] [Area("identity")] [ControllerName("Profile")] - public class ProfileController : IProfileAppService + public class ProfileController : AbpController, IProfileAppService { private readonly IProfileAppService _profileAppService; From 0540f9d3a84d701aa9199550f70d2b8f77972c28 Mon Sep 17 00:00:00 2001 From: Nokecy Date: Thu, 20 Dec 2018 21:55:34 +0800 Subject: [PATCH 002/127] Update ProfileController.cs --- .../Volo/Abp/Identity/ProfileController.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/identity/src/Volo.Abp.Identity.HttpApi/Volo/Abp/Identity/ProfileController.cs b/modules/identity/src/Volo.Abp.Identity.HttpApi/Volo/Abp/Identity/ProfileController.cs index 30f356cac4..b1bb8a744c 100644 --- a/modules/identity/src/Volo.Abp.Identity.HttpApi/Volo/Abp/Identity/ProfileController.cs +++ b/modules/identity/src/Volo.Abp.Identity.HttpApi/Volo/Abp/Identity/ProfileController.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Text; using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; +using Volo.Abp.AspNetCore.Mvc; namespace Volo.Abp.Identity { From 444f7d5412ce35118a4feba946bde8d72c60a5aa Mon Sep 17 00:00:00 2001 From: Yunus Emre Kalkan Date: Mon, 24 Dec 2018 13:07:40 +0300 Subject: [PATCH 003/127] project management CRUD AppService #629 --- .../Volo/Docs/Projects/CreateProjectDto.cs | 27 +++++++++ .../Volo/Docs/Projects/IProjectAppService.cs | 7 +++ .../Volo/Docs/Projects/ProjectDto.cs | 13 +++- .../Volo/Docs/Projects/UpdateProjectDto.cs | 25 ++++++++ .../Volo/Docs/Projects/ProjectAppService.cs | 59 ++++++++++++++++++- .../Volo/Docs/Projects/Project.cs | 24 ++++++++ 6 files changed, 152 insertions(+), 3 deletions(-) create mode 100644 modules/docs/src/Volo.Docs.Application.Contracts/Volo/Docs/Projects/CreateProjectDto.cs create mode 100644 modules/docs/src/Volo.Docs.Application.Contracts/Volo/Docs/Projects/UpdateProjectDto.cs diff --git a/modules/docs/src/Volo.Docs.Application.Contracts/Volo/Docs/Projects/CreateProjectDto.cs b/modules/docs/src/Volo.Docs.Application.Contracts/Volo/Docs/Projects/CreateProjectDto.cs new file mode 100644 index 0000000000..cb02c579a3 --- /dev/null +++ b/modules/docs/src/Volo.Docs.Application.Contracts/Volo/Docs/Projects/CreateProjectDto.cs @@ -0,0 +1,27 @@ +using System.Collections.Generic; + +namespace Volo.Docs.Projects +{ + public class CreateProjectDto + { + public string Name { get; set; } + + public string ShortName { get; set; } + + public string Format { get; set; } + + public string DefaultDocumentName { get; set; } + + public string NavigationDocumentName { get; set; } + + public string MinimumVersion { get; set; } + + public string MainWebsiteUrl { get; set; } + + public string LatestVersionBranchName { get; set; } + + public string DocumentStoreType { get; set; } + + public Dictionary ExtraProperties { get; set; } + } +} \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Application.Contracts/Volo/Docs/Projects/IProjectAppService.cs b/modules/docs/src/Volo.Docs.Application.Contracts/Volo/Docs/Projects/IProjectAppService.cs index 5bfc221e4d..8dba5fa3e1 100644 --- a/modules/docs/src/Volo.Docs.Application.Contracts/Volo/Docs/Projects/IProjectAppService.cs +++ b/modules/docs/src/Volo.Docs.Application.Contracts/Volo/Docs/Projects/IProjectAppService.cs @@ -1,3 +1,4 @@ +using System; using System.Threading.Tasks; using Volo.Abp.Application.Dtos; using Volo.Abp.Application.Services; @@ -9,6 +10,12 @@ namespace Volo.Docs.Projects Task> GetListAsync(); Task GetAsync(string shortName); + + Task CreateAsync(CreateProjectDto input); + + Task UpdateAsync(Guid id, UpdateProjectDto input); + + Task DeleteAsync(Guid id); Task> GetVersionsAsync(string shortName); } diff --git a/modules/docs/src/Volo.Docs.Application.Contracts/Volo/Docs/Projects/ProjectDto.cs b/modules/docs/src/Volo.Docs.Application.Contracts/Volo/Docs/Projects/ProjectDto.cs index a29ea840b3..91f5c63a22 100644 --- a/modules/docs/src/Volo.Docs.Application.Contracts/Volo/Docs/Projects/ProjectDto.cs +++ b/modules/docs/src/Volo.Docs.Application.Contracts/Volo/Docs/Projects/ProjectDto.cs @@ -1,4 +1,5 @@ using System; +using System.Collections.Generic; using Volo.Abp.Application.Dtos; namespace Volo.Docs.Projects @@ -10,12 +11,20 @@ namespace Volo.Docs.Projects public string ShortName { get; set; } + public string Format { get; set; } + public string DefaultDocumentName { get; set; } + public string NavigationDocumentName { get; set; } + + public string MinimumVersion { get; set; } + public string MainWebsiteUrl { get; set; } - public virtual string DocumentStoreType { get; protected set; } + public string LatestVersionBranchName { get; set; } + + public string DocumentStoreType { get; set; } - public virtual string Format { get; protected set; } + public Dictionary ExtraProperties { get; set; } } } \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Application.Contracts/Volo/Docs/Projects/UpdateProjectDto.cs b/modules/docs/src/Volo.Docs.Application.Contracts/Volo/Docs/Projects/UpdateProjectDto.cs new file mode 100644 index 0000000000..b16f1916e4 --- /dev/null +++ b/modules/docs/src/Volo.Docs.Application.Contracts/Volo/Docs/Projects/UpdateProjectDto.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using Volo.Abp.Application.Dtos; + +namespace Volo.Docs.Projects +{ + public class UpdateProjectDto + { + public string Name { get; set; } + + public string Format { get; set; } + + public string DefaultDocumentName { get; set; } + + public string NavigationDocumentName { get; set; } + + public string MinimumVersion { get; set; } + + public string MainWebsiteUrl { get; set; } + + public string LatestVersionBranchName { get; set; } + + public Dictionary ExtraProperties { get; set; } + } +} \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Application/Volo/Docs/Projects/ProjectAppService.cs b/modules/docs/src/Volo.Docs.Application/Volo/Docs/Projects/ProjectAppService.cs index 7afefee4f1..6a7e8132fc 100644 --- a/modules/docs/src/Volo.Docs.Application/Volo/Docs/Projects/ProjectAppService.cs +++ b/modules/docs/src/Volo.Docs.Application/Volo/Docs/Projects/ProjectAppService.cs @@ -6,6 +6,7 @@ using Microsoft.Extensions.Caching.Distributed; using Volo.Abp.Application.Dtos; using Volo.Abp.Application.Services; using Volo.Abp.Caching; +using Volo.Abp.Guids; using Volo.Docs.Documents; namespace Volo.Docs.Projects @@ -15,15 +16,17 @@ namespace Volo.Docs.Projects private readonly IProjectRepository _projectRepository; private readonly IDistributedCache> _versionCache; private readonly IDocumentStoreFactory _documentStoreFactory; + private readonly IGuidGenerator _guidGenerator; public ProjectAppService( IProjectRepository projectRepository, IDistributedCache> versionCache, - IDocumentStoreFactory documentStoreFactory) + IDocumentStoreFactory documentStoreFactory, IGuidGenerator guidGenerator) { _projectRepository = projectRepository; _versionCache = versionCache; _documentStoreFactory = documentStoreFactory; + _guidGenerator = guidGenerator; } public async Task> GetListAsync() @@ -42,6 +45,60 @@ namespace Volo.Docs.Projects return ObjectMapper.Map(project); } + public async Task CreateAsync(CreateProjectDto input) + { + var project = new Project(_guidGenerator.Create(), + input.Name, + input.ShortName, + input.DocumentStoreType, + input.Format, + input.DefaultDocumentName, + input.NavigationDocumentName + ) + { + MinimumVersion = input.MinimumVersion, + MainWebsiteUrl = input.MainWebsiteUrl, + LatestVersionBranchName = input.LatestVersionBranchName + }; + + foreach (var extraProperty in input.ExtraProperties) + { + project.ExtraProperties.Add(extraProperty.Key,extraProperty.Value); + } + + project = await _projectRepository.InsertAsync(project); + + return ObjectMapper.Map(project); + } + + public async Task UpdateAsync(Guid id, UpdateProjectDto input) + { + var project = await _projectRepository.GetAsync(id); + + project.SetName(input.Name); + project.SetFormat(input.Format); + project.SetNavigationDocumentName(input.NavigationDocumentName); + project.SetDefaultDocumentName(input.DefaultDocumentName); + + project.MinimumVersion = input.MinimumVersion; + project.MainWebsiteUrl = input.MainWebsiteUrl; + project.LatestVersionBranchName = input.LatestVersionBranchName; + + foreach (var extraProperty in input.ExtraProperties) + { + project.ExtraProperties[extraProperty.Key] = extraProperty.Value; + } + + project = await _projectRepository.UpdateAsync(project); + + return ObjectMapper.Map(project); + } + + public async Task DeleteAsync(Guid id) + { + await _projectRepository.DeleteAsync(id); + } + public async Task> GetVersionsAsync(string shortName) { var project = await _projectRepository.GetByShortNameAsync(shortName); diff --git a/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Project.cs b/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Project.cs index 7472ace4e3..2a98ea6cff 100644 --- a/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Project.cs +++ b/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Project.cs @@ -54,6 +54,8 @@ namespace Volo.Docs.Projects Guid id, [NotNull] string name, [NotNull] string shortName, + [NotNull] string documentStoreType, + [NotNull] string format, [NotNull] string defaultDocumentName, [NotNull] string navigationDocumentName) { @@ -61,10 +63,32 @@ namespace Volo.Docs.Projects Name = Check.NotNullOrWhiteSpace(name, nameof(name)); ShortName = Check.NotNullOrWhiteSpace(shortName, nameof(shortName)); + DocumentStoreType = Check.NotNullOrWhiteSpace(documentStoreType, nameof(documentStoreType)); + Format = Check.NotNullOrWhiteSpace(format, nameof(format)); DefaultDocumentName = Check.NotNullOrWhiteSpace(defaultDocumentName, nameof(defaultDocumentName)); NavigationDocumentName = Check.NotNullOrWhiteSpace(navigationDocumentName, nameof(navigationDocumentName)); ExtraProperties = new Dictionary(); } + + public void SetName(string name) + { + Name = Check.NotNullOrWhiteSpace(name, nameof(name)); + } + + public void SetFormat(string format) + { + Format = Check.NotNullOrWhiteSpace(format, nameof(format)); + } + + public void SetNavigationDocumentName(string navigationDocumentName) + { + NavigationDocumentName = Check.NotNullOrWhiteSpace(navigationDocumentName, nameof(navigationDocumentName)); + } + + public void SetDefaultDocumentName(string defaultDocumentName) + { + DefaultDocumentName = Check.NotNullOrWhiteSpace(defaultDocumentName, nameof(defaultDocumentName)); + } } } \ No newline at end of file From 5bee7411bd30203e9e9bd1c9ead973b3c54d4b34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Kalkan?= Date: Mon, 24 Dec 2018 14:00:00 +0300 Subject: [PATCH 004/127] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5074216c59..330c30d69f 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # ABP -[![Build Status](http://vjenkins.dynu.net:5480/job/abp/badge/icon)](http://vjenkins.dynu.net:5480/blue/organizations/jenkins/abp/activity) +[![Build Status](http://vjenkins.dynu.net:5480/job/abp/badge/icon)](http://ci.volosoft.com:5480/blue/organizations/jenkins/abp/activity) This project is the next generation of the [ASP.NET Boilerplate](https://aspnetboilerplate.com/) web application framework. See [the announcement](https://abp.io/blog/abp/Abp-vNext-Announcement). From ec3e904cd8ed01be4e6c232e99a36413d7c59b74 Mon Sep 17 00:00:00 2001 From: Yunus Emre Kalkan Date: Mon, 24 Dec 2018 15:09:46 +0300 Subject: [PATCH 005/127] Update DocsProjectController.cs --- .../Docs/Projects/DocsProjectController.cs | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/modules/docs/src/Volo.Docs.HttpApi/Volo/Docs/Projects/DocsProjectController.cs b/modules/docs/src/Volo.Docs.HttpApi/Volo/Docs/Projects/DocsProjectController.cs index 773655aab8..180cec622f 100644 --- a/modules/docs/src/Volo.Docs.HttpApi/Volo/Docs/Projects/DocsProjectController.cs +++ b/modules/docs/src/Volo.Docs.HttpApi/Volo/Docs/Projects/DocsProjectController.cs @@ -1,4 +1,5 @@ -using System.Threading.Tasks; +using System; +using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; using Volo.Abp; using Volo.Abp.Application.Dtos; @@ -33,6 +34,21 @@ namespace Volo.Docs.Projects return ProjectAppService.GetAsync(shortName); } + public Task CreateAsync(CreateProjectDto input) + { + return ProjectAppService.CreateAsync(input); + } + + public Task UpdateAsync(Guid id, UpdateProjectDto input) + { + return ProjectAppService.UpdateAsync(id, input); + } + + public Task DeleteAsync(Guid id) + { + return ProjectAppService.DeleteAsync(id); + } + [HttpGet] [Route("{shortName}/versions")] public virtual Task> GetVersionsAsync(string shortName) From 089cf8d8a9173c200db98575333381d3581841b2 Mon Sep 17 00:00:00 2001 From: Yunus Emre Kalkan Date: Mon, 24 Dec 2018 15:28:50 +0300 Subject: [PATCH 006/127] Bookstore App : Upgraded Abp Packages to v0.10.0* https://github.com/abpframework/abp/issues/680 --- .../Acme.BookStore.Application.csproj | 2 +- .../Acme.BookStore.Domain.csproj | 2 +- .../Acme.BookStore.EntityFrameworkCore.csproj | 8 +- .../EntityFrameworkCore/BookStoreDbContext.cs | 5 + ...24122651_Upgreded_ABP_Packages.Designer.cs | 448 ++++++++++++++++++ .../20181224122651_Upgreded_ABP_Packages.cs | 75 +++ .../BookStoreDbContextModelSnapshot.cs | 25 +- .../Acme.BookStore.Web.csproj | 8 +- .../Acme.BookStore.Application.Tests.csproj | 4 +- .../Acme.BookStore.ConsoleApiClient.csproj | 4 +- .../Acme.BookStore.Web.Tests.csproj | 2 +- 11 files changed, 567 insertions(+), 16 deletions(-) create mode 100644 samples/BookStore/src/Acme.BookStore.EntityFrameworkCore/Migrations/20181224122651_Upgreded_ABP_Packages.Designer.cs create mode 100644 samples/BookStore/src/Acme.BookStore.EntityFrameworkCore/Migrations/20181224122651_Upgreded_ABP_Packages.cs diff --git a/samples/BookStore/src/Acme.BookStore.Application/Acme.BookStore.Application.csproj b/samples/BookStore/src/Acme.BookStore.Application/Acme.BookStore.Application.csproj index 7f8acd52f5..3711361b25 100644 --- a/samples/BookStore/src/Acme.BookStore.Application/Acme.BookStore.Application.csproj +++ b/samples/BookStore/src/Acme.BookStore.Application/Acme.BookStore.Application.csproj @@ -7,7 +7,7 @@ - + diff --git a/samples/BookStore/src/Acme.BookStore.Domain/Acme.BookStore.Domain.csproj b/samples/BookStore/src/Acme.BookStore.Domain/Acme.BookStore.Domain.csproj index 87a8e297b3..301c88f15f 100644 --- a/samples/BookStore/src/Acme.BookStore.Domain/Acme.BookStore.Domain.csproj +++ b/samples/BookStore/src/Acme.BookStore.Domain/Acme.BookStore.Domain.csproj @@ -6,7 +6,7 @@ - + diff --git a/samples/BookStore/src/Acme.BookStore.EntityFrameworkCore/Acme.BookStore.EntityFrameworkCore.csproj b/samples/BookStore/src/Acme.BookStore.EntityFrameworkCore/Acme.BookStore.EntityFrameworkCore.csproj index 44fb8928f6..00f6e2ac9e 100644 --- a/samples/BookStore/src/Acme.BookStore.EntityFrameworkCore/Acme.BookStore.EntityFrameworkCore.csproj +++ b/samples/BookStore/src/Acme.BookStore.EntityFrameworkCore/Acme.BookStore.EntityFrameworkCore.csproj @@ -17,10 +17,10 @@ - - - - + + + + diff --git a/samples/BookStore/src/Acme.BookStore.EntityFrameworkCore/EntityFrameworkCore/BookStoreDbContext.cs b/samples/BookStore/src/Acme.BookStore.EntityFrameworkCore/EntityFrameworkCore/BookStoreDbContext.cs index 86d276a6f7..40e8a79dd0 100644 --- a/samples/BookStore/src/Acme.BookStore.EntityFrameworkCore/EntityFrameworkCore/BookStoreDbContext.cs +++ b/samples/BookStore/src/Acme.BookStore.EntityFrameworkCore/EntityFrameworkCore/BookStoreDbContext.cs @@ -1,5 +1,6 @@ using Microsoft.EntityFrameworkCore; using Volo.Abp.EntityFrameworkCore; +using Volo.Abp.EntityFrameworkCore.Modeling; using Volo.Abp.Identity.EntityFrameworkCore; using Volo.Abp.PermissionManagement.EntityFrameworkCore; using Volo.Abp.SettingManagement.EntityFrameworkCore; @@ -20,6 +21,10 @@ namespace Acme.BookStore.EntityFrameworkCore { base.OnModelCreating(modelBuilder); + modelBuilder.Entity( + b => b.ConfigureExtraProperties() + ); + modelBuilder.ConfigureIdentity(); modelBuilder.ConfigurePermissionManagement(); modelBuilder.ConfigureSettingManagement(); diff --git a/samples/BookStore/src/Acme.BookStore.EntityFrameworkCore/Migrations/20181224122651_Upgreded_ABP_Packages.Designer.cs b/samples/BookStore/src/Acme.BookStore.EntityFrameworkCore/Migrations/20181224122651_Upgreded_ABP_Packages.Designer.cs new file mode 100644 index 0000000000..c3cbd8e6d2 --- /dev/null +++ b/samples/BookStore/src/Acme.BookStore.EntityFrameworkCore/Migrations/20181224122651_Upgreded_ABP_Packages.Designer.cs @@ -0,0 +1,448 @@ +// +using System; +using Acme.BookStore.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; + +namespace Acme.BookStore.Migrations +{ + [DbContext(typeof(BookStoreDbContext))] + [Migration("20181224122651_Upgreded_ABP_Packages")] + partial class Upgreded_ABP_Packages + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "2.1.1-rtm-30846") + .HasAnnotation("Relational:MaxIdentifierLength", 128) + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + modelBuilder.Entity("Acme.BookStore.Book", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken(); + + b.Property("CreationTime"); + + b.Property("CreatorId"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties"); + + b.Property("LastModificationTime"); + + b.Property("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128); + + b.Property("Price"); + + b.Property("PublishDate"); + + b.Property("Type"); + + b.HasKey("Id"); + + b.ToTable("Books"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityClaimType", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasColumnName("ConcurrencyStamp") + .HasMaxLength(256); + + b.Property("Description") + .HasMaxLength(256); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties"); + + b.Property("IsStatic"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(256); + + b.Property("Regex") + .HasMaxLength(512); + + b.Property("RegexDescription") + .HasMaxLength(128); + + b.Property("Required"); + + b.Property("ValueType"); + + b.HasKey("Id"); + + b.ToTable("AbpClaimTypes"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasColumnName("ConcurrencyStamp") + .HasMaxLength(256); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties"); + + b.Property("IsDefault") + .HasColumnName("IsDefault"); + + b.Property("IsPublic") + .HasColumnName("IsPublic"); + + b.Property("IsStatic") + .HasColumnName("IsStatic"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(256); + + b.Property("NormalizedName") + .IsRequired() + .HasMaxLength(256); + + b.Property("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("NormalizedName"); + + b.ToTable("AbpRoles"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("ClaimType") + .IsRequired() + .HasMaxLength(256); + + b.Property("ClaimValue") + .HasMaxLength(1024); + + b.Property("RoleId"); + + b.Property("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("AbpRoleClaims"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("AccessFailedCount") + .ValueGeneratedOnAdd() + .HasColumnName("AccessFailedCount") + .HasDefaultValue(0); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasColumnName("ConcurrencyStamp") + .HasMaxLength(256); + + b.Property("CreationTime"); + + b.Property("CreatorId"); + + b.Property("DeleterId"); + + b.Property("DeletionTime"); + + b.Property("Email") + .HasColumnName("Email") + .HasMaxLength(256); + + b.Property("EmailConfirmed") + .ValueGeneratedOnAdd() + .HasColumnName("EmailConfirmed") + .HasDefaultValue(false); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted"); + + b.Property("LastModificationTime"); + + b.Property("LastModifierId"); + + b.Property("LockoutEnabled") + .ValueGeneratedOnAdd() + .HasColumnName("LockoutEnabled") + .HasDefaultValue(false); + + b.Property("LockoutEnd"); + + b.Property("Name") + .HasColumnName("Name") + .HasMaxLength(64); + + b.Property("NormalizedEmail") + .HasColumnName("NormalizedEmail") + .HasMaxLength(256); + + b.Property("NormalizedUserName") + .IsRequired() + .HasColumnName("NormalizedUserName") + .HasMaxLength(256); + + b.Property("PasswordHash") + .HasColumnName("PasswordHash") + .HasMaxLength(256); + + b.Property("PhoneNumber") + .HasColumnName("PhoneNumber") + .HasMaxLength(16); + + b.Property("PhoneNumberConfirmed") + .ValueGeneratedOnAdd() + .HasColumnName("PhoneNumberConfirmed") + .HasDefaultValue(false); + + b.Property("SecurityStamp") + .IsRequired() + .HasColumnName("SecurityStamp") + .HasMaxLength(256); + + b.Property("Surname") + .HasColumnName("Surname") + .HasMaxLength(64); + + b.Property("TenantId") + .HasColumnName("TenantId"); + + b.Property("TwoFactorEnabled") + .ValueGeneratedOnAdd() + .HasColumnName("TwoFactorEnabled") + .HasDefaultValue(false); + + b.Property("UserName") + .IsRequired() + .HasColumnName("UserName") + .HasMaxLength(256); + + b.HasKey("Id"); + + b.HasIndex("Email"); + + b.HasIndex("NormalizedEmail"); + + b.HasIndex("NormalizedUserName"); + + b.HasIndex("UserName"); + + b.ToTable("AbpUsers"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("ClaimType") + .IsRequired() + .HasMaxLength(256); + + b.Property("ClaimValue") + .HasMaxLength(1024); + + b.Property("TenantId"); + + b.Property("UserId"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("AbpUserClaims"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => + { + b.Property("UserId"); + + b.Property("LoginProvider") + .HasMaxLength(64); + + b.Property("ProviderDisplayName") + .HasMaxLength(128); + + b.Property("ProviderKey") + .IsRequired() + .HasMaxLength(196); + + b.Property("TenantId"); + + b.HasKey("UserId", "LoginProvider"); + + b.HasIndex("LoginProvider", "ProviderKey"); + + b.ToTable("AbpUserLogins"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => + { + b.Property("UserId"); + + b.Property("RoleId"); + + b.Property("TenantId"); + + b.HasKey("UserId", "RoleId"); + + b.HasIndex("RoleId", "UserId"); + + b.ToTable("AbpUserRoles"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => + { + b.Property("UserId"); + + b.Property("LoginProvider") + .HasMaxLength(64); + + b.Property("Name") + .HasMaxLength(128); + + b.Property("TenantId"); + + b.Property("Value"); + + b.HasKey("UserId", "LoginProvider", "Name"); + + b.ToTable("AbpUserTokens"); + }); + + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGrant", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128); + + b.Property("ProviderKey") + .IsRequired() + .HasMaxLength(64); + + b.Property("ProviderName") + .IsRequired() + .HasMaxLength(64); + + b.Property("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("Name", "ProviderName", "ProviderKey"); + + b.ToTable("AbpPermissionGrants"); + }); + + modelBuilder.Entity("Volo.Abp.SettingManagement.Setting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128); + + b.Property("ProviderKey") + .HasMaxLength(64); + + b.Property("ProviderName") + .HasMaxLength(64); + + b.Property("Value") + .IsRequired() + .HasMaxLength(2048); + + b.HasKey("Id"); + + b.HasIndex("Name", "ProviderName", "ProviderKey"); + + b.ToTable("AbpSettings"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => + { + b.HasOne("Volo.Abp.Identity.IdentityRole") + .WithMany("Claims") + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser") + .WithMany("Claims") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser") + .WithMany("Logins") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => + { + b.HasOne("Volo.Abp.Identity.IdentityRole") + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("Volo.Abp.Identity.IdentityUser") + .WithMany("Roles") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser") + .WithMany("Tokens") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/samples/BookStore/src/Acme.BookStore.EntityFrameworkCore/Migrations/20181224122651_Upgreded_ABP_Packages.cs b/samples/BookStore/src/Acme.BookStore.EntityFrameworkCore/Migrations/20181224122651_Upgreded_ABP_Packages.cs new file mode 100644 index 0000000000..77545ed9a3 --- /dev/null +++ b/samples/BookStore/src/Acme.BookStore.EntityFrameworkCore/Migrations/20181224122651_Upgreded_ABP_Packages.cs @@ -0,0 +1,75 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +namespace Acme.BookStore.Migrations +{ + public partial class Upgreded_ABP_Packages : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AddColumn( + name: "ConcurrencyStamp", + table: "Books", + nullable: true); + + migrationBuilder.AddColumn( + name: "ExtraProperties", + table: "Books", + nullable: true); + + migrationBuilder.AlterColumn( + name: "ConcurrencyStamp", + table: "AbpRoles", + maxLength: 256, + nullable: false, + oldClrType: typeof(string), + oldNullable: true); + + migrationBuilder.AddColumn( + name: "ExtraProperties", + table: "AbpRoles", + nullable: true); + + migrationBuilder.AddColumn( + name: "ConcurrencyStamp", + table: "AbpClaimTypes", + maxLength: 256, + nullable: false, + defaultValue: ""); + + migrationBuilder.AddColumn( + name: "ExtraProperties", + table: "AbpClaimTypes", + nullable: true); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "ConcurrencyStamp", + table: "Books"); + + migrationBuilder.DropColumn( + name: "ExtraProperties", + table: "Books"); + + migrationBuilder.DropColumn( + name: "ExtraProperties", + table: "AbpRoles"); + + migrationBuilder.DropColumn( + name: "ConcurrencyStamp", + table: "AbpClaimTypes"); + + migrationBuilder.DropColumn( + name: "ExtraProperties", + table: "AbpClaimTypes"); + + migrationBuilder.AlterColumn( + name: "ConcurrencyStamp", + table: "AbpRoles", + nullable: true, + oldClrType: typeof(string), + oldMaxLength: 256); + } + } +} diff --git a/samples/BookStore/src/Acme.BookStore.EntityFrameworkCore/Migrations/BookStoreDbContextModelSnapshot.cs b/samples/BookStore/src/Acme.BookStore.EntityFrameworkCore/Migrations/BookStoreDbContextModelSnapshot.cs index e3bd17d745..a707fa1487 100644 --- a/samples/BookStore/src/Acme.BookStore.EntityFrameworkCore/Migrations/BookStoreDbContextModelSnapshot.cs +++ b/samples/BookStore/src/Acme.BookStore.EntityFrameworkCore/Migrations/BookStoreDbContextModelSnapshot.cs @@ -24,10 +24,16 @@ namespace Acme.BookStore.Migrations b.Property("Id") .ValueGeneratedOnAdd(); + b.Property("ConcurrencyStamp") + .IsConcurrencyToken(); + b.Property("CreationTime"); b.Property("CreatorId"); + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties"); + b.Property("LastModificationTime"); b.Property("LastModifierId"); @@ -52,9 +58,18 @@ namespace Acme.BookStore.Migrations b.Property("Id") .ValueGeneratedOnAdd(); + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasColumnName("ConcurrencyStamp") + .HasMaxLength(256); + b.Property("Description") .HasMaxLength(256); + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties"); + b.Property("IsStatic"); b.Property("Name") @@ -81,7 +96,14 @@ namespace Acme.BookStore.Migrations b.Property("Id") .ValueGeneratedOnAdd(); - b.Property("ConcurrencyStamp"); + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasColumnName("ConcurrencyStamp") + .HasMaxLength(256); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties"); b.Property("IsDefault") .HasColumnName("IsDefault"); @@ -143,6 +165,7 @@ namespace Acme.BookStore.Migrations .HasDefaultValue(0); b.Property("ConcurrencyStamp") + .IsConcurrencyToken() .IsRequired() .HasColumnName("ConcurrencyStamp") .HasMaxLength(256); diff --git a/samples/BookStore/src/Acme.BookStore.Web/Acme.BookStore.Web.csproj b/samples/BookStore/src/Acme.BookStore.Web/Acme.BookStore.Web.csproj index 5cfa52f2c8..9c66768d6d 100644 --- a/samples/BookStore/src/Acme.BookStore.Web/Acme.BookStore.Web.csproj +++ b/samples/BookStore/src/Acme.BookStore.Web/Acme.BookStore.Web.csproj @@ -27,10 +27,10 @@ - - - - + + + + diff --git a/samples/BookStore/test/Acme.BookStore.Application.Tests/Acme.BookStore.Application.Tests.csproj b/samples/BookStore/test/Acme.BookStore.Application.Tests/Acme.BookStore.Application.Tests.csproj index fe3b577dc5..4bd65139df 100644 --- a/samples/BookStore/test/Acme.BookStore.Application.Tests/Acme.BookStore.Application.Tests.csproj +++ b/samples/BookStore/test/Acme.BookStore.Application.Tests/Acme.BookStore.Application.Tests.csproj @@ -8,8 +8,8 @@ - - + + diff --git a/samples/BookStore/test/Acme.BookStore.ConsoleApiClient/Acme.BookStore.ConsoleApiClient.csproj b/samples/BookStore/test/Acme.BookStore.ConsoleApiClient/Acme.BookStore.ConsoleApiClient.csproj index bc66bc8ded..4dade97b64 100644 --- a/samples/BookStore/test/Acme.BookStore.ConsoleApiClient/Acme.BookStore.ConsoleApiClient.csproj +++ b/samples/BookStore/test/Acme.BookStore.ConsoleApiClient/Acme.BookStore.ConsoleApiClient.csproj @@ -6,8 +6,8 @@ - - + + diff --git a/samples/BookStore/test/Acme.BookStore.Web.Tests/Acme.BookStore.Web.Tests.csproj b/samples/BookStore/test/Acme.BookStore.Web.Tests/Acme.BookStore.Web.Tests.csproj index c10970a304..5b7141fdc7 100644 --- a/samples/BookStore/test/Acme.BookStore.Web.Tests/Acme.BookStore.Web.Tests.csproj +++ b/samples/BookStore/test/Acme.BookStore.Web.Tests/Acme.BookStore.Web.Tests.csproj @@ -15,7 +15,7 @@ - + From b1fbafff191fed6f9e6da1efb19a088bd42dbf97 Mon Sep 17 00:00:00 2001 From: Yunus Emre Kalkan Date: Mon, 24 Dec 2018 15:32:51 +0300 Subject: [PATCH 007/127] Resolved : AggregateRoot.ExtraProperties could not be mapped Ef Core #680 --- docs/en/Tutorials/AspNetCore-Mvc/Part-I.md | 24 +++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/docs/en/Tutorials/AspNetCore-Mvc/Part-I.md b/docs/en/Tutorials/AspNetCore-Mvc/Part-I.md index 9f766ae3b0..2afe26e7d2 100644 --- a/docs/en/Tutorials/AspNetCore-Mvc/Part-I.md +++ b/docs/en/Tutorials/AspNetCore-Mvc/Part-I.md @@ -82,11 +82,25 @@ namespace Acme.BookStore EF Core requires you to relate entities with your DbContext. The easiest way to do this is to add a `DbSet` property to the `BookStoreDbContext` class in the `Acme.BookStore.EntityFrameworkCore` project, as shown below: ````C# -public class BookStoreDbContext : AbpDbContext -{ - public DbSet Book { get; set; } - ... -} + public class BookStoreDbContext : AbpDbContext + { + public DbSet Book { get; set; } + + public BookStoreDbContext(DbContextOptions options) + : base(options) + { + + } + + protected override void OnModelCreating(ModelBuilder modelBuilder) + { + base.OnModelCreating(modelBuilder); + + modelBuilder.Entity( + b => b.ConfigureExtraProperties() + ); + } + } ```` #### Add New Migration & Update the Database From 6401c37bc18e4a7cb7d3072668ebc141683d9fe9 Mon Sep 17 00:00:00 2001 From: Halil ibrahim Kalkan Date: Mon, 24 Dec 2018 16:29:52 +0300 Subject: [PATCH 008/127] Resolved #682: Automatically configure IHasExtraProperties for entities in EF Core. --- .../Abp/EntityFrameworkCore/AbpDbContext.cs | 69 +++++++++++++------ .../AbpEntityTypeBuilderExtensions.cs | 9 +++ .../TestApp/SecondContext/SecondDbContext.cs | 6 -- .../TestMigrationsDbContext.cs | 21 ------ .../EntityFrameworkCore/TestAppDbContext.cs | 16 ----- .../DocsDbContextModelBuilderExtensions.cs | 2 - 6 files changed, 58 insertions(+), 65 deletions(-) diff --git a/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/AbpDbContext.cs b/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/AbpDbContext.cs index 6540930405..1f39d94774 100644 --- a/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/AbpDbContext.cs +++ b/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/AbpDbContext.cs @@ -11,6 +11,7 @@ using Microsoft.EntityFrameworkCore.ChangeTracking; using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging.Abstractions; +using Newtonsoft.Json; using Volo.Abp.Auditing; using Volo.Abp.Data; using Volo.Abp.DependencyInjection; @@ -49,10 +50,10 @@ namespace Volo.Abp.EntityFrameworkCore public ILogger> Logger { get; set; } - private static readonly MethodInfo ConfigureGlobalFiltersMethodInfo + private static readonly MethodInfo ConfigureBasePropertiesMethodInfo = typeof(AbpDbContext) .GetMethod( - nameof(ConfigureGlobalFilters), + nameof(ConfigureBaseProperties), BindingFlags.Instance | BindingFlags.NonPublic ); @@ -71,9 +72,7 @@ namespace Volo.Abp.EntityFrameworkCore foreach (var entityType in modelBuilder.Model.GetEntityTypes()) { - ConfigureConcurrencyStamp(entityType); - - ConfigureGlobalFiltersMethodInfo + ConfigureBasePropertiesMethodInfo .MakeGenericMethod(entityType.ClrType) .Invoke(this, new object[] { modelBuilder, entityType }); } @@ -155,19 +154,6 @@ namespace Volo.Abp.EntityFrameworkCore } } - protected virtual void ConfigureConcurrencyStamp(IMutableEntityType entityType) - { - if (!typeof(IHasConcurrencyStamp).GetTypeInfo().IsAssignableFrom(entityType.ClrType)) - { - return; - } - - entityType - .GetProperties() - .First(p => p.Name == nameof(IHasConcurrencyStamp.ConcurrencyStamp)) - .IsConcurrencyToken = true; - } - protected virtual EntityChangeReport ApplyAbpConcepts() { var changeReport = new EntityChangeReport(); @@ -326,10 +312,53 @@ namespace Volo.Abp.EntityFrameworkCore AuditPropertySetter.SetDeletionProperties(entry.Entity); } - protected void ConfigureGlobalFilters(ModelBuilder modelBuilder, IMutableEntityType entityType) + protected virtual void ConfigureBaseProperties(ModelBuilder modelBuilder, IMutableEntityType mutableEntityType) + where TEntity : class + { + ConfigureConcurrencyStamp(modelBuilder, mutableEntityType); + ConfigureExtraProperties(modelBuilder, mutableEntityType); + ConfigureGlobalFilters(modelBuilder, mutableEntityType); + } + + protected virtual void ConfigureConcurrencyStamp(ModelBuilder modelBuilder, IMutableEntityType mutableEntityType) + where TEntity : class + { + if (!typeof(IHasConcurrencyStamp).GetTypeInfo().IsAssignableFrom(typeof(TEntity))) + { + return; + } + + modelBuilder.Entity(b => + { + b.Property(x => ((IHasConcurrencyStamp) x).ConcurrencyStamp) + .IsConcurrencyToken() + .HasColumnName(nameof(IHasConcurrencyStamp.ConcurrencyStamp)); + }); + } + + protected virtual void ConfigureExtraProperties(ModelBuilder modelBuilder, IMutableEntityType mutableEntityType) + where TEntity : class + { + if (!typeof(IHasExtraProperties).GetTypeInfo().IsAssignableFrom(typeof(TEntity))) + { + return; + } + + modelBuilder.Entity(b => + { + b.Property(x => ((IHasExtraProperties) x).ExtraProperties) + .HasConversion( + d => JsonConvert.SerializeObject(d, Formatting.None), + s => JsonConvert.DeserializeObject>(s) + ) + .HasColumnName(nameof(IHasExtraProperties.ExtraProperties)); + }); + } + + protected virtual void ConfigureGlobalFilters(ModelBuilder modelBuilder, IMutableEntityType mutableEntityType) where TEntity : class { - if (entityType.BaseType == null && ShouldFilterEntity(entityType)) + if (mutableEntityType.BaseType == null && ShouldFilterEntity(mutableEntityType)) { var filterExpression = CreateFilterExpression(); if (filterExpression != null) diff --git a/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/Modeling/AbpEntityTypeBuilderExtensions.cs b/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/Modeling/AbpEntityTypeBuilderExtensions.cs index 143dd07e30..200e7a707c 100644 --- a/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/Modeling/AbpEntityTypeBuilderExtensions.cs +++ b/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/Modeling/AbpEntityTypeBuilderExtensions.cs @@ -4,12 +4,21 @@ using Microsoft.EntityFrameworkCore.Metadata.Builders; using Newtonsoft.Json; using Volo.Abp.Auditing; using Volo.Abp.Data; +using Volo.Abp.Domain.Entities; using Volo.Abp.MultiTenancy; namespace Volo.Abp.EntityFrameworkCore.Modeling { public static class AbpEntityTypeBuilderExtensions { + public static void ConfigureConcurrencyStamp(this EntityTypeBuilder b) + where T : class, IHasConcurrencyStamp + { + b.Property(x => x.ConcurrencyStamp) + .IsConcurrencyToken() + .HasColumnName(nameof(IHasConcurrencyStamp.ConcurrencyStamp)); + } + public static void ConfigureExtraProperties(this EntityTypeBuilder b) where T : class, IHasExtraProperties { diff --git a/framework/test/Volo.Abp.EntityFrameworkCore.Tests.SecondContext/Volo/Abp/EntityFrameworkCore/TestApp/SecondContext/SecondDbContext.cs b/framework/test/Volo.Abp.EntityFrameworkCore.Tests.SecondContext/Volo/Abp/EntityFrameworkCore/TestApp/SecondContext/SecondDbContext.cs index bb2f0504ad..9b584a494c 100644 --- a/framework/test/Volo.Abp.EntityFrameworkCore.Tests.SecondContext/Volo/Abp/EntityFrameworkCore/TestApp/SecondContext/SecondDbContext.cs +++ b/framework/test/Volo.Abp.EntityFrameworkCore.Tests.SecondContext/Volo/Abp/EntityFrameworkCore/TestApp/SecondContext/SecondDbContext.cs @@ -21,12 +21,6 @@ namespace Volo.Abp.EntityFrameworkCore.TestApp.SecondContext modelBuilder.Entity(b => { b.HasKey(p => new { p.PersonId, p.Number }); - b.ConfigureExtraProperties(); - }); - - modelBuilder.Entity(b => - { - b.ConfigureExtraProperties(); }); } } diff --git a/framework/test/Volo.Abp.EntityFrameworkCore.Tests/Volo/Abp/EntityFrameworkCore/TestMigrationsDbContext.cs b/framework/test/Volo.Abp.EntityFrameworkCore.Tests/Volo/Abp/EntityFrameworkCore/TestMigrationsDbContext.cs index 68e6ac97cb..cb9726d6b4 100644 --- a/framework/test/Volo.Abp.EntityFrameworkCore.Tests/Volo/Abp/EntityFrameworkCore/TestMigrationsDbContext.cs +++ b/framework/test/Volo.Abp.EntityFrameworkCore.Tests/Volo/Abp/EntityFrameworkCore/TestMigrationsDbContext.cs @@ -1,5 +1,4 @@ using Microsoft.EntityFrameworkCore; -using Volo.Abp.EntityFrameworkCore.Modeling; using Volo.Abp.EntityFrameworkCore.TestApp.SecondContext; using Volo.Abp.EntityFrameworkCore.TestApp.ThirdDbContext; using Volo.Abp.TestApp.Domain; @@ -30,26 +29,6 @@ namespace Volo.Abp.EntityFrameworkCore { b.HasKey(p => new { p.PersonId, p.Number }); }); - - modelBuilder.Entity(b => - { - b.ConfigureExtraProperties(); - }); - - modelBuilder.Entity(b => - { - b.ConfigureExtraProperties(); - }); - - modelBuilder.Entity(b => - { - b.ConfigureExtraProperties(); - }); - - modelBuilder.Entity(b => - { - b.ConfigureExtraProperties(); - }); } } } diff --git a/framework/test/Volo.Abp.EntityFrameworkCore.Tests/Volo/Abp/TestApp/EntityFrameworkCore/TestAppDbContext.cs b/framework/test/Volo.Abp.EntityFrameworkCore.Tests/Volo/Abp/TestApp/EntityFrameworkCore/TestAppDbContext.cs index bef7830567..00e052d2dd 100644 --- a/framework/test/Volo.Abp.EntityFrameworkCore.Tests/Volo/Abp/TestApp/EntityFrameworkCore/TestAppDbContext.cs +++ b/framework/test/Volo.Abp.EntityFrameworkCore.Tests/Volo/Abp/TestApp/EntityFrameworkCore/TestAppDbContext.cs @@ -1,6 +1,5 @@ using Microsoft.EntityFrameworkCore; using Volo.Abp.EntityFrameworkCore; -using Volo.Abp.EntityFrameworkCore.Modeling; using Volo.Abp.EntityFrameworkCore.TestApp.ThirdDbContext; using Volo.Abp.TestApp.Domain; @@ -24,25 +23,10 @@ namespace Volo.Abp.TestApp.EntityFrameworkCore { base.OnModelCreating(modelBuilder); - modelBuilder.Entity(b => - { - b.ConfigureExtraProperties(); - }); - modelBuilder.Entity(b => { b.HasKey(p => new {p.PersonId, p.Number}); }); - - modelBuilder.Entity(b => - { - b.ConfigureExtraProperties(); - }); - - modelBuilder.Entity(b => - { - b.ConfigureExtraProperties(); - }); } } } diff --git a/modules/docs/src/Volo.Docs.EntityFrameworkCore/Volo/Docs/EntityFrameworkCore/DocsDbContextModelBuilderExtensions.cs b/modules/docs/src/Volo.Docs.EntityFrameworkCore/Volo/Docs/EntityFrameworkCore/DocsDbContextModelBuilderExtensions.cs index 1235bf5fb2..20e169f279 100644 --- a/modules/docs/src/Volo.Docs.EntityFrameworkCore/Volo/Docs/EntityFrameworkCore/DocsDbContextModelBuilderExtensions.cs +++ b/modules/docs/src/Volo.Docs.EntityFrameworkCore/Volo/Docs/EntityFrameworkCore/DocsDbContextModelBuilderExtensions.cs @@ -29,8 +29,6 @@ namespace Volo.Docs.EntityFrameworkCore b.Property(x => x.DefaultDocumentName).IsRequired().HasMaxLength(ProjectConsts.MaxDefaultDocumentNameLength); b.Property(x => x.NavigationDocumentName).IsRequired().HasMaxLength(ProjectConsts.MaxNavigationDocumentNameLength); b.Property(x => x.LatestVersionBranchName).HasMaxLength(ProjectConsts.MaxLatestVersionBranchNameLength); - - b.ConfigureExtraProperties(); }); } } From de5f6e29850f091fd330615d18df3e325bcacd13 Mon Sep 17 00:00:00 2001 From: Halil ibrahim Kalkan Date: Mon, 24 Dec 2018 16:40:13 +0300 Subject: [PATCH 009/127] Organized folders --- modules/docs/Volo.Docs.sln | 45 +++++++++++-------- .../DocsDbContextModelBuilderExtensions.cs | 1 + 2 files changed, 28 insertions(+), 18 deletions(-) diff --git a/modules/docs/Volo.Docs.sln b/modules/docs/Volo.Docs.sln index d59169ddde..8d58433a93 100644 --- a/modules/docs/Volo.Docs.sln +++ b/modules/docs/Volo.Docs.sln @@ -5,27 +5,33 @@ VisualStudioVersion = 15.0.27703.1 MinimumVisualStudioVersion = 10.0.40219.1 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{42416152-5BAB-4706-93A6-57A19E71FE14}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Docs.Domain.Shared", "src\Volo.Docs.Domain.Shared\Volo.Docs.Domain.Shared.csproj", "{ECE3F02A-3189-4159-A29C-D7C3D146DE36}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Docs.Domain.Shared", "src\Volo.Docs.Domain.Shared\Volo.Docs.Domain.Shared.csproj", "{ECE3F02A-3189-4159-A29C-D7C3D146DE36}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Docs.Domain", "src\Volo.Docs.Domain\Volo.Docs.Domain.csproj", "{AC02A635-260F-4FE9-9173-A7F8D7777263}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Docs.Domain", "src\Volo.Docs.Domain\Volo.Docs.Domain.csproj", "{AC02A635-260F-4FE9-9173-A7F8D7777263}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Docs.Application.Contracts", "src\Volo.Docs.Application.Contracts\Volo.Docs.Application.Contracts.csproj", "{E70D5691-90FF-44BF-BF16-152B161163D0}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Docs.Application.Contracts", "src\Volo.Docs.Application.Contracts\Volo.Docs.Application.Contracts.csproj", "{E70D5691-90FF-44BF-BF16-152B161163D0}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Docs.Application", "src\Volo.Docs.Application\Volo.Docs.Application.csproj", "{B12622E8-20C7-44DB-8088-33844731469A}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Docs.Application", "src\Volo.Docs.Application\Volo.Docs.Application.csproj", "{B12622E8-20C7-44DB-8088-33844731469A}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Docs.EntityFrameworkCore", "src\Volo.Docs.EntityFrameworkCore\Volo.Docs.EntityFrameworkCore.csproj", "{2D35B1A4-6D22-454D-8C20-46CA7A74535E}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Docs.EntityFrameworkCore", "src\Volo.Docs.EntityFrameworkCore\Volo.Docs.EntityFrameworkCore.csproj", "{2D35B1A4-6D22-454D-8C20-46CA7A74535E}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Docs.HttpApi", "src\Volo.Docs.HttpApi\Volo.Docs.HttpApi.csproj", "{30808C64-F590-47F7-AF8A-256F6B6E186B}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Docs.HttpApi", "src\Volo.Docs.HttpApi\Volo.Docs.HttpApi.csproj", "{30808C64-F590-47F7-AF8A-256F6B6E186B}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Docs.HttpApi.Client", "src\Volo.Docs.HttpApi.Client\Volo.Docs.HttpApi.Client.csproj", "{BF3FDDFF-BED8-422C-82E9-07F181A2D47F}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Docs.HttpApi.Client", "src\Volo.Docs.HttpApi.Client\Volo.Docs.HttpApi.Client.csproj", "{BF3FDDFF-BED8-422C-82E9-07F181A2D47F}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Docs.Web", "src\Volo.Docs.Web\Volo.Docs.Web.csproj", "{871FB966-C89F-4AF5-BB1D-172625AA571C}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Docs.Web", "src\Volo.Docs.Web\Volo.Docs.Web.csproj", "{871FB966-C89F-4AF5-BB1D-172625AA571C}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "app", "app", "{555508AD-F593-43E3-9354-9FA51512F181}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.DocsTestApp", "app\Volo.DocsTestApp\Volo.DocsTestApp.csproj", "{30BC20A3-85CE-4907-8FD0-54153C3F190C}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.DocsTestApp", "app\Volo.DocsTestApp\Volo.DocsTestApp.csproj", "{30BC20A3-85CE-4907-8FD0-54153C3F190C}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.DocsTestApp.EntityFrameworkCore", "app\Volo.DocsTestApp.EntityFrameworkCore\Volo.DocsTestApp.EntityFrameworkCore.csproj", "{A5F88BCB-6B22-4E2D-AE89-AEF1E3DC727A}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.DocsTestApp.EntityFrameworkCore", "app\Volo.DocsTestApp.EntityFrameworkCore\Volo.DocsTestApp.EntityFrameworkCore.csproj", "{A5F88BCB-6B22-4E2D-AE89-AEF1E3DC727A}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "domain", "domain", "{A982A58E-1E92-4764-9F56-39E7AABB8556}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "admin-app", "admin-app", "{BCA19441-17E9-43E6-AED1-15344D18F967}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "public-app", "public-app", "{8B0CDFC9-E313-4323-9390-59CFFAAC60B5}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -78,16 +84,19 @@ Global HideSolutionNode = FALSE EndGlobalSection GlobalSection(NestedProjects) = preSolution - {ECE3F02A-3189-4159-A29C-D7C3D146DE36} = {42416152-5BAB-4706-93A6-57A19E71FE14} - {AC02A635-260F-4FE9-9173-A7F8D7777263} = {42416152-5BAB-4706-93A6-57A19E71FE14} - {E70D5691-90FF-44BF-BF16-152B161163D0} = {42416152-5BAB-4706-93A6-57A19E71FE14} - {B12622E8-20C7-44DB-8088-33844731469A} = {42416152-5BAB-4706-93A6-57A19E71FE14} - {2D35B1A4-6D22-454D-8C20-46CA7A74535E} = {42416152-5BAB-4706-93A6-57A19E71FE14} - {30808C64-F590-47F7-AF8A-256F6B6E186B} = {42416152-5BAB-4706-93A6-57A19E71FE14} - {BF3FDDFF-BED8-422C-82E9-07F181A2D47F} = {42416152-5BAB-4706-93A6-57A19E71FE14} - {871FB966-C89F-4AF5-BB1D-172625AA571C} = {42416152-5BAB-4706-93A6-57A19E71FE14} + {ECE3F02A-3189-4159-A29C-D7C3D146DE36} = {A982A58E-1E92-4764-9F56-39E7AABB8556} + {AC02A635-260F-4FE9-9173-A7F8D7777263} = {A982A58E-1E92-4764-9F56-39E7AABB8556} + {E70D5691-90FF-44BF-BF16-152B161163D0} = {8B0CDFC9-E313-4323-9390-59CFFAAC60B5} + {B12622E8-20C7-44DB-8088-33844731469A} = {8B0CDFC9-E313-4323-9390-59CFFAAC60B5} + {2D35B1A4-6D22-454D-8C20-46CA7A74535E} = {A982A58E-1E92-4764-9F56-39E7AABB8556} + {30808C64-F590-47F7-AF8A-256F6B6E186B} = {8B0CDFC9-E313-4323-9390-59CFFAAC60B5} + {BF3FDDFF-BED8-422C-82E9-07F181A2D47F} = {8B0CDFC9-E313-4323-9390-59CFFAAC60B5} + {871FB966-C89F-4AF5-BB1D-172625AA571C} = {8B0CDFC9-E313-4323-9390-59CFFAAC60B5} {30BC20A3-85CE-4907-8FD0-54153C3F190C} = {555508AD-F593-43E3-9354-9FA51512F181} {A5F88BCB-6B22-4E2D-AE89-AEF1E3DC727A} = {555508AD-F593-43E3-9354-9FA51512F181} + {A982A58E-1E92-4764-9F56-39E7AABB8556} = {42416152-5BAB-4706-93A6-57A19E71FE14} + {BCA19441-17E9-43E6-AED1-15344D18F967} = {42416152-5BAB-4706-93A6-57A19E71FE14} + {8B0CDFC9-E313-4323-9390-59CFFAAC60B5} = {42416152-5BAB-4706-93A6-57A19E71FE14} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {13691265-2547-4FFF-B757-E8FACB05679D} diff --git a/modules/docs/src/Volo.Docs.EntityFrameworkCore/Volo/Docs/EntityFrameworkCore/DocsDbContextModelBuilderExtensions.cs b/modules/docs/src/Volo.Docs.EntityFrameworkCore/Volo/Docs/EntityFrameworkCore/DocsDbContextModelBuilderExtensions.cs index 20e169f279..967938fbae 100644 --- a/modules/docs/src/Volo.Docs.EntityFrameworkCore/Volo/Docs/EntityFrameworkCore/DocsDbContextModelBuilderExtensions.cs +++ b/modules/docs/src/Volo.Docs.EntityFrameworkCore/Volo/Docs/EntityFrameworkCore/DocsDbContextModelBuilderExtensions.cs @@ -22,6 +22,7 @@ namespace Volo.Docs.EntityFrameworkCore { b.ToTable(options.TablePrefix + "Projects", options.Schema); + b.ConfigureConcurrencyStamp(); b.ConfigureExtraProperties(); b.Property(x => x.Name).IsRequired().HasMaxLength(ProjectConsts.MaxNameLength); From dff9924e069c696dd8cb9e7f5eec1c42eca3f06e Mon Sep 17 00:00:00 2001 From: Yunus Emre Kalkan Date: Mon, 24 Dec 2018 17:32:59 +0300 Subject: [PATCH 010/127] #629 moved admin codes to new projects --- modules/docs/Volo.Docs.sln | 35 +++++++ ...lo.Docs.Admin.Application.Contracts.csproj | 17 ++++ .../DocsAdminApplicationContractsModule.cs | 14 +++ .../Docs/Admin}/Projects/CreateProjectDto.cs | 2 +- .../Admin/Projects/IProjectAdminAppService.cs | 20 ++++ .../Volo/Docs/Admin/Projects/ProjectDto.cs | 30 ++++++ .../Docs/Admin}/Projects/UpdateProjectDto.cs | 4 +- .../Volo.Docs.Admin.Application.csproj | 19 ++++ .../DocsAdminApplicationAutoMapperProfile.cs | 14 +++ .../Docs/Admin/DocsAdminApplicationModule.cs | 22 +++++ .../Admin/Projects/ProjectAdminAppService.cs | 95 +++++++++++++++++++ .../Volo.Docs.Admin.HttpApi.Client.csproj | 16 ++++ .../Docs/Admin/DocsHttpApiClientModule.cs | 11 +++ .../Volo.Docs.Admin.HttpApi.csproj | 17 ++++ .../Volo/Docs/Admin/DocsAdminHttpApiModule.cs | 14 +++ .../Projects/DocsAdminProjectController.cs | 50 ++++++++++ .../DocsAdminWebAutoMapperProfile.cs | 13 +++ .../Volo.Docs.Admin.Web/DocsAdminWebModule.cs | 37 ++++++++ .../Properties/launchSettings.json | 27 ++++++ .../Volo.Docs.Admin.Web.csproj | 55 +++++++++++ .../Volo/Docs/Projects/IProjectAppService.cs | 6 -- .../Volo/Docs/Projects/ProjectAppService.cs | 54 ----------- .../Volo/Docs/Projects/IProjectRepository.cs | 5 + .../Docs/Projects/EfCoreProjectRepository.cs | 17 ++++ .../Docs/Projects/DocsProjectController.cs | 15 --- 25 files changed, 530 insertions(+), 79 deletions(-) create mode 100644 modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo.Docs.Admin.Application.Contracts.csproj create mode 100644 modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/DocsAdminApplicationContractsModule.cs rename modules/docs/src/{Volo.Docs.Application.Contracts/Volo/Docs => Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin}/Projects/CreateProjectDto.cs (94%) create mode 100644 modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Projects/IProjectAdminAppService.cs create mode 100644 modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Projects/ProjectDto.cs rename modules/docs/src/{Volo.Docs.Application.Contracts/Volo/Docs => Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin}/Projects/UpdateProjectDto.cs (87%) create mode 100644 modules/docs/src/Volo.Docs.Admin.Application/Volo.Docs.Admin.Application.csproj create mode 100644 modules/docs/src/Volo.Docs.Admin.Application/Volo/Docs/Admin/DocsAdminApplicationAutoMapperProfile.cs create mode 100644 modules/docs/src/Volo.Docs.Admin.Application/Volo/Docs/Admin/DocsAdminApplicationModule.cs create mode 100644 modules/docs/src/Volo.Docs.Admin.Application/Volo/Docs/Admin/Projects/ProjectAdminAppService.cs create mode 100644 modules/docs/src/Volo.Docs.Admin.HttpApi.Client/Volo.Docs.Admin.HttpApi.Client.csproj create mode 100644 modules/docs/src/Volo.Docs.Admin.HttpApi.Client/Volo/Docs/Admin/DocsHttpApiClientModule.cs create mode 100644 modules/docs/src/Volo.Docs.Admin.HttpApi/Volo.Docs.Admin.HttpApi.csproj create mode 100644 modules/docs/src/Volo.Docs.Admin.HttpApi/Volo/Docs/Admin/DocsAdminHttpApiModule.cs create mode 100644 modules/docs/src/Volo.Docs.Admin.HttpApi/Volo/Docs/Admin/Projects/DocsAdminProjectController.cs create mode 100644 modules/docs/src/Volo.Docs.Admin.Web/DocsAdminWebAutoMapperProfile.cs create mode 100644 modules/docs/src/Volo.Docs.Admin.Web/DocsAdminWebModule.cs create mode 100644 modules/docs/src/Volo.Docs.Admin.Web/Properties/launchSettings.json create mode 100644 modules/docs/src/Volo.Docs.Admin.Web/Volo.Docs.Admin.Web.csproj diff --git a/modules/docs/Volo.Docs.sln b/modules/docs/Volo.Docs.sln index 8d58433a93..3fe7cc736f 100644 --- a/modules/docs/Volo.Docs.sln +++ b/modules/docs/Volo.Docs.sln @@ -33,6 +33,16 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "admin-app", "admin-app", "{ EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "public-app", "public-app", "{8B0CDFC9-E313-4323-9390-59CFFAAC60B5}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Docs.Admin.Application.Contracts", "src\Volo.Docs.Admin.Application.Contracts\Volo.Docs.Admin.Application.Contracts.csproj", "{37D483C8-400B-4127-A6D0-2EE4E80CB696}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Docs.Admin.Application", "src\Volo.Docs.Admin.Application\Volo.Docs.Admin.Application.csproj", "{823C51A7-40AB-45D8-8FB8-F212AF7E45F2}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Docs.Admin.HttpApi", "src\Volo.Docs.Admin.HttpApi\Volo.Docs.Admin.HttpApi.csproj", "{262F38DB-62AF-427F-96E2-C6385C5AB695}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Docs.Admin.HttpApi.Client", "src\Volo.Docs.Admin.HttpApi.Client\Volo.Docs.Admin.HttpApi.Client.csproj", "{81EE378A-0DE1-47BA-86D9-08EF6317BB95}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Docs.Admin.Web", "src\Volo.Docs.Admin.Web\Volo.Docs.Admin.Web.csproj", "{116A6145-9D66-4867-B3EF-A464FAC47946}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -79,6 +89,26 @@ Global {A5F88BCB-6B22-4E2D-AE89-AEF1E3DC727A}.Debug|Any CPU.Build.0 = Debug|Any CPU {A5F88BCB-6B22-4E2D-AE89-AEF1E3DC727A}.Release|Any CPU.ActiveCfg = Release|Any CPU {A5F88BCB-6B22-4E2D-AE89-AEF1E3DC727A}.Release|Any CPU.Build.0 = Release|Any CPU + {37D483C8-400B-4127-A6D0-2EE4E80CB696}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {37D483C8-400B-4127-A6D0-2EE4E80CB696}.Debug|Any CPU.Build.0 = Debug|Any CPU + {37D483C8-400B-4127-A6D0-2EE4E80CB696}.Release|Any CPU.ActiveCfg = Release|Any CPU + {37D483C8-400B-4127-A6D0-2EE4E80CB696}.Release|Any CPU.Build.0 = Release|Any CPU + {823C51A7-40AB-45D8-8FB8-F212AF7E45F2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {823C51A7-40AB-45D8-8FB8-F212AF7E45F2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {823C51A7-40AB-45D8-8FB8-F212AF7E45F2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {823C51A7-40AB-45D8-8FB8-F212AF7E45F2}.Release|Any CPU.Build.0 = Release|Any CPU + {262F38DB-62AF-427F-96E2-C6385C5AB695}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {262F38DB-62AF-427F-96E2-C6385C5AB695}.Debug|Any CPU.Build.0 = Debug|Any CPU + {262F38DB-62AF-427F-96E2-C6385C5AB695}.Release|Any CPU.ActiveCfg = Release|Any CPU + {262F38DB-62AF-427F-96E2-C6385C5AB695}.Release|Any CPU.Build.0 = Release|Any CPU + {81EE378A-0DE1-47BA-86D9-08EF6317BB95}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {81EE378A-0DE1-47BA-86D9-08EF6317BB95}.Debug|Any CPU.Build.0 = Debug|Any CPU + {81EE378A-0DE1-47BA-86D9-08EF6317BB95}.Release|Any CPU.ActiveCfg = Release|Any CPU + {81EE378A-0DE1-47BA-86D9-08EF6317BB95}.Release|Any CPU.Build.0 = Release|Any CPU + {116A6145-9D66-4867-B3EF-A464FAC47946}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {116A6145-9D66-4867-B3EF-A464FAC47946}.Debug|Any CPU.Build.0 = Debug|Any CPU + {116A6145-9D66-4867-B3EF-A464FAC47946}.Release|Any CPU.ActiveCfg = Release|Any CPU + {116A6145-9D66-4867-B3EF-A464FAC47946}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -97,6 +127,11 @@ Global {A982A58E-1E92-4764-9F56-39E7AABB8556} = {42416152-5BAB-4706-93A6-57A19E71FE14} {BCA19441-17E9-43E6-AED1-15344D18F967} = {42416152-5BAB-4706-93A6-57A19E71FE14} {8B0CDFC9-E313-4323-9390-59CFFAAC60B5} = {42416152-5BAB-4706-93A6-57A19E71FE14} + {37D483C8-400B-4127-A6D0-2EE4E80CB696} = {BCA19441-17E9-43E6-AED1-15344D18F967} + {823C51A7-40AB-45D8-8FB8-F212AF7E45F2} = {BCA19441-17E9-43E6-AED1-15344D18F967} + {262F38DB-62AF-427F-96E2-C6385C5AB695} = {BCA19441-17E9-43E6-AED1-15344D18F967} + {81EE378A-0DE1-47BA-86D9-08EF6317BB95} = {BCA19441-17E9-43E6-AED1-15344D18F967} + {116A6145-9D66-4867-B3EF-A464FAC47946} = {BCA19441-17E9-43E6-AED1-15344D18F967} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {13691265-2547-4FFF-B757-E8FACB05679D} diff --git a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo.Docs.Admin.Application.Contracts.csproj b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo.Docs.Admin.Application.Contracts.csproj new file mode 100644 index 0000000000..0835730d57 --- /dev/null +++ b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo.Docs.Admin.Application.Contracts.csproj @@ -0,0 +1,17 @@ + + + + + + netstandard2.0 + Volo.Docs.Admin.Application.Contracts + Volo.Docs.Admin.Application.Contracts + + + + + + + + + diff --git a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/DocsAdminApplicationContractsModule.cs b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/DocsAdminApplicationContractsModule.cs new file mode 100644 index 0000000000..547fb6bf71 --- /dev/null +++ b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/DocsAdminApplicationContractsModule.cs @@ -0,0 +1,14 @@ +using Volo.Abp.Application; +using Volo.Abp.Modularity; + +namespace Volo.Docs.Admin +{ + [DependsOn( + typeof(DocsDomainSharedModule), + typeof(AbpDddApplicationModule) + )] + public class DocsAdminApplicationContractsModule : AbpModule + { + + } +} diff --git a/modules/docs/src/Volo.Docs.Application.Contracts/Volo/Docs/Projects/CreateProjectDto.cs b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Projects/CreateProjectDto.cs similarity index 94% rename from modules/docs/src/Volo.Docs.Application.Contracts/Volo/Docs/Projects/CreateProjectDto.cs rename to modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Projects/CreateProjectDto.cs index cb02c579a3..2427d2d51f 100644 --- a/modules/docs/src/Volo.Docs.Application.Contracts/Volo/Docs/Projects/CreateProjectDto.cs +++ b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Projects/CreateProjectDto.cs @@ -1,6 +1,6 @@ using System.Collections.Generic; -namespace Volo.Docs.Projects +namespace Volo.Docs.Admin.Projects { public class CreateProjectDto { diff --git a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Projects/IProjectAdminAppService.cs b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Projects/IProjectAdminAppService.cs new file mode 100644 index 0000000000..34b607689c --- /dev/null +++ b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Projects/IProjectAdminAppService.cs @@ -0,0 +1,20 @@ +using System; +using System.Threading.Tasks; +using Volo.Abp.Application.Dtos; +using Volo.Abp.Application.Services; + +namespace Volo.Docs.Admin.Projects +{ + public interface IProjectAdminAppService : IApplicationService + { + Task> GetListAsync(PagedAndSortedResultRequestDto input); + + Task GetAsync(Guid id); + + Task CreateAsync(CreateProjectDto input); + + Task UpdateAsync(Guid id, UpdateProjectDto input); + + Task DeleteAsync(Guid id); + } +} \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Projects/ProjectDto.cs b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Projects/ProjectDto.cs new file mode 100644 index 0000000000..c5a3bd6eb2 --- /dev/null +++ b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Projects/ProjectDto.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using Volo.Abp.Application.Dtos; + +namespace Volo.Docs.Admin.Projects +{ + [Serializable] + public class ProjectDto : EntityDto + { + public string Name { get; set; } + + public string ShortName { get; set; } + + public string Format { get; set; } + + public string DefaultDocumentName { get; set; } + + public string NavigationDocumentName { get; set; } + + public string MinimumVersion { get; set; } + + public string MainWebsiteUrl { get; set; } + + public string LatestVersionBranchName { get; set; } + + public string DocumentStoreType { get; set; } + + public Dictionary ExtraProperties { get; set; } + } +} \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Application.Contracts/Volo/Docs/Projects/UpdateProjectDto.cs b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Projects/UpdateProjectDto.cs similarity index 87% rename from modules/docs/src/Volo.Docs.Application.Contracts/Volo/Docs/Projects/UpdateProjectDto.cs rename to modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Projects/UpdateProjectDto.cs index b16f1916e4..b2ac8472ae 100644 --- a/modules/docs/src/Volo.Docs.Application.Contracts/Volo/Docs/Projects/UpdateProjectDto.cs +++ b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Projects/UpdateProjectDto.cs @@ -1,8 +1,6 @@ -using System; using System.Collections.Generic; -using Volo.Abp.Application.Dtos; -namespace Volo.Docs.Projects +namespace Volo.Docs.Admin.Projects { public class UpdateProjectDto { diff --git a/modules/docs/src/Volo.Docs.Admin.Application/Volo.Docs.Admin.Application.csproj b/modules/docs/src/Volo.Docs.Admin.Application/Volo.Docs.Admin.Application.csproj new file mode 100644 index 0000000000..73d2afc26b --- /dev/null +++ b/modules/docs/src/Volo.Docs.Admin.Application/Volo.Docs.Admin.Application.csproj @@ -0,0 +1,19 @@ + + + + + + netstandard2.0 + Volo.Docs.Admin.Application + Volo.Docs.Admin.Application + + + + + + + + + + + diff --git a/modules/docs/src/Volo.Docs.Admin.Application/Volo/Docs/Admin/DocsAdminApplicationAutoMapperProfile.cs b/modules/docs/src/Volo.Docs.Admin.Application/Volo/Docs/Admin/DocsAdminApplicationAutoMapperProfile.cs new file mode 100644 index 0000000000..e51cce664b --- /dev/null +++ b/modules/docs/src/Volo.Docs.Admin.Application/Volo/Docs/Admin/DocsAdminApplicationAutoMapperProfile.cs @@ -0,0 +1,14 @@ +using AutoMapper; +using Volo.Docs.Admin.Projects; +using Volo.Docs.Projects; + +namespace Volo.Docs.Admin +{ + public class DocsAdminApplicationAutoMapperProfile : Profile + { + public DocsAdminApplicationAutoMapperProfile() + { + CreateMap(); + } + } +} \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Admin.Application/Volo/Docs/Admin/DocsAdminApplicationModule.cs b/modules/docs/src/Volo.Docs.Admin.Application/Volo/Docs/Admin/DocsAdminApplicationModule.cs new file mode 100644 index 0000000000..1771b00cdb --- /dev/null +++ b/modules/docs/src/Volo.Docs.Admin.Application/Volo/Docs/Admin/DocsAdminApplicationModule.cs @@ -0,0 +1,22 @@ +using Volo.Abp.AutoMapper; +using Volo.Abp.Caching; +using Volo.Abp.Modularity; + +namespace Volo.Docs.Admin +{ + [DependsOn( + typeof(DocsDomainModule), + typeof(DocsAdminApplicationContractsModule), + typeof(AbpCachingModule), + typeof(AbpAutoMapperModule))] + public class DocsAdminApplicationModule : AbpModule + { + public override void ConfigureServices(ServiceConfigurationContext context) + { + Configure(options => + { + options.AddProfile(validate: true); + }); + } + } +} diff --git a/modules/docs/src/Volo.Docs.Admin.Application/Volo/Docs/Admin/Projects/ProjectAdminAppService.cs b/modules/docs/src/Volo.Docs.Admin.Application/Volo/Docs/Admin/Projects/ProjectAdminAppService.cs new file mode 100644 index 0000000000..25e9754140 --- /dev/null +++ b/modules/docs/src/Volo.Docs.Admin.Application/Volo/Docs/Admin/Projects/ProjectAdminAppService.cs @@ -0,0 +1,95 @@ +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Volo.Abp.Application.Dtos; +using Volo.Abp.Application.Services; +using Volo.Abp.Guids; +using Volo.Docs.Projects; + +namespace Volo.Docs.Admin.Projects +{ + public class ProjectAdminAppService : ApplicationService, IProjectAdminAppService + { + private readonly IProjectRepository _projectRepository; + private readonly IGuidGenerator _guidGenerator; + + public ProjectAdminAppService( + IProjectRepository projectRepository, IGuidGenerator guidGenerator) + { + _projectRepository = projectRepository; + _guidGenerator = guidGenerator; + } + + public async Task> GetListAsync(PagedAndSortedResultRequestDto input) + { + var blogs = await _projectRepository.GetListAsync(input.Sorting, input.MaxResultCount, input.SkipCount); + + var totalCount = await _projectRepository.GetTotalProjectCount(); + + var dtos = ObjectMapper.Map, List>(blogs); + + return new PagedResultDto(totalCount, dtos); + } + + public async Task GetAsync(Guid id) + { + var project = await _projectRepository.GetAsync(id); + + return ObjectMapper.Map(project); + } + + public async Task CreateAsync(CreateProjectDto input) + { + var project = new Project(_guidGenerator.Create(), + input.Name, + input.ShortName, + input.DocumentStoreType, + input.Format, + input.DefaultDocumentName, + input.NavigationDocumentName + ) + { + MinimumVersion = input.MinimumVersion, + MainWebsiteUrl = input.MainWebsiteUrl, + LatestVersionBranchName = input.LatestVersionBranchName + }; + + foreach (var extraProperty in input.ExtraProperties) + { + project.ExtraProperties.Add(extraProperty.Key,extraProperty.Value); + } + + project = await _projectRepository.InsertAsync(project); + + return ObjectMapper.Map(project); + } + + public async Task UpdateAsync(Guid id, UpdateProjectDto input) + { + var project = await _projectRepository.GetAsync(id); + + project.SetName(input.Name); + project.SetFormat(input.Format); + project.SetNavigationDocumentName(input.NavigationDocumentName); + project.SetDefaultDocumentName(input.DefaultDocumentName); + + project.MinimumVersion = input.MinimumVersion; + project.MainWebsiteUrl = input.MainWebsiteUrl; + project.LatestVersionBranchName = input.LatestVersionBranchName; + + foreach (var extraProperty in input.ExtraProperties) + { + project.ExtraProperties[extraProperty.Key] = extraProperty.Value; + } + + project = await _projectRepository.UpdateAsync(project); + + return ObjectMapper.Map(project); + } + + public async Task DeleteAsync(Guid id) + { + await _projectRepository.DeleteAsync(id); + } + } +} \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Admin.HttpApi.Client/Volo.Docs.Admin.HttpApi.Client.csproj b/modules/docs/src/Volo.Docs.Admin.HttpApi.Client/Volo.Docs.Admin.HttpApi.Client.csproj new file mode 100644 index 0000000000..c76ce2895c --- /dev/null +++ b/modules/docs/src/Volo.Docs.Admin.HttpApi.Client/Volo.Docs.Admin.HttpApi.Client.csproj @@ -0,0 +1,16 @@ + + + + + + netstandard2.0 + Volo.Docs.Admin.HttpApi.Client + Volo.Docs.Admin.HttpApi.Client + + + + + + + + diff --git a/modules/docs/src/Volo.Docs.Admin.HttpApi.Client/Volo/Docs/Admin/DocsHttpApiClientModule.cs b/modules/docs/src/Volo.Docs.Admin.HttpApi.Client/Volo/Docs/Admin/DocsHttpApiClientModule.cs new file mode 100644 index 0000000000..5a2e66e5ca --- /dev/null +++ b/modules/docs/src/Volo.Docs.Admin.HttpApi.Client/Volo/Docs/Admin/DocsHttpApiClientModule.cs @@ -0,0 +1,11 @@ +using Volo.Abp.Modularity; + +namespace Volo.Docs.Admin +{ + [DependsOn( + typeof(DocsAdminApplicationContractsModule))] + public class DocsAdminHttpApiClientModule : AbpModule + { + + } +} diff --git a/modules/docs/src/Volo.Docs.Admin.HttpApi/Volo.Docs.Admin.HttpApi.csproj b/modules/docs/src/Volo.Docs.Admin.HttpApi/Volo.Docs.Admin.HttpApi.csproj new file mode 100644 index 0000000000..cea70211b2 --- /dev/null +++ b/modules/docs/src/Volo.Docs.Admin.HttpApi/Volo.Docs.Admin.HttpApi.csproj @@ -0,0 +1,17 @@ + + + + + + netstandard2.0 + Volo.Docs.Admin.HttpApi + Volo.Docs.Admin.HttpApi + + + + + + + + + diff --git a/modules/docs/src/Volo.Docs.Admin.HttpApi/Volo/Docs/Admin/DocsAdminHttpApiModule.cs b/modules/docs/src/Volo.Docs.Admin.HttpApi/Volo/Docs/Admin/DocsAdminHttpApiModule.cs new file mode 100644 index 0000000000..46321bbcfc --- /dev/null +++ b/modules/docs/src/Volo.Docs.Admin.HttpApi/Volo/Docs/Admin/DocsAdminHttpApiModule.cs @@ -0,0 +1,14 @@ +using Volo.Abp.AspNetCore.Mvc; +using Volo.Abp.Modularity; + +namespace Volo.Docs.Admin +{ + [DependsOn( + typeof(DocsAdminApplicationContractsModule), + typeof(AbpAspNetCoreMvcModule) + )] + public class DocsAdminHttpApiModule : AbpModule + { + + } +} diff --git a/modules/docs/src/Volo.Docs.Admin.HttpApi/Volo/Docs/Admin/Projects/DocsAdminProjectController.cs b/modules/docs/src/Volo.Docs.Admin.HttpApi/Volo/Docs/Admin/Projects/DocsAdminProjectController.cs new file mode 100644 index 0000000000..58f3f23758 --- /dev/null +++ b/modules/docs/src/Volo.Docs.Admin.HttpApi/Volo/Docs/Admin/Projects/DocsAdminProjectController.cs @@ -0,0 +1,50 @@ +using System; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Mvc; +using Volo.Abp; +using Volo.Abp.Application.Dtos; +using Volo.Abp.AspNetCore.Mvc; + +namespace Volo.Docs.Admin.Projects +{ + [RemoteService] + [Area("docs")] + [ControllerName("Project")] + [Route("api/docs/admin/projects")] + public class DocsAdminProjectController : AbpController, IProjectAdminAppService + { + protected IProjectAdminAppService ProjectAppService { get; } + + public DocsAdminProjectController(IProjectAdminAppService projectAppService) + { + ProjectAppService = projectAppService; + } + + public Task> GetListAsync(PagedAndSortedResultRequestDto input) + { + return ProjectAppService.GetListAsync(input); + } + + [HttpGet] + [Route("{id}")] + public Task GetAsync(Guid id) + { + return ProjectAppService.GetAsync(id); + } + + public Task CreateAsync(CreateProjectDto input) + { + return ProjectAppService.CreateAsync(input); + } + + public Task UpdateAsync(Guid id, UpdateProjectDto input) + { + return ProjectAppService.UpdateAsync(id, input); + } + + public Task DeleteAsync(Guid id) + { + return ProjectAppService.DeleteAsync(id); + } + } +} diff --git a/modules/docs/src/Volo.Docs.Admin.Web/DocsAdminWebAutoMapperProfile.cs b/modules/docs/src/Volo.Docs.Admin.Web/DocsAdminWebAutoMapperProfile.cs new file mode 100644 index 0000000000..0b9d5ebd3b --- /dev/null +++ b/modules/docs/src/Volo.Docs.Admin.Web/DocsAdminWebAutoMapperProfile.cs @@ -0,0 +1,13 @@ +using AutoMapper; +using Volo.Abp.AutoMapper; + +namespace Volo.Docs.Admin +{ + public class DocsAdminWebAutoMapperProfile : Profile + { + public DocsAdminWebAutoMapperProfile() + { + + } + } +} diff --git a/modules/docs/src/Volo.Docs.Admin.Web/DocsAdminWebModule.cs b/modules/docs/src/Volo.Docs.Admin.Web/DocsAdminWebModule.cs new file mode 100644 index 0000000000..a443865676 --- /dev/null +++ b/modules/docs/src/Volo.Docs.Admin.Web/DocsAdminWebModule.cs @@ -0,0 +1,37 @@ +using Volo.Abp.AspNetCore.Mvc.Localization; +using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap; +using Volo.Abp.AutoMapper; +using Volo.Abp.Modularity; +using Volo.Abp.VirtualFileSystem; +using Volo.Docs.Localization; + +namespace Volo.Docs.Admin +{ + [DependsOn( + typeof(DocsAdminHttpApiModule), + typeof(AbpAspNetCoreMvcUiBootstrapModule) + )] + public class DocsAdminWebModule : AbpModule + { + public override void PreConfigureServices(ServiceConfigurationContext context) + { + PreConfigure(options => + { + options.AddAssemblyResource(typeof(DocsResource), typeof(DocsAdminWebModule).Assembly); + }); + } + + public override void ConfigureServices(ServiceConfigurationContext context) + { + Configure(options => + { + options.FileSets.AddEmbedded("Volo.Docs.Admin"); + }); + + Configure(options => + { + options.AddProfile(validate: true); + }); + } + } +} diff --git a/modules/docs/src/Volo.Docs.Admin.Web/Properties/launchSettings.json b/modules/docs/src/Volo.Docs.Admin.Web/Properties/launchSettings.json new file mode 100644 index 0000000000..b0ed7371d0 --- /dev/null +++ b/modules/docs/src/Volo.Docs.Admin.Web/Properties/launchSettings.json @@ -0,0 +1,27 @@ +{ + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:51397", + "sslPort": 44346 + } + }, + "profiles": { + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "Volo.Docs.Admin.Web": { + "commandName": "Project", + "launchBrowser": true, + "applicationUrl": "https://localhost:5001;http://localhost:5000", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + } + } +} \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Admin.Web/Volo.Docs.Admin.Web.csproj b/modules/docs/src/Volo.Docs.Admin.Web/Volo.Docs.Admin.Web.csproj new file mode 100644 index 0000000000..b5b4569789 --- /dev/null +++ b/modules/docs/src/Volo.Docs.Admin.Web/Volo.Docs.Admin.Web.csproj @@ -0,0 +1,55 @@ + + + + + + netstandard2.0 + Volo.Docs.Admin.Web + Volo.Docs.Admin.Web + Library + true + Volo.Docs.Admin + 2.8 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/modules/docs/src/Volo.Docs.Application.Contracts/Volo/Docs/Projects/IProjectAppService.cs b/modules/docs/src/Volo.Docs.Application.Contracts/Volo/Docs/Projects/IProjectAppService.cs index 8dba5fa3e1..f06c676079 100644 --- a/modules/docs/src/Volo.Docs.Application.Contracts/Volo/Docs/Projects/IProjectAppService.cs +++ b/modules/docs/src/Volo.Docs.Application.Contracts/Volo/Docs/Projects/IProjectAppService.cs @@ -10,12 +10,6 @@ namespace Volo.Docs.Projects Task> GetListAsync(); Task GetAsync(string shortName); - - Task CreateAsync(CreateProjectDto input); - - Task UpdateAsync(Guid id, UpdateProjectDto input); - - Task DeleteAsync(Guid id); Task> GetVersionsAsync(string shortName); } diff --git a/modules/docs/src/Volo.Docs.Application/Volo/Docs/Projects/ProjectAppService.cs b/modules/docs/src/Volo.Docs.Application/Volo/Docs/Projects/ProjectAppService.cs index 6a7e8132fc..20970ade0d 100644 --- a/modules/docs/src/Volo.Docs.Application/Volo/Docs/Projects/ProjectAppService.cs +++ b/modules/docs/src/Volo.Docs.Application/Volo/Docs/Projects/ProjectAppService.cs @@ -45,60 +45,6 @@ namespace Volo.Docs.Projects return ObjectMapper.Map(project); } - public async Task CreateAsync(CreateProjectDto input) - { - var project = new Project(_guidGenerator.Create(), - input.Name, - input.ShortName, - input.DocumentStoreType, - input.Format, - input.DefaultDocumentName, - input.NavigationDocumentName - ) - { - MinimumVersion = input.MinimumVersion, - MainWebsiteUrl = input.MainWebsiteUrl, - LatestVersionBranchName = input.LatestVersionBranchName - }; - - foreach (var extraProperty in input.ExtraProperties) - { - project.ExtraProperties.Add(extraProperty.Key,extraProperty.Value); - } - - project = await _projectRepository.InsertAsync(project); - - return ObjectMapper.Map(project); - } - - public async Task UpdateAsync(Guid id, UpdateProjectDto input) - { - var project = await _projectRepository.GetAsync(id); - - project.SetName(input.Name); - project.SetFormat(input.Format); - project.SetNavigationDocumentName(input.NavigationDocumentName); - project.SetDefaultDocumentName(input.DefaultDocumentName); - - project.MinimumVersion = input.MinimumVersion; - project.MainWebsiteUrl = input.MainWebsiteUrl; - project.LatestVersionBranchName = input.LatestVersionBranchName; - - foreach (var extraProperty in input.ExtraProperties) - { - project.ExtraProperties[extraProperty.Key] = extraProperty.Value; - } - - project = await _projectRepository.UpdateAsync(project); - - return ObjectMapper.Map(project); - } - - public async Task DeleteAsync(Guid id) - { - await _projectRepository.DeleteAsync(id); - } - public async Task> GetVersionsAsync(string shortName) { var project = await _projectRepository.GetByShortNameAsync(shortName); diff --git a/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/IProjectRepository.cs b/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/IProjectRepository.cs index fdfe785df4..1872d33cd8 100644 --- a/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/IProjectRepository.cs +++ b/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/IProjectRepository.cs @@ -1,4 +1,5 @@ using System; +using System.Collections.Generic; using System.Threading.Tasks; using Volo.Abp.Domain.Repositories; @@ -6,6 +7,10 @@ namespace Volo.Docs.Projects { public interface IProjectRepository : IBasicRepository { + Task> GetListAsync(string sorting, int maxResultCount, int skipCount); + + Task GetTotalProjectCount(); + Task GetByShortNameAsync(string shortName); } } \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.EntityFrameworkCore/Volo/Docs/Projects/EfCoreProjectRepository.cs b/modules/docs/src/Volo.Docs.EntityFrameworkCore/Volo/Docs/Projects/EfCoreProjectRepository.cs index e06fea3aba..f9e6ab4fa7 100644 --- a/modules/docs/src/Volo.Docs.EntityFrameworkCore/Volo/Docs/Projects/EfCoreProjectRepository.cs +++ b/modules/docs/src/Volo.Docs.EntityFrameworkCore/Volo/Docs/Projects/EfCoreProjectRepository.cs @@ -1,4 +1,7 @@ using System; +using System.Collections.Generic; +using System.Linq; +using System.Linq.Dynamic.Core; using System.Threading.Tasks; using Microsoft.EntityFrameworkCore; using Volo.Abp.Domain.Entities; @@ -16,6 +19,20 @@ namespace Volo.Docs.Projects } + public async Task> GetListAsync(string sorting, int maxResultCount, int skipCount) + { + var projects = await DbSet.OrderBy(sorting ?? "creationTime desc") + .PageBy(skipCount, maxResultCount) + .ToListAsync(); + + return projects; + } + + public async Task GetTotalProjectCount() + { + return await DbSet.CountAsync(); + } + public async Task GetByShortNameAsync(string shortName) { var project = await DbSet.FirstOrDefaultAsync(p => p.ShortName == shortName); diff --git a/modules/docs/src/Volo.Docs.HttpApi/Volo/Docs/Projects/DocsProjectController.cs b/modules/docs/src/Volo.Docs.HttpApi/Volo/Docs/Projects/DocsProjectController.cs index 180cec622f..e22df620f9 100644 --- a/modules/docs/src/Volo.Docs.HttpApi/Volo/Docs/Projects/DocsProjectController.cs +++ b/modules/docs/src/Volo.Docs.HttpApi/Volo/Docs/Projects/DocsProjectController.cs @@ -34,21 +34,6 @@ namespace Volo.Docs.Projects return ProjectAppService.GetAsync(shortName); } - public Task CreateAsync(CreateProjectDto input) - { - return ProjectAppService.CreateAsync(input); - } - - public Task UpdateAsync(Guid id, UpdateProjectDto input) - { - return ProjectAppService.UpdateAsync(id, input); - } - - public Task DeleteAsync(Guid id) - { - return ProjectAppService.DeleteAsync(id); - } - [HttpGet] [Route("{shortName}/versions")] public virtual Task> GetVersionsAsync(string shortName) From 2aa03bc433e54489afb4f7d7f75c71345a5d6b09 Mon Sep 17 00:00:00 2001 From: Halil ibrahim Kalkan Date: Mon, 24 Dec 2018 19:04:15 +0300 Subject: [PATCH 011/127] Add BreadCrumb.Add method --- .../Volo/Abp/AspNetCore/Mvc/UI/Layout/BreadCrumb.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI/Volo/Abp/AspNetCore/Mvc/UI/Layout/BreadCrumb.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI/Volo/Abp/AspNetCore/Mvc/UI/Layout/BreadCrumb.cs index c0459fe5a0..10d03554e4 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI/Volo/Abp/AspNetCore/Mvc/UI/Layout/BreadCrumb.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI/Volo/Abp/AspNetCore/Mvc/UI/Layout/BreadCrumb.cs @@ -20,5 +20,10 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Layout { Items = new List(); } + + public void Add(string text, string url = null, string icon = null) + { + Items.Add(new BreadCrumbItem(text, url, icon)); + } } } \ No newline at end of file From 5e551438e786e50ee397a5eff9725883dff0e760 Mon Sep 17 00:00:00 2001 From: Halil ibrahim Kalkan Date: Tue, 25 Dec 2018 10:50:10 +0300 Subject: [PATCH 012/127] Fix value of StandardMenus.Shortcut --- .../Mvc/UI/MultiTenancy/Components/TenantSwitch/Default.cshtml | 2 +- .../Mvc/UI/MultiTenancy/Components/_ViewImports.cshtml | 3 +++ .../Volo/Abp/Ui/Navigation/StandardMenus.cs | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 framework/src/Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy/Volo/Abp/AspNetCore/Mvc/UI/MultiTenancy/Components/_ViewImports.cshtml diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy/Volo/Abp/AspNetCore/Mvc/UI/MultiTenancy/Components/TenantSwitch/Default.cshtml b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy/Volo/Abp/AspNetCore/Mvc/UI/MultiTenancy/Components/TenantSwitch/Default.cshtml index c275048621..33419549f0 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy/Volo/Abp/AspNetCore/Mvc/UI/MultiTenancy/Components/TenantSwitch/Default.cshtml +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy/Volo/Abp/AspNetCore/Mvc/UI/MultiTenancy/Components/TenantSwitch/Default.cshtml @@ -1,7 +1,7 @@ @using Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy.Components.TenantSwitch @model TenantSwitchViewComponent.TenantSwitchViewModel