Browse Source

Merge pull request #1855 from abpframework/maliming/ContextualizedMapper

Use Contextualized mappers on all modules
pull/1879/head
Halil İbrahim Kalkan 7 years ago
committed by GitHub
parent
commit
c3e77139f5
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      modules/account/src/Volo.Abp.Account.Web/AbpAccountWebModule.cs
  2. 1
      modules/account/src/Volo.Abp.Account.Web/Pages/Account/AccountPageModel.cs
  3. 5
      modules/background-jobs/src/Volo.Abp.BackgroundJobs.Domain/Volo/Abp/BackgroundJobs/BackgroundJobStore.cs
  4. 1
      modules/background-jobs/src/Volo.Abp.BackgroundJobs.Domain/Volo/Abp/BackgroundJobs/BackgroundJobsDomainModule.cs
  5. 14
      modules/blogging/src/Volo.Blogging.Application/Volo/Blogging/BloggingAppServiceBase.cs
  6. 3
      modules/blogging/src/Volo.Blogging.Application/Volo/Blogging/BloggingApplicationModule.cs
  7. 3
      modules/blogging/src/Volo.Blogging.Application/Volo/Blogging/Blogs/BlogAppService.cs
  8. 3
      modules/blogging/src/Volo.Blogging.Application/Volo/Blogging/Comments/CommentAppService.cs
  9. 3
      modules/blogging/src/Volo.Blogging.Application/Volo/Blogging/Files/FileAppService.cs
  10. 4
      modules/blogging/src/Volo.Blogging.Application/Volo/Blogging/Posts/PostAppService.cs
  11. 3
      modules/blogging/src/Volo.Blogging.Application/Volo/Blogging/Tagging/TagAppService.cs
  12. 14
      modules/blogging/src/Volo.Blogging.Web/Areas/Blog/Controllers/BloggingControllerBase.cs
  13. 3
      modules/blogging/src/Volo.Blogging.Web/Areas/Blog/Controllers/CommentsController.cs
  14. 2
      modules/blogging/src/Volo.Blogging.Web/Areas/Blog/Controllers/PostsController.cs
  15. 7
      modules/blogging/src/Volo.Blogging.Web/BloggingWebModule.cs
  16. 3
      modules/blogging/src/Volo.Blogging.Web/Pages/Admin/Blogs/Create.cshtml.cs
  17. 3
      modules/blogging/src/Volo.Blogging.Web/Pages/Admin/Blogs/Edit.cshtml.cs
  18. 3
      modules/blogging/src/Volo.Blogging.Web/Pages/Admin/Blogs/Index.cshtml.cs
  19. 12
      modules/blogging/src/Volo.Blogging.Web/Pages/Blog/BloggingPageModel.cs
  20. 2
      modules/blogging/src/Volo.Blogging.Web/Pages/Blog/Posts/Detail.cshtml.cs
  21. 2
      modules/blogging/src/Volo.Blogging.Web/Pages/Blog/Posts/Edit.cshtml.cs
  22. 2
      modules/blogging/src/Volo.Blogging.Web/Pages/Blog/Posts/Index.cshtml.cs
  23. 2
      modules/blogging/src/Volo.Blogging.Web/Pages/Blog/Posts/New.cshtml.cs
  24. 4
      modules/blogging/test/Volo.Blogging.Domain.Tests/Volo/Abp/Blogging/Users/BlogUser_Test.cs
  25. 4
      modules/docs/src/Volo.Docs.Admin.Application/Volo/Docs/Admin/DocsAdminApplicationModule.cs
  26. 4
      modules/docs/src/Volo.Docs.Admin.Application/Volo/Docs/Admin/Projects/ProjectAdminAppService.cs
  27. 2
      modules/docs/src/Volo.Docs.Admin.Web/DocsAdminWebModule.cs
  28. 12
      modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/DocsAdminPageModel.cs
  29. 2
      modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Projects/Create.cshtml.cs
  30. 2
      modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Projects/Edit.cshtml.cs
  31. 2
      modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Projects/Index.cshtml.cs
  32. 14
      modules/docs/src/Volo.Docs.Application/Volo/Docs/DocsAppServiceBase.cs
  33. 4
      modules/docs/src/Volo.Docs.Application/Volo/Docs/DocsApplicationModule.cs
  34. 2
      modules/docs/src/Volo.Docs.Application/Volo/Docs/Documents/DocumentAppService.cs
  35. 2
      modules/docs/src/Volo.Docs.Application/Volo/Docs/Projects/ProjectAppService.cs
  36. 1
      modules/docs/src/Volo.Docs.Web/DocsWebModule.cs
  37. 2
      modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/Index.cshtml.cs
  38. 4
      modules/feature-management/src/Volo.Abp.FeatureManagement.Application/Volo/Abp/FeatureManagement/AbpFeatureManagementApplicationModule.cs
  39. 2
      modules/feature-management/src/Volo.Abp.FeatureManagement.Application/Volo/Abp/FeatureManagement/FeatureAppService.cs
  40. 14
      modules/feature-management/src/Volo.Abp.FeatureManagement.Application/Volo/Abp/FeatureManagement/FeatureManagementAppServiceBase.cs
  41. 1
      modules/feature-management/src/Volo.Abp.FeatureManagement.Web/AbpFeatureManagementWebModule.cs
  42. 2
      modules/feature-management/src/Volo.Abp.FeatureManagement.Web/Pages/FeatureManagement/FeatureManagementModal.cshtml.cs
  43. 1
      modules/identityserver/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/AbpIdentityServerDomainModule.cs
  44. 4
      modules/identityserver/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/Clients/ClientStore.cs
  45. 5
      modules/identityserver/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/Grants/PersistedGrantStore.cs
  46. 4
      modules/identityserver/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/ResourceStore.cs
  47. 1
      modules/permission-management/src/Volo.Abp.PermissionManagement.Web/AbpPermissionManagementWebModule.cs
  48. 2
      modules/permission-management/src/Volo.Abp.PermissionManagement.Web/Pages/AbpPermissionManagement/PermissionManagementModal.cshtml.cs
  49. 4
      modules/tenant-management/src/Volo.Abp.TenantManagement.Application/Volo/Abp/TenantManagement/AbpTenantManagementApplicationModule.cs
  50. 9
      modules/tenant-management/src/Volo.Abp.TenantManagement.Application/Volo/Abp/TenantManagement/TenantManagementAppServiceBase.cs
  51. 4
      modules/tenant-management/src/Volo.Abp.TenantManagement.Domain/Volo/Abp/TenantManagement/AbpTenantManagementDomainModule.cs
  52. 4
      modules/tenant-management/src/Volo.Abp.TenantManagement.Domain/Volo/Abp/TenantManagement/TenantStore.cs
  53. 1
      modules/tenant-management/src/Volo.Abp.TenantManagement.Web/AbpTenantManagementWebModule.cs
  54. 2
      modules/tenant-management/src/Volo.Abp.TenantManagement.Web/Pages/TenantManagement/Tenants/ConnectionStringsModal.cshtml.cs
  55. 2
      modules/tenant-management/src/Volo.Abp.TenantManagement.Web/Pages/TenantManagement/Tenants/CreateModal.cshtml.cs
  56. 2
      modules/tenant-management/src/Volo.Abp.TenantManagement.Web/Pages/TenantManagement/Tenants/EditModal.cshtml.cs
  57. 2
      modules/tenant-management/src/Volo.Abp.TenantManagement.Web/Pages/TenantManagement/Tenants/Index.cshtml.cs
  58. 12
      modules/tenant-management/src/Volo.Abp.TenantManagement.Web/Pages/TenantManagement/Tenants/TenantManagementPageModel.cs

1
modules/account/src/Volo.Abp.Account.Web/AbpAccountWebModule.cs

@ -50,6 +50,7 @@ namespace Volo.Abp.Account.Web
options.Conventions.AuthorizePage("/Account/Manage");
});
context.Services.AddAutoMapperObjectMapper<AbpAccountWebModule>();
Configure<AbpAutoMapperOptions>(options =>
{
options.AddProfile<AbpAccountWebAutoMapperProfile>(validate: true);

1
modules/account/src/Volo.Abp.Account.Web/Pages/Account/AccountPageModel.cs

@ -18,6 +18,7 @@ namespace Volo.Abp.Account.Web.Pages.Account
protected AccountPageModel()
{
LocalizationResourceType = typeof(AccountResource);
ObjectMapperContext = typeof(AbpAccountWebModule);
}
protected RedirectResult RedirectSafely(string returnUrl, string returnUrlHash = null)

5
modules/background-jobs/src/Volo.Abp.BackgroundJobs.Domain/Volo/Abp/BackgroundJobs/BackgroundJobStore.cs

@ -9,11 +9,12 @@ namespace Volo.Abp.BackgroundJobs
public class BackgroundJobStore : IBackgroundJobStore, ITransientDependency
{
protected IBackgroundJobRepository BackgroundJobRepository { get; }
protected IObjectMapper ObjectMapper { get; }
protected IObjectMapper<BackgroundJobsDomainModule> ObjectMapper { get; }
public BackgroundJobStore(
IBackgroundJobRepository backgroundJobRepository,
IObjectMapper objectMapper)
IObjectMapper<BackgroundJobsDomainModule> objectMapper)
{
ObjectMapper = objectMapper;
BackgroundJobRepository = backgroundJobRepository;

1
modules/background-jobs/src/Volo.Abp.BackgroundJobs.Domain/Volo/Abp/BackgroundJobs/BackgroundJobsDomainModule.cs

@ -13,6 +13,7 @@ namespace Volo.Abp.BackgroundJobs
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
context.Services.AddAutoMapperObjectMapper<BackgroundJobsDomainModule>();
Configure<AbpAutoMapperOptions>(options =>
{
options.AddProfile<BackgroundJobsDomainAutoMapperProfile>(validate: true);

14
modules/blogging/src/Volo.Blogging.Application/Volo/Blogging/BloggingAppServiceBase.cs

@ -0,0 +1,14 @@
using Volo.Abp.Application.Services;
using Volo.Blogging.Localization;
namespace Volo.Blogging
{
public abstract class BloggingAppServiceBase : ApplicationService
{
protected BloggingAppServiceBase()
{
ObjectMapperContext = typeof(BloggingApplicationModule);
LocalizationResource = typeof(BloggingResource);
}
}
}

3
modules/blogging/src/Volo.Blogging.Application/Volo/Blogging/BloggingApplicationModule.cs

@ -17,13 +17,12 @@ namespace Volo.Blogging
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
context.Services.AddAutoMapperObjectMapper<BloggingApplicationModule>();
Configure<AbpAutoMapperOptions>(options =>
{
options.AddProfile<BloggingApplicationAutoMapperProfile>(validate: true);
});
Configure<AuthorizationOptions>(options =>
{
//TODO: Rename UpdatePolicy/DeletePolicy since it's candidate to conflicts with other modules!

3
modules/blogging/src/Volo.Blogging.Application/Volo/Blogging/Blogs/BlogAppService.cs

@ -3,13 +3,12 @@ using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Application.Services;
using Volo.Abp.Domain.Entities;
using Volo.Blogging.Blogs.Dtos;
namespace Volo.Blogging.Blogs
{
public class BlogAppService : ApplicationService, IBlogAppService
public class BlogAppService : BloggingAppServiceBase, IBlogAppService
{
private readonly IBlogRepository _blogRepository;

3
modules/blogging/src/Volo.Blogging.Application/Volo/Blogging/Comments/CommentAppService.cs

@ -3,7 +3,6 @@ using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
using Volo.Abp.Application.Services;
using Volo.Abp.Guids;
using Volo.Blogging.Comments.Dtos;
using Volo.Blogging.Posts;
@ -11,7 +10,7 @@ using Volo.Blogging.Users;
namespace Volo.Blogging.Comments
{
public class CommentAppService : ApplicationService, ICommentAppService
public class CommentAppService : BloggingAppServiceBase, ICommentAppService
{
protected IBlogUserLookupService UserLookupService;

3
modules/blogging/src/Volo.Blogging.Application/Volo/Blogging/Files/FileAppService.cs

@ -4,13 +4,12 @@ using System.IO;
using System.Threading.Tasks;
using Microsoft.Extensions.Options;
using Volo.Abp;
using Volo.Abp.Application.Services;
using Volo.Abp.Validation;
using Volo.Blogging.Areas.Blog.Helpers;
namespace Volo.Blogging.Files
{
public class FileAppService : ApplicationService, IFileAppService
public class FileAppService : BloggingAppServiceBase, IFileAppService
{
public BlogFileOptions Options { get; }

4
modules/blogging/src/Volo.Blogging.Application/Volo/Blogging/Posts/PostAppService.cs

@ -2,10 +2,8 @@
using System.Linq;
using System.Threading.Tasks;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Application.Services;
using System.Collections.Generic;
using Microsoft.AspNetCore.Authorization;
using Volo.Abp.Users;
using Volo.Blogging.Comments;
using Volo.Blogging.Tagging;
using Volo.Blogging.Tagging.Dtos;
@ -13,7 +11,7 @@ using Volo.Blogging.Users;
namespace Volo.Blogging.Posts
{
public class PostAppService : ApplicationService, IPostAppService
public class PostAppService : BloggingAppServiceBase, IPostAppService
{
protected IBlogUserLookupService UserLookupService { get; }

3
modules/blogging/src/Volo.Blogging.Application/Volo/Blogging/Tagging/TagAppService.cs

@ -2,12 +2,11 @@
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Volo.Abp.Application.Services;
using Volo.Blogging.Tagging.Dtos;
namespace Volo.Blogging.Tagging
{
public class TagAppService : ApplicationService, ITagAppService
public class TagAppService : BloggingAppServiceBase, ITagAppService
{
private readonly ITagRepository _tagRepository;

14
modules/blogging/src/Volo.Blogging.Web/Areas/Blog/Controllers/BloggingControllerBase.cs

@ -0,0 +1,14 @@
using Volo.Abp.AspNetCore.Mvc;
using Volo.Blogging.Localization;
namespace Volo.Blogging.Areas.Blog.Controllers
{
public abstract class BloggingControllerBase : AbpController
{
protected BloggingControllerBase()
{
ObjectMapperContext = typeof(BloggingWebModule);
LocalizationResource = typeof(BloggingResource);
}
}
}

3
modules/blogging/src/Volo.Blogging.Web/Areas/Blog/Controllers/CommentsController.cs

@ -11,13 +11,14 @@ namespace Volo.Blogging.Areas.Blog.Controllers
[Area("Blog")]
[Route("Blog/[controller]/[action]")]
public class CommentsController : AbpController
public class CommentsController : BloggingControllerBase
{
private readonly ICommentAppService _commentAppService;
public CommentsController(ICommentAppService commentAppService)
{
_commentAppService = commentAppService;
}
[HttpPost]

2
modules/blogging/src/Volo.Blogging.Web/Areas/Blog/Controllers/PostsController.cs

@ -10,7 +10,7 @@ namespace Volo.Blogging.Areas.Blog.Controllers
[Area("Blog")]
[Route("Blog/[controller]/[action]")]
public class PostsController : AbpController
public class PostsController : BloggingControllerBase
{
private readonly IPostAppService _postAppService;

7
modules/blogging/src/Volo.Blogging.Web/BloggingWebModule.cs

@ -1,13 +1,10 @@
using Localization.Resources.AbpUi;
using Microsoft.AspNetCore.Mvc.RazorPages;
using Microsoft.AspNetCore.Mvc.RazorPages;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Options;
using Volo.Abp.AspNetCore.Mvc.Localization;
using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap;
using Volo.Abp.AspNetCore.Mvc.UI.Bundling;
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;
@ -43,7 +40,7 @@ namespace Volo.Blogging
options.FileSets.AddEmbedded<BloggingWebModule>("Volo.Blogging");
});
context.Services.AddAutoMapperObjectMapper<BloggingWebModule>();
Configure<AbpAutoMapperOptions>(options =>
{
options.AddProfile<AbpBloggingWebAutoMapperProfile>(validate: true);

3
modules/blogging/src/Volo.Blogging.Web/Pages/Admin/Blogs/Create.cshtml.cs

@ -6,10 +6,11 @@ using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Form;
using Volo.Abp.AspNetCore.Mvc.UI.RazorPages;
using Volo.Blogging.Blogs;
using Volo.Blogging.Blogs.Dtos;
using Volo.Blogging.Pages.Blog;
namespace Volo.Blogging.Pages.Admin.Blogs
{
public class CreateModel : AbpPageModel
public class CreateModel : BloggingPageModel
{
private readonly IBlogAppService _blogAppService;
private readonly IAuthorizationService _authorization;

3
modules/blogging/src/Volo.Blogging.Web/Pages/Admin/Blogs/Edit.cshtml.cs

@ -7,11 +7,12 @@ using Microsoft.AspNetCore.Mvc;
using Volo.Abp.AspNetCore.Mvc.UI.RazorPages;
using Volo.Blogging.Blogs;
using Volo.Blogging.Blogs.Dtos;
using Volo.Blogging.Pages.Blog;
using Volo.Blogging.Posts;
namespace Volo.Blogging.Pages.Admin.Blogs
{
public class EditModel : AbpPageModel
public class EditModel : BloggingPageModel
{
private readonly IBlogAppService _blogAppService;
private readonly IAuthorizationService _authorization;

3
modules/blogging/src/Volo.Blogging.Web/Pages/Admin/Blogs/Index.cshtml.cs

@ -2,10 +2,11 @@ using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Volo.Abp.AspNetCore.Mvc.UI.RazorPages;
using Volo.Blogging.Pages.Blog;
namespace Volo.Blogging.Pages.Admin.Blogs
{
public class IndexModel : AbpPageModel
public class IndexModel : BloggingPageModel
{
private readonly IAuthorizationService _authorization;

12
modules/blogging/src/Volo.Blogging.Web/Pages/Blog/BloggingPageModel.cs

@ -0,0 +1,12 @@
using Volo.Abp.AspNetCore.Mvc.UI.RazorPages;
namespace Volo.Blogging.Pages.Blog
{
public class BloggingPageModel : AbpPageModel
{
public BloggingPageModel()
{
ObjectMapperContext = typeof(BloggingWebModule);
}
}
}

2
modules/blogging/src/Volo.Blogging.Web/Pages/Blog/Posts/Detail.cshtml.cs

@ -12,7 +12,7 @@ using Volo.Blogging.Posts;
namespace Volo.Blogging.Pages.Blog.Posts
{
public class DetailModel : AbpPageModel
public class DetailModel : BloggingPageModel
{
private const int TwitterLinkLength = 23;
private readonly IPostAppService _postAppService;

2
modules/blogging/src/Volo.Blogging.Web/Pages/Blog/Posts/Edit.cshtml.cs

@ -11,7 +11,7 @@ using Volo.Blogging.Posts;
namespace Volo.Blogging.Pages.Blog.Posts
{
public class EditModel : AbpPageModel
public class EditModel : BloggingPageModel
{
private readonly IPostAppService _postAppService;
private readonly IBlogAppService _blogAppService;

2
modules/blogging/src/Volo.Blogging.Web/Pages/Blog/Posts/Index.cshtml.cs

@ -10,7 +10,7 @@ using Volo.Blogging.Tagging.Dtos;
namespace Volo.Blogging.Pages.Blog.Posts
{
public class IndexModel : AbpPageModel
public class IndexModel : BloggingPageModel
{
private readonly IPostAppService _postAppService;
private readonly IBlogAppService _blogAppService;

2
modules/blogging/src/Volo.Blogging.Web/Pages/Blog/Posts/New.cshtml.cs

@ -11,7 +11,7 @@ using Volo.Blogging.Posts;
namespace Volo.Blogging.Pages.Blog.Posts
{
public class NewModel : AbpPageModel
public class NewModel : BloggingPageModel
{
private readonly IPostAppService _postAppService;
private readonly IBlogAppService _blogAppService;

4
modules/blogging/test/Volo.Blogging.Domain.Tests/Volo/Abp/Blogging/Users/BlogUser_Test.cs

@ -23,7 +23,7 @@ namespace Volo.Blogging
blogUser.Update(userData);
blogUser.Equals(new BlogUser(userData)).ShouldBeTrue();
blogUser.EntityEquals(new BlogUser(userData)).ShouldBeTrue();
}
[Fact]
@ -65,7 +65,7 @@ namespace Volo.Blogging
var blogUser2= new BlogUser(new UserData(userId, "bob lee", "john@volosoft.com", "lee", "bob", true,
"123456", true, tenantId));
blogUser.Equals(blogUser2).ShouldBeTrue();
blogUser.EntityEquals(blogUser2).ShouldBeTrue();
}
}
}

4
modules/docs/src/Volo.Docs.Admin.Application/Volo/Docs/Admin/DocsAdminApplicationModule.cs

@ -1,4 +1,5 @@
using Volo.Abp.AutoMapper;
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.AutoMapper;
using Volo.Abp.Caching;
using Volo.Abp.Modularity;
@ -13,6 +14,7 @@ namespace Volo.Docs.Admin
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
context.Services.AddAutoMapperObjectMapper<DocsAdminApplicationModule>();
Configure<AbpAutoMapperOptions>(options =>
{
options.AddProfile<DocsAdminApplicationAutoMapperProfile>(validate: true);

4
modules/docs/src/Volo.Docs.Admin.Application/Volo/Docs/Admin/Projects/ProjectAdminAppService.cs

@ -5,6 +5,7 @@ using Microsoft.AspNetCore.Authorization;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Application.Services;
using Volo.Abp.Guids;
using Volo.Docs.Localization;
using Volo.Docs.Projects;
namespace Volo.Docs.Admin.Projects
@ -18,6 +19,9 @@ namespace Volo.Docs.Admin.Projects
public ProjectAdminAppService(
IProjectRepository projectRepository, IGuidGenerator guidGenerator)
{
ObjectMapperContext = typeof(DocsAdminApplicationModule);
LocalizationResource = typeof(DocsResource);
_projectRepository = projectRepository;
_guidGenerator = guidGenerator;
}

2
modules/docs/src/Volo.Docs.Admin.Web/DocsAdminWebModule.cs

@ -1,4 +1,5 @@
using Localization.Resources.AbpUi;
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.AspNetCore.Mvc.Localization;
using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap;
using Volo.Abp.AutoMapper;
@ -40,6 +41,7 @@ namespace Volo.Docs.Admin
options.FileSets.AddEmbedded<DocsAdminWebModule>("Volo.Docs.Admin");
});
context.Services.AddAutoMapperObjectMapper<DocsAdminWebModule>();
Configure<AbpAutoMapperOptions>(options =>
{
options.AddProfile<DocsAdminWebAutoMapperProfile>(validate: true);

12
modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/DocsAdminPageModel.cs

@ -0,0 +1,12 @@
using Volo.Abp.AspNetCore.Mvc.UI.RazorPages;
namespace Volo.Docs.Admin.Pages.Docs.Admin
{
public class DocsAdminPageModel : AbpPageModel
{
public DocsAdminPageModel()
{
ObjectMapperContext = typeof(DocsAdminWebModule);
}
}
}

2
modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Projects/Create.cshtml.cs

@ -14,7 +14,7 @@ using Volo.Docs.Projects;
namespace Volo.Docs.Admin.Pages.Docs.Admin.Projects
{
public class CreateModel : AbpPageModel
public class CreateModel : DocsAdminPageModel
{
[BindProperty]
public CreateGithubProjectViewModel GithubProject { get; set; }

2
modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Projects/Edit.cshtml.cs

@ -14,7 +14,7 @@ using Volo.Docs.Projects;
namespace Volo.Docs.Admin.Pages.Docs.Admin.Projects
{
public class EditModel : AbpPageModel
public class EditModel : DocsAdminPageModel
{
[BindProperty]
public EditGithubProjectViewModel GithubProject { get; set; }

2
modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Projects/Index.cshtml.cs

@ -4,7 +4,7 @@ using Volo.Abp.AspNetCore.Mvc.UI.RazorPages;
namespace Volo.Docs.Admin.Pages.Docs.Admin.Projects
{
[Authorize(DocsAdminPermissions.Projects.Default)]
public class IndexModel : AbpPageModel
public class IndexModel : DocsAdminPageModel
{
public void OnGet()
{

14
modules/docs/src/Volo.Docs.Application/Volo/Docs/DocsAppServiceBase.cs

@ -0,0 +1,14 @@
using Volo.Abp.Application.Services;
using Volo.Docs.Localization;
namespace Volo.Docs
{
public abstract class DocsAppServiceBase : ApplicationService
{
protected DocsAppServiceBase()
{
ObjectMapperContext = typeof(DocsApplicationModule);
LocalizationResource = typeof(DocsResource);
}
}
}

4
modules/docs/src/Volo.Docs.Application/Volo/Docs/DocsApplicationModule.cs

@ -1,4 +1,5 @@
using Volo.Abp.AutoMapper;
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.AutoMapper;
using Volo.Abp.Caching;
using Volo.Abp.Modularity;
@ -13,6 +14,7 @@ namespace Volo.Docs
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
context.Services.AddAutoMapperObjectMapper<DocsApplicationModule>();
Configure<AbpAutoMapperOptions>(options =>
{
options.AddProfile<DocsApplicationAutoMapperProfile>(validate: true);

2
modules/docs/src/Volo.Docs.Application/Volo/Docs/Documents/DocumentAppService.cs

@ -11,7 +11,7 @@ using Volo.Docs.Projects;
namespace Volo.Docs.Documents
{
public class DocumentAppService : ApplicationService, IDocumentAppService
public class DocumentAppService : DocsAppServiceBase, IDocumentAppService
{
private readonly IProjectRepository _projectRepository;
private readonly IDocumentStoreFactory _documentStoreFactory;

2
modules/docs/src/Volo.Docs.Application/Volo/Docs/Projects/ProjectAppService.cs

@ -11,7 +11,7 @@ using Volo.Docs.Documents;
namespace Volo.Docs.Projects
{
public class ProjectAppService : ApplicationService, IProjectAppService
public class ProjectAppService : DocsAppServiceBase, IProjectAppService
{
private readonly IProjectRepository _projectRepository;
private readonly IDistributedCache<List<VersionInfo>> _versionCache;

1
modules/docs/src/Volo.Docs.Web/DocsWebModule.cs

@ -52,6 +52,7 @@ namespace Volo.Docs
options.Conventions.AddPageRoute("/Documents/Project/Index", routePrefix + "{languageCode}/{projectName}/{version}/{*documentName}");
});
context.Services.AddAutoMapperObjectMapper<DocsWebModule>();
Configure<AbpAutoMapperOptions>(options =>
{
options.AddProfile<DocsWebAutoMapperProfile>(validate: true);

2
modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/Index.cshtml.cs

@ -67,6 +67,8 @@ namespace Volo.Docs.Pages.Documents.Project
IProjectAppService projectAppService,
IOptions<DocsUiOptions> options)
{
ObjectMapperContext = typeof(DocsWebModule);
_documentAppService = documentAppService;
_documentToHtmlConverterFactory = documentToHtmlConverterFactory;
_projectAppService = projectAppService;

4
modules/feature-management/src/Volo.Abp.FeatureManagement.Application/Volo/Abp/FeatureManagement/AbpFeatureManagementApplicationModule.cs

@ -1,4 +1,5 @@
using Volo.Abp.AutoMapper;
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.AutoMapper;
using Volo.Abp.Modularity;
namespace Volo.Abp.FeatureManagement
@ -12,6 +13,7 @@ namespace Volo.Abp.FeatureManagement
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
context.Services.AddAutoMapperObjectMapper<AbpFeatureManagementApplicationModule>();
Configure<AbpAutoMapperOptions>(options =>
{
options.AddProfile<FeatureManagementApplicationAutoMapperProfile>(validate: true);

2
modules/feature-management/src/Volo.Abp.FeatureManagement.Application/Volo/Abp/FeatureManagement/FeatureAppService.cs

@ -13,7 +13,7 @@ using Volo.Abp.Features;
namespace Volo.Abp.FeatureManagement
{
[Authorize]
public class FeatureAppService : ApplicationService, IFeatureAppService
public class FeatureAppService : FeatureManagementAppServiceBase, IFeatureAppService
{
protected FeatureManagementOptions Options { get; }

14
modules/feature-management/src/Volo.Abp.FeatureManagement.Application/Volo/Abp/FeatureManagement/FeatureManagementAppServiceBase.cs

@ -0,0 +1,14 @@
using Volo.Abp.Application.Services;
using Volo.Abp.FeatureManagement.Localization;
namespace Volo.Abp.FeatureManagement
{
public abstract class FeatureManagementAppServiceBase : ApplicationService
{
protected FeatureManagementAppServiceBase()
{
ObjectMapperContext = typeof(AbpFeatureManagementApplicationModule);
LocalizationResource = typeof(AbpFeatureManagementResource);
}
}
}

1
modules/feature-management/src/Volo.Abp.FeatureManagement.Web/AbpFeatureManagementWebModule.cs

@ -31,6 +31,7 @@ namespace Volo.Abp.FeatureManagement
options.FileSets.AddEmbedded<AbpFeatureManagementWebModule>("Volo.Abp.FeatureManagement");
});
context.Services.AddAutoMapperObjectMapper<AbpFeatureManagementWebModule>();
Configure<AbpAutoMapperOptions>(options =>
{
options.AddProfile<FeatureManagementWebAutoMapperProfile>(validate: true);

2
modules/feature-management/src/Volo.Abp.FeatureManagement.Web/Pages/FeatureManagement/FeatureManagementModal.cshtml.cs

@ -29,6 +29,8 @@ namespace Volo.Abp.FeatureManagement.Web.Pages.FeatureManagement
public FeatureManagementModal(IFeatureAppService featureAppService)
{
ObjectMapperContext = typeof(AbpFeatureManagementWebModule);
_featureAppService = featureAppService;
}

1
modules/identityserver/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/AbpIdentityServerDomainModule.cs

@ -23,6 +23,7 @@ namespace Volo.Abp.IdentityServer
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
context.Services.AddAutoMapperObjectMapper<AbpIdentityServerDomainModule>();
Configure<AbpAutoMapperOptions>(options =>
{
options.AddProfile<ClientAutoMapperProfile>(validate: true);

4
modules/identityserver/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/Clients/ClientStore.cs

@ -7,9 +7,9 @@ namespace Volo.Abp.IdentityServer.Clients
public class ClientStore : IClientStore
{
private readonly IClientRepository _clientRepository;
private readonly IObjectMapper _objectMapper;
private readonly IObjectMapper<AbpIdentityServerDomainModule> _objectMapper;
public ClientStore(IClientRepository clientRepository, IObjectMapper objectMapper)
public ClientStore(IClientRepository clientRepository, IObjectMapper<AbpIdentityServerDomainModule> objectMapper)
{
_clientRepository = clientRepository;
_objectMapper = objectMapper;

5
modules/identityserver/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/Grants/PersistedGrantStore.cs

@ -11,10 +11,11 @@ namespace Volo.Abp.IdentityServer.Grants
public class PersistedGrantStore : IPersistedGrantStore
{
private readonly IPersistentGrantRepository _persistentGrantRepository;
private readonly IObjectMapper _objectMapper;
private readonly IObjectMapper<AbpIdentityServerDomainModule> _objectMapper;
private readonly IGuidGenerator _guidGenerator;
public PersistedGrantStore(IPersistentGrantRepository persistentGrantRepository, IObjectMapper objectMapper, IGuidGenerator guidGenerator)
public PersistedGrantStore(IPersistentGrantRepository persistentGrantRepository,
IObjectMapper<AbpIdentityServerDomainModule> objectMapper, IGuidGenerator guidGenerator)
{
_persistentGrantRepository = persistentGrantRepository;
_objectMapper = objectMapper;

4
modules/identityserver/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/ResourceStore.cs

@ -15,11 +15,11 @@ namespace Volo.Abp.IdentityServer
{
private readonly IIdentityResourceRepository _identityResourceRepository;
private readonly IApiResourceRepository _apiResourceRepository;
private readonly IObjectMapper _objectMapper;
private readonly IObjectMapper<AbpIdentityServerDomainModule> _objectMapper;
public ResourceStore(
IIdentityResourceRepository identityResourceRepository,
IObjectMapper objectMapper,
IObjectMapper<AbpIdentityServerDomainModule> objectMapper,
IApiResourceRepository apiResourceRepository)
{
_identityResourceRepository = identityResourceRepository;

1
modules/permission-management/src/Volo.Abp.PermissionManagement.Web/AbpPermissionManagementWebModule.cs

@ -32,6 +32,7 @@ namespace Volo.Abp.PermissionManagement.Web
options.FileSets.AddEmbedded<AbpPermissionManagementWebModule>("Volo.Abp.PermissionManagement.Web");
});
context.Services.AddAutoMapperObjectMapper<AbpPermissionManagementWebModule>();
Configure<AbpAutoMapperOptions>(options =>
{
options.AddProfile<AbpPermissionManagementWebAutoMapperProfile>(validate: true);

2
modules/permission-management/src/Volo.Abp.PermissionManagement.Web/Pages/AbpPermissionManagement/PermissionManagementModal.cshtml.cs

@ -33,6 +33,8 @@ namespace Volo.Abp.PermissionManagement.Web.Pages.AbpPermissionManagement
public PermissionManagementModal(IPermissionAppService permissionAppService)
{
ObjectMapperContext = typeof(AbpPermissionManagementWebModule);
_permissionAppService = permissionAppService;
}

4
modules/tenant-management/src/Volo.Abp.TenantManagement.Application/Volo/Abp/TenantManagement/AbpTenantManagementApplicationModule.cs

@ -1,4 +1,5 @@
using Volo.Abp.AutoMapper;
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.AutoMapper;
using Volo.Abp.Modularity;
namespace Volo.Abp.TenantManagement
@ -10,6 +11,7 @@ namespace Volo.Abp.TenantManagement
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
context.Services.AddAutoMapperObjectMapper<AbpTenantManagementApplicationModule>();
Configure<AbpAutoMapperOptions>(options =>
{
options.AddProfile<AbpTenantManagementApplicationAutoMapperProfile>(validate: true);

9
modules/tenant-management/src/Volo.Abp.TenantManagement.Application/Volo/Abp/TenantManagement/TenantManagementAppServiceBase.cs

@ -1,9 +1,14 @@
using Volo.Abp.Application.Services;
using Volo.Abp.TenantManagement.Localization;
namespace Volo.Abp.TenantManagement
{
public class TenantManagementAppServiceBase : ApplicationService
public abstract class TenantManagementAppServiceBase : ApplicationService
{
protected TenantManagementAppServiceBase()
{
ObjectMapperContext = typeof(AbpTenantManagementApplicationModule);
LocalizationResource = typeof(AbpTenantManagementResource);
}
}
}

4
modules/tenant-management/src/Volo.Abp.TenantManagement.Domain/Volo/Abp/TenantManagement/AbpTenantManagementDomainModule.cs

@ -1,4 +1,5 @@
using Volo.Abp.AutoMapper;
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.AutoMapper;
using Volo.Abp.Data;
using Volo.Abp.Domain;
using Volo.Abp.Modularity;
@ -17,6 +18,7 @@ namespace Volo.Abp.TenantManagement
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
context.Services.AddAutoMapperObjectMapper<AbpTenantManagementDomainModule>();
Configure<AbpAutoMapperOptions>(options =>
{
options.AddProfile<AbpTenantManagementDomainMappingProfile>(validate: true);

4
modules/tenant-management/src/Volo.Abp.TenantManagement.Domain/Volo/Abp/TenantManagement/TenantStore.cs

@ -11,12 +11,12 @@ namespace Volo.Abp.TenantManagement
public class TenantStore : ITenantStore, ITransientDependency
{
private readonly ITenantRepository _tenantRepository;
private readonly IObjectMapper _objectMapper;
private readonly IObjectMapper<AbpTenantManagementDomainModule> _objectMapper;
private readonly ICurrentTenant _currentTenant;
public TenantStore(
ITenantRepository tenantRepository,
IObjectMapper objectMapper,
IObjectMapper<AbpTenantManagementDomainModule> objectMapper,
ICurrentTenant currentTenant)
{
_tenantRepository = tenantRepository;

1
modules/tenant-management/src/Volo.Abp.TenantManagement.Web/AbpTenantManagementWebModule.cs

@ -42,6 +42,7 @@ namespace Volo.Abp.TenantManagement.Web
options.FileSets.AddEmbedded<AbpTenantManagementWebModule>("Volo.Abp.TenantManagement.Web");
});
context.Services.AddAutoMapperObjectMapper<AbpTenantManagementWebModule>();
Configure<AbpAutoMapperOptions>(options =>
{
options.AddProfile<AbpTenantManagementWebAutoMapperProfile>(validate: true);

2
modules/tenant-management/src/Volo.Abp.TenantManagement.Web/Pages/TenantManagement/Tenants/ConnectionStringsModal.cshtml.cs

@ -6,7 +6,7 @@ using Volo.Abp.AspNetCore.Mvc.UI.RazorPages;
namespace Volo.Abp.TenantManagement.Web.Pages.TenantManagement.Tenants
{
public class ConnectionStringsModal : AbpPageModel
public class ConnectionStringsModal : TenantManagementPageModel
{
[BindProperty]
public TenantInfoModel Tenant { get; set; }

2
modules/tenant-management/src/Volo.Abp.TenantManagement.Web/Pages/TenantManagement/Tenants/CreateModal.cshtml.cs

@ -5,7 +5,7 @@ using Volo.Abp.AspNetCore.Mvc.UI.RazorPages;
namespace Volo.Abp.TenantManagement.Web.Pages.TenantManagement.Tenants
{
public class CreateModalModel : AbpPageModel
public class CreateModalModel : TenantManagementPageModel
{
[BindProperty]
public TenantInfoModel Tenant { get; set; }

2
modules/tenant-management/src/Volo.Abp.TenantManagement.Web/Pages/TenantManagement/Tenants/EditModal.cshtml.cs

@ -6,7 +6,7 @@ using Volo.Abp.AspNetCore.Mvc.UI.RazorPages;
namespace Volo.Abp.TenantManagement.Web.Pages.TenantManagement.Tenants
{
public class EditModalModel : AbpPageModel
public class EditModalModel : TenantManagementPageModel
{
[BindProperty]
public TenantInfoModel Tenant { get; set; }

2
modules/tenant-management/src/Volo.Abp.TenantManagement.Web/Pages/TenantManagement/Tenants/Index.cshtml.cs

@ -2,7 +2,7 @@ using Microsoft.AspNetCore.Mvc.RazorPages;
namespace Volo.Abp.TenantManagement.Web.Pages.TenantManagement.Tenants
{
public class IndexModel : PageModel
public class IndexModel : TenantManagementPageModel
{
public void OnGet()
{

12
modules/tenant-management/src/Volo.Abp.TenantManagement.Web/Pages/TenantManagement/Tenants/TenantManagementPageModel.cs

@ -0,0 +1,12 @@
using Volo.Abp.AspNetCore.Mvc.UI.RazorPages;
namespace Volo.Abp.TenantManagement.Web.Pages.TenantManagement.Tenants
{
public class TenantManagementPageModel : AbpPageModel
{
public TenantManagementPageModel()
{
ObjectMapperContext = typeof(AbpTenantManagementWebModule);
}
}
}
Loading…
Cancel
Save