From a4ee9f2c7bd73a82d1ffb081284e79f26e81c9c4 Mon Sep 17 00:00:00 2001 From: maliming Date: Wed, 28 Oct 2020 11:05:46 +0800 Subject: [PATCH] Update document files. --- docs/en/Authorization.md | 4 +- .../2020-05-08 v2_7_Release/Post.md | 8 ++-- .../POST.md | 8 ++-- .../POST.md | 14 +++---- ...Application-Modules-Overriding-Services.md | 42 +++++++++---------- docs/en/Entity-Framework-Core.md | 14 +++---- docs/en/Exception-Handling.md | 4 +- docs/en/MongoDB.md | 16 +++---- docs/en/Tutorials/Part-10.md | 26 ++++++------ .../Customization-User-Interface.md | 12 +++--- docs/zh-Hans/Authorization.md | 2 +- .../2020-05-08 v2_7_Release/Post.md | 2 +- ...Application-Modules-Overriding-Services.md | 36 ++++++++-------- docs/zh-Hans/Entity-Framework-Core.md | 6 +-- .../How-To/Customize-SignIn-Manager.md | 2 +- docs/zh-Hans/MongoDB.md | 10 ++--- .../Customization-User-Interface.md | 6 +-- 17 files changed, 106 insertions(+), 106 deletions(-) diff --git a/docs/en/Authorization.md b/docs/en/Authorization.md index eef4237039..158466d153 100644 --- a/docs/en/Authorization.md +++ b/docs/en/Authorization.md @@ -234,7 +234,7 @@ context When you write this code inside your permission definition provider, it finds the "role deletion" permission of the [Identity Module](Modules/Identity.md) and disabled the permission, so no one can delete a role on the application. -> Tip: It is better to check the value returned by the `GetPermissionOrNull` method since it may return null if the given permission was not defined. +> Tip: It is better to check the value returned by the `GetPermissionOrNull` method since it may return null if the given permission was not defined. ## IAuthorizationService @@ -354,7 +354,7 @@ public class SystemAdminPermissionValueProvider : PermissionValueProvider public override string Name => "SystemAdmin"; - public override async Task + public async override Task CheckAsync(PermissionValueCheckContext context) { if (context.Principal?.FindFirst("User_Type")?.Value == "SystemAdmin") diff --git a/docs/en/Blog-Posts/2020-05-08 v2_7_Release/Post.md b/docs/en/Blog-Posts/2020-05-08 v2_7_Release/Post.md index b6c1d3f952..c09b0eb75c 100644 --- a/docs/en/Blog-Posts/2020-05-08 v2_7_Release/Post.md +++ b/docs/en/Blog-Posts/2020-05-08 v2_7_Release/Post.md @@ -16,7 +16,7 @@ ABP.IO Platform is rapidly growing and we are getting more and more contribution ### Object Extending System -In the last few releases, we've mostly focused on providing ways to extend existing modules when you use them as NuGet/NPM Packages. +In the last few releases, we've mostly focused on providing ways to extend existing modules when you use them as NuGet/NPM Packages. The Object Extending System allows module developers to create extensible modules and allows application developers to customize and extend a module easily. @@ -43,7 +43,7 @@ ObjectExtensionManager.Instance options.Attributes.Add(new RequiredAttribute()); options.Attributes.Add( new StringLengthAttribute(32) { - MinimumLength = 6 + MinimumLength = 6 } ); }); @@ -121,7 +121,7 @@ Just create a class derived from the `ExceptionSubscriber` class in your applica ````csharp public class MyExceptionSubscriber : ExceptionSubscriber { - public override async Task HandleAsync(ExceptionNotificationContext context) + public async override Task HandleAsync(ExceptionNotificationContext context) { //TODO... } @@ -244,4 +244,4 @@ We ([Volosoft](https://volosoft.com/) - the core team behind the ABP.IO platform [ABP Framework](https://abp.io/) provides all the infrastructure and application independent framework features to make you more productive, focus on your own business code and implement software development best practices. It provides you a well defined and comfortable development experience without repeating yourself. -[ABP Commercial](https://commercial.abp.io/) provides pre-built functionalities, themes and tooling to save your time if your requirements involve these functionalities in addition to the premium support for the framework and the pre-built modules. \ No newline at end of file +[ABP Commercial](https://commercial.abp.io/) provides pre-built functionalities, themes and tooling to save your time if your requirements involve these functionalities in addition to the premium support for the framework and the pre-built modules. diff --git a/docs/en/Community-Articles/2020-04-19-Customize-the-SignIn-Manager/POST.md b/docs/en/Community-Articles/2020-04-19-Customize-the-SignIn-Manager/POST.md index d46049526d..1342407880 100644 --- a/docs/en/Community-Articles/2020-04-19-Customize-the-SignIn-Manager/POST.md +++ b/docs/en/Community-Articles/2020-04-19-Customize-the-SignIn-Manager/POST.md @@ -1,6 +1,6 @@ # How to Customize the SignIn Manager for ABP Applications -After creating a new application using the [application startup template](https://docs.abp.io/en/abp/latest/Startup-Templates/Application), you may want extend or change the default behavior of the SignIn Manager for your authentication and registration flow needs. ABP [Account Module](https://docs.abp.io/en/abp/latest/Modules/Account) uses the [Identity Management Module](https://docs.abp.io/en/abp/latest/Modules/Identity) for SignIn Manager and the [Identity Management Module](https://docs.abp.io/en/abp/latest/Modules/Identity) uses default [Microsoft Identity SignIn Manager](https://github.com/dotnet/aspnetcore/blob/master/src/Identity/Core/src/SignInManager.cs) ([see here](https://github.com/abpframework/abp/blob/be32a55449e270d2d456df3dabdc91f3ffdd4fa9/modules/identity/src/Volo.Abp.Identity.AspNetCore/Volo/Abp/Identity/AspNetCore/AbpIdentityAspNetCoreModule.cs#L17)). +After creating a new application using the [application startup template](https://docs.abp.io/en/abp/latest/Startup-Templates/Application), you may want extend or change the default behavior of the SignIn Manager for your authentication and registration flow needs. ABP [Account Module](https://docs.abp.io/en/abp/latest/Modules/Account) uses the [Identity Management Module](https://docs.abp.io/en/abp/latest/Modules/Identity) for SignIn Manager and the [Identity Management Module](https://docs.abp.io/en/abp/latest/Modules/Identity) uses default [Microsoft Identity SignIn Manager](https://github.com/dotnet/aspnetcore/blob/master/src/Identity/Core/src/SignInManager.cs) ([see here](https://github.com/abpframework/abp/blob/be32a55449e270d2d456df3dabdc91f3ffdd4fa9/modules/identity/src/Volo.Abp.Identity.AspNetCore/Volo/Abp/Identity/AspNetCore/AbpIdentityAspNetCoreModule.cs#L17)). To write your Custom SignIn Manager, you need to extend [Microsoft Identity SignIn Manager](https://github.com/dotnet/aspnetcore/blob/master/src/Identity/Core/src/SignInManager.cs) class and register it to the DI container. @@ -27,7 +27,7 @@ public class CustomSignInManager : Microsoft.AspNetCore.Identity.SignInManager It is important to use **Volo.Abp.Identity.IdentityUser** type for SignInManager to inherit, not the AppUser of your application. +> It is important to use **Volo.Abp.Identity.IdentityUser** type for SignInManager to inherit, not the AppUser of your application. Afterwards you can override any of the SignIn Manager methods you need and add new methods and properties needed for your authentication or registration flow. @@ -38,7 +38,7 @@ In this case we'll be overriding the `GetExternalLoginInfoAsync` method which is A good way to override a method is copying its [source code](https://github.com/dotnet/aspnetcore/blob/c56aa320c32ee5429d60647782c91d53ac765865/src/Identity/Core/src/SignInManager.cs#L638-L674). In this case, we will be using a minorly modified version of the source code which explicitly shows the namespaces of the methods and properties to help better understanding of the concept. ````csharp -public override async Task GetExternalLoginInfoAsync(string expectedXsrf = null) +public async override Task GetExternalLoginInfoAsync(string expectedXsrf = null) { var auth = await Context.AuthenticateAsync(Microsoft.AspNetCore.Identity.IdentityConstants.ExternalScheme); var items = auth?.Properties?.Items; @@ -93,4 +93,4 @@ PreConfigure(identityBuilder => ## The Source Code -You can find the source code of the completed example [here](https://github.com/abpframework/abp-samples/tree/master/Authentication-Customization). \ No newline at end of file +You can find the source code of the completed example [here](https://github.com/abpframework/abp-samples/tree/master/Authentication-Customization). diff --git a/docs/en/Community-Articles/2020-08-07-Passwordless-Authentication/POST.md b/docs/en/Community-Articles/2020-08-07-Passwordless-Authentication/POST.md index b31ea023f2..9489c004bd 100644 --- a/docs/en/Community-Articles/2020-08-07-Passwordless-Authentication/POST.md +++ b/docs/en/Community-Articles/2020-08-07-Passwordless-Authentication/POST.md @@ -33,7 +33,7 @@ namespace PasswordlessAuthentication.Web } //We need to override this method as well. - public override async Task GetUserModifierAsync(string purpose, UserManager manager, TUser user) + public async override Task GetUserModifierAsync(string purpose, UserManager manager, TUser user) { var userId = await manager.GetUserIdAsync(user); @@ -105,7 +105,7 @@ namespace PasswordlessAuthentication.Web.Pages UserManager = userManager; _userRepository = userRepository; } - + public ActionResult OnGet() { if (!CurrentUser.IsAuthenticated) @@ -115,15 +115,15 @@ namespace PasswordlessAuthentication.Web.Pages return Page(); } - + //added for passwordless authentication public async Task OnPostGeneratePasswordlessTokenAsync() { var adminUser = await _userRepository.FindByNormalizedUserNameAsync("admin"); - + var token = await UserManager.GenerateUserTokenAsync(adminUser, "PasswordlessLoginProvider", "passwordless-auth"); - + PasswordlessLoginUrl = Url.Action("Login", "Passwordless", new {token = token, userId = adminUser.Id.ToString()}, Request.Scheme); @@ -238,7 +238,7 @@ namespace PasswordlessAuthentication.Web.Controllers return Redirect("/"); } - + private static IEnumerable CreateClaims(IUser user, IEnumerable roles) { var claims = new List @@ -272,4 +272,4 @@ That's all! We created a passwordless login with 7 steps. ## Source Code -The completed sample is available on [GitHub repository](https://github.com/abpframework/abp-samples/tree/master/PasswordlessAuthentication). \ No newline at end of file +The completed sample is available on [GitHub repository](https://github.com/abpframework/abp-samples/tree/master/PasswordlessAuthentication). diff --git a/docs/en/Customizing-Application-Modules-Overriding-Services.md b/docs/en/Customizing-Application-Modules-Overriding-Services.md index b8706eea61..97df12a3a6 100644 --- a/docs/en/Customizing-Application-Modules-Overriding-Services.md +++ b/docs/en/Customizing-Application-Modules-Overriding-Services.md @@ -29,7 +29,7 @@ public class TestAppService : IIdentityUserAppService, ITransientDependency } ```` -The dependency injection system allows to register multiple services for the same interface. The last registered one is used when the interface is injected. It is a good practice to explicitly replace the service. +The dependency injection system allows to register multiple services for the same interface. The last registered one is used when the interface is injected. It is a good practice to explicitly replace the service. Example: @@ -76,7 +76,7 @@ public class MyIdentityUserAppService : IdentityUserAppService { } - public override async Task CreateAsync(IdentityUserCreateDto input) + public async override Task CreateAsync(IdentityUserCreateDto input) { if (input.PhoneNumber.IsNullOrWhiteSpace()) { @@ -109,33 +109,33 @@ public class MyIdentityUserManager : IdentityUserManager { public MyIdentityUserManager( IdentityUserStore store, - IIdentityRoleRepository roleRepository, + IIdentityRoleRepository roleRepository, IIdentityUserRepository userRepository, - IOptions optionsAccessor, + IOptions optionsAccessor, IPasswordHasher passwordHasher, - IEnumerable> userValidators, - IEnumerable> passwordValidators, + IEnumerable> userValidators, + IEnumerable> passwordValidators, ILookupNormalizer keyNormalizer, IdentityErrorDescriber errors, IServiceProvider services, - ILogger logger, - ICancellationTokenProvider cancellationTokenProvider) : + ILogger logger, + ICancellationTokenProvider cancellationTokenProvider) : base(store, roleRepository, - userRepository, - optionsAccessor, - passwordHasher, - userValidators, + userRepository, + optionsAccessor, + passwordHasher, + userValidators, passwordValidators, - keyNormalizer, - errors, - services, - logger, + keyNormalizer, + errors, + services, + logger, cancellationTokenProvider) { } - public override async Task CreateAsync(IdentityUser user) + public async override Task CreateAsync(IdentityUser user) { if (user.PhoneNumber.IsNullOrWhiteSpace()) { @@ -182,7 +182,7 @@ namespace MyProject.Controllers } - public override async Task SendPasswordResetCodeAsync( + public async override Task SendPasswordResetCodeAsync( SendPasswordResetCodeDto input) { Logger.LogInformation("Your custom logic..."); @@ -214,7 +214,7 @@ Assuming that you've already added a `SocialSecurityNumber` as described in the You can use the [object extension system](Object-Extensions.md) to add the property to the `IdentityUserDto`. Write this code inside the `YourProjectNameDtoExtensions` class comes with the application startup template: ````csharp -ObjectExtensionManager.Instance +ObjectExtensionManager.Instance .AddOrUpdateProperty( "SocialSecurityNumber" ); @@ -286,8 +286,8 @@ ObjectExtensionManager.Instance .AddOrUpdateProperty( new[] { - typeof(IdentityUserDto), - typeof(IdentityUserCreateDto), + typeof(IdentityUserDto), + typeof(IdentityUserCreateDto), typeof(IdentityUserUpdateDto) }, "SocialSecurityNumber" diff --git a/docs/en/Entity-Framework-Core.md b/docs/en/Entity-Framework-Core.md index 98163e7c28..5d41d571b7 100644 --- a/docs/en/Entity-Framework-Core.md +++ b/docs/en/Entity-Framework-Core.md @@ -92,7 +92,7 @@ protected override void OnModelCreating(ModelBuilder builder) b.ToTable("Books"); //Configure the base properties - b.ConfigureByConvention(); + b.ConfigureByConvention(); //Configure other properties (if you are using the fluent API) b.Property(x => x.Name).IsRequired().HasMaxLength(128); @@ -113,7 +113,7 @@ If you have multiple databases in your application, you can configure the connec [ConnectionStringName("MySecondConnString")] public class MyDbContext : AbpDbContext { - + } ``` @@ -254,7 +254,7 @@ If you want to replace default repository implementation with your custom reposi context.Services.AddAbpDbContext(options => { options.AddDefaultRepositories(); - + //Replaces IRepository options.AddRepository(); }); @@ -263,7 +263,7 @@ context.Services.AddAbpDbContext(options => This is especially important when you want to **override a base repository method** to customize it. For instance, you may want to override `DeleteAsync` method to delete a specific entity in a more efficient way: ````csharp -public override async Task DeleteAsync( +public async override Task DeleteAsync( Guid id, bool autoSave = false, CancellationToken cancellationToken = default) @@ -365,7 +365,7 @@ public class MyRepositoryBase : EfCoreRepository where TEntity : class, IEntity { - public MyRepositoryBase(IDbContextProvider dbContextProvider) + public MyRepositoryBase(IDbContextProvider dbContextProvider) : base(dbContextProvider) { } @@ -395,7 +395,7 @@ context.Services.AddAbpDbContext(options => typeof(MyRepositoryBase<,>), typeof(MyRepositoryBase<>) ); - + //... }); ``` @@ -448,4 +448,4 @@ In this example, `OtherDbContext` implements `IBookStoreDbContext`. This feature ## See Also -* [Entities](Entities.md) \ No newline at end of file +* [Entities](Entities.md) diff --git a/docs/en/Exception-Handling.md b/docs/en/Exception-Handling.md index 59a2c6bd0e..04cc6fc695 100644 --- a/docs/en/Exception-Handling.md +++ b/docs/en/Exception-Handling.md @@ -85,7 +85,7 @@ Error **details** in an optional field of the JSON error message. Thrown `Except ### Logging -Caught exceptions are automatically logged. +Caught exceptions are automatically logged. #### Log Level @@ -300,7 +300,7 @@ In this case, create a class derived from the `ExceptionSubscriber` class in you ````csharp public class MyExceptionSubscriber : ExceptionSubscriber { - public override async Task HandleAsync(ExceptionNotificationContext context) + public async override Task HandleAsync(ExceptionNotificationContext context) { //TODO... } diff --git a/docs/en/MongoDB.md b/docs/en/MongoDB.md index 475eb94f1b..98769c13b8 100644 --- a/docs/en/MongoDB.md +++ b/docs/en/MongoDB.md @@ -40,7 +40,7 @@ public class MyDbContext : AbpMongoDbContext protected override void CreateModel(IMongoModelBuilder modelBuilder) { base.CreateModel(modelBuilder); - + //Customize the configuration for your collections. } } @@ -62,7 +62,7 @@ So, most of times you don't need to explicitly configure registration for your e protected override void CreateModel(IMongoModelBuilder modelBuilder) { base.CreateModel(modelBuilder); - + modelBuilder.Entity(b => { b.CollectionName = "MyQuestions"; //Sets the collection name @@ -88,7 +88,7 @@ If you have multiple databases in your application, you can configure the connec [ConnectionStringName("MySecondConnString")] public class MyDbContext : AbpMongoDbContext { - + } ```` @@ -202,7 +202,7 @@ You generally want to derive from the `IRepository` to inherit standard reposito Example implementation of the `IBookRepository` interface: ```csharp -public class BookRepository : +public class BookRepository : MongoDbRepository, IBookRepository { @@ -242,9 +242,9 @@ context.Services.AddMongoDbContext(options => This is especially important when you want to **override a base repository method** to customize it. For instance, you may want to override `DeleteAsync` method to delete an entity in a more efficient way: ```csharp -public override async Task DeleteAsync( - Guid id, - bool autoSave = false, +public async override Task DeleteAsync( + Guid id, + bool autoSave = false, CancellationToken cancellationToken = default) { //TODO: Custom implementation of the delete method @@ -381,4 +381,4 @@ context.Services.AddMongoDbContext(options => }); ``` -In this example, `OtherMongoDbContext` implements `IBookStoreMongoDbContext`. This feature allows you to have multiple MongoDbContext (one per module) on development, but single MongoDbContext (implements all interfaces of all MongoDbContexts) on runtime. \ No newline at end of file +In this example, `OtherMongoDbContext` implements `IBookStoreMongoDbContext`. This feature allows you to have multiple MongoDbContext (one per module) on development, but single MongoDbContext (implements all interfaces of all MongoDbContexts) on runtime. diff --git a/docs/en/Tutorials/Part-10.md b/docs/en/Tutorials/Part-10.md index 53f19d93dd..98c1aa91ac 100644 --- a/docs/en/Tutorials/Part-10.md +++ b/docs/en/Tutorials/Part-10.md @@ -10,7 +10,7 @@ In this tutorial series, you will build an ABP based web application named `Acme.BookStore`. This application is used to manage a list of books and their authors. It is developed using the following technologies: -* **{{DB_Value}}** as the ORM provider. +* **{{DB_Value}}** as the ORM provider. * **{{UI_Value}}** as the UI Framework. This tutorial is organized as the following parts; @@ -78,7 +78,7 @@ builder.Entity(b => b.ToTable(BookStoreConsts.DbTablePrefix + "Books", BookStoreConsts.DbSchema); b.ConfigureByConvention(); //auto configure for the base class props b.Property(x => x.Name).IsRequired().HasMaxLength(128); - + // ADD THE MAPPING FOR THE RELATION b.HasOne().WithMany().HasForeignKey(x => x.AuthorId).IsRequired(); }); @@ -362,7 +362,7 @@ namespace Acme.BookStore.Books DeletePolicyName = BookStorePermissions.Books.Create; } - public override async Task GetAsync(Guid id) + public async override Task GetAsync(Guid id) { await CheckGetPolicyAsync(); @@ -384,7 +384,7 @@ namespace Acme.BookStore.Books return bookDto; } - public override async Task> + public async override Task> GetListAsync(PagedAndSortedResultRequestDto input) { await CheckGetListPolicyAsync(); @@ -485,7 +485,7 @@ namespace Acme.BookStore.Books DeletePolicyName = BookStorePermissions.Books.Create; } - public override async Task GetAsync(Guid id) + public async override Task GetAsync(Guid id) { await CheckGetPolicyAsync(); @@ -498,7 +498,7 @@ namespace Acme.BookStore.Books return bookDto; } - public override async Task> + public async override Task> GetListAsync(PagedAndSortedResultRequestDto input) { await CheckGetListPolicyAsync(); @@ -524,7 +524,7 @@ namespace Acme.BookStore.Books var authorDictionary = await GetAuthorDictionaryAsync(books); //Set AuthorName for the DTOs - bookDtos.ForEach(bookDto => bookDto.AuthorName = + bookDtos.ForEach(bookDto => bookDto.AuthorName = authorDictionary[bookDto.AuthorId].Name); //Get the total count with another query (required for the paging) @@ -622,7 +622,7 @@ namespace Acme.BookStore.Books result.Items.ShouldContain(b => b.Name == "1984" && b.AuthorName == "George Orwell"); } - + [Fact] public async Task Should_Create_A_Valid_Book() { @@ -645,7 +645,7 @@ namespace Acme.BookStore.Books result.Id.ShouldNotBe(Guid.Empty); result.Name.ShouldBe("New test book 42"); } - + [Fact] public async Task Should_Not_Create_A_Book_Without_Name() { @@ -1104,11 +1104,11 @@ The final `@code` block should be the following: { await base.OnInitializedAsync(); - canCreateBook = await + canCreateBook = await AuthorizationService.IsGrantedAsync(BookStorePermissions.Books.Create); - canEditBook = await + canEditBook = await AuthorizationService.IsGrantedAsync(BookStorePermissions.Books.Edit); - canDeleteBook = await + canDeleteBook = await AuthorizationService.IsGrantedAsync(BookStorePermissions.Books.Delete); //GET AUTHORS @@ -1164,4 +1164,4 @@ Add the following `Field` definition into the `ModalBody` of the *Edit* modal, a That's all. We are reusing the `authorList` defined for the *Create* modal. -{{end}} \ No newline at end of file +{{end}} diff --git a/docs/en/UI/AspNetCore/Customization-User-Interface.md b/docs/en/UI/AspNetCore/Customization-User-Interface.md index c4e196fbb9..b3e0ec33fb 100644 --- a/docs/en/UI/AspNetCore/Customization-User-Interface.md +++ b/docs/en/UI/AspNetCore/Customization-User-Interface.md @@ -28,15 +28,15 @@ namespace Acme.BookStore.Web.Pages.Identity.Users public class MyEditModalModel : EditModalModel { public MyEditModalModel( - IIdentityUserAppService identityUserAppService, + IIdentityUserAppService identityUserAppService, IIdentityRoleAppService identityRoleAppService ) : base( - identityUserAppService, + identityUserAppService, identityRoleAppService) { } - public override async Task OnPostAsync() + public async override Task OnPostAsync() { //TODO: Additional logic await base.OnPostAsync(); @@ -84,10 +84,10 @@ Create a page model class deriving from the ` LoginModel ` (defined in the ` Vol public class MyLoginModel : LoginModel { public MyLoginModel( - IAuthenticationSchemeProvider schemeProvider, + IAuthenticationSchemeProvider schemeProvider, IOptions accountOptions ) : base( - schemeProvider, + schemeProvider, accountOptions) { @@ -437,7 +437,7 @@ See the layouts section below to learn more about the layout system. Layout system allows themes to define standard, named layouts and allows any page to select a proper layout for its purpose. There are three pre-defined layouts: -* "**Application**": The main (and the default) layout for an application. It typically contains header, menu (sidebar), footer, toolbar... etc. +* "**Application**": The main (and the default) layout for an application. It typically contains header, menu (sidebar), footer, toolbar... etc. * "**Account**": This layout is used by login, register and other similar pages. It is used for the pages under the `/Pages/Account` folder by default. * "**Empty**": Empty and minimal layout. diff --git a/docs/zh-Hans/Authorization.md b/docs/zh-Hans/Authorization.md index 96caae1404..db0dfdb654 100644 --- a/docs/zh-Hans/Authorization.md +++ b/docs/zh-Hans/Authorization.md @@ -343,7 +343,7 @@ public class SystemAdminPermissionValueProvider : PermissionValueProvider public override string Name => "SystemAdmin"; - public override async Task + public async override Task CheckAsync(PermissionValueCheckContext context) { if (context.Principal?.FindFirst("User_Type")?.Value == "SystemAdmin") diff --git a/docs/zh-Hans/Blog-Posts/2020-05-08 v2_7_Release/Post.md b/docs/zh-Hans/Blog-Posts/2020-05-08 v2_7_Release/Post.md index 0f97391eb8..bc448179cc 100644 --- a/docs/zh-Hans/Blog-Posts/2020-05-08 v2_7_Release/Post.md +++ b/docs/zh-Hans/Blog-Posts/2020-05-08 v2_7_Release/Post.md @@ -121,7 +121,7 @@ ABP框架的[异常处理系统](https://docs.abp.io/en/abp/latest/Exception-Han ````csharp public class MyExceptionSubscriber : ExceptionSubscriber { - public override async Task HandleAsync(ExceptionNotificationContext context) + public async override Task HandleAsync(ExceptionNotificationContext context) { //TODO... } diff --git a/docs/zh-Hans/Customizing-Application-Modules-Overriding-Services.md b/docs/zh-Hans/Customizing-Application-Modules-Overriding-Services.md index 21245cec16..2e950d4355 100644 --- a/docs/zh-Hans/Customizing-Application-Modules-Overriding-Services.md +++ b/docs/zh-Hans/Customizing-Application-Modules-Overriding-Services.md @@ -76,7 +76,7 @@ public class MyIdentityUserAppService : IdentityUserAppService { } - public override async Task CreateAsync(IdentityUserCreateDto input) + public async override Task CreateAsync(IdentityUserCreateDto input) { if (input.PhoneNumber.IsNullOrWhiteSpace()) { @@ -109,33 +109,33 @@ public class MyIdentityUserManager : IdentityUserManager { public MyIdentityUserManager( IdentityUserStore store, - IIdentityRoleRepository roleRepository, + IIdentityRoleRepository roleRepository, IIdentityUserRepository userRepository, - IOptions optionsAccessor, + IOptions optionsAccessor, IPasswordHasher passwordHasher, - IEnumerable> userValidators, - IEnumerable> passwordValidators, + IEnumerable> userValidators, + IEnumerable> passwordValidators, ILookupNormalizer keyNormalizer, IdentityErrorDescriber errors, IServiceProvider services, - ILogger logger, - ICancellationTokenProvider cancellationTokenProvider) : + ILogger logger, + ICancellationTokenProvider cancellationTokenProvider) : base(store, roleRepository, - userRepository, - optionsAccessor, - passwordHasher, - userValidators, + userRepository, + optionsAccessor, + passwordHasher, + userValidators, passwordValidators, - keyNormalizer, - errors, - services, - logger, + keyNormalizer, + errors, + services, + logger, cancellationTokenProvider) { } - public override async Task CreateAsync(IdentityUser user) + public async override Task CreateAsync(IdentityUser user) { if (user.PhoneNumber.IsNullOrWhiteSpace()) { @@ -251,8 +251,8 @@ ObjectExtensionManager.Instance .AddOrUpdateProperty( new[] { - typeof(IdentityUserDto), - typeof(IdentityUserCreateDto), + typeof(IdentityUserDto), + typeof(IdentityUserCreateDto), typeof(IdentityUserUpdateDto) }, "SocialSecurityNumber" diff --git a/docs/zh-Hans/Entity-Framework-Core.md b/docs/zh-Hans/Entity-Framework-Core.md index 211ec4d65f..b5252b86c0 100644 --- a/docs/zh-Hans/Entity-Framework-Core.md +++ b/docs/zh-Hans/Entity-Framework-Core.md @@ -263,7 +263,7 @@ context.Services.AddAbpDbContext(options => 在你想要覆盖默认仓储方法对其自定义时,这一点非常需要. 例如你可能希望自定义`DeleteAsync`方法覆盖默认实现 ````csharp -public override async Task DeleteAsync( +public async override Task DeleteAsync( Guid id, bool autoSave = false, CancellationToken cancellationToken = default) @@ -365,7 +365,7 @@ public class MyRepositoryBase : EfCoreRepository where TEntity : class, IEntity { - public MyRepositoryBase(IDbContextProvider dbContextProvider) + public MyRepositoryBase(IDbContextProvider dbContextProvider) : base(dbContextProvider) { } @@ -447,4 +447,4 @@ context.Services.AddAbpDbContext(options => ## 另请参阅 -* [实体](Entities.md) \ No newline at end of file +* [实体](Entities.md) diff --git a/docs/zh-Hans/How-To/Customize-SignIn-Manager.md b/docs/zh-Hans/How-To/Customize-SignIn-Manager.md index 73cbcd2ce7..eea0364e6e 100644 --- a/docs/zh-Hans/How-To/Customize-SignIn-Manager.md +++ b/docs/zh-Hans/How-To/Customize-SignIn-Manager.md @@ -38,7 +38,7 @@ public class CustomSignInManager : Microsoft.AspNetCore.Identity.SignInManager GetExternalLoginInfoAsync(string expectedXsrf = null) +public async override Task GetExternalLoginInfoAsync(string expectedXsrf = null) { var auth = await Context.AuthenticateAsync(Microsoft.AspNetCore.Identity.IdentityConstants.ExternalScheme); var items = auth?.Properties?.Items; diff --git a/docs/zh-Hans/MongoDB.md b/docs/zh-Hans/MongoDB.md index c90b9b5740..2ceeb1e00c 100644 --- a/docs/zh-Hans/MongoDB.md +++ b/docs/zh-Hans/MongoDB.md @@ -160,7 +160,7 @@ public interface IBookRepository : IRepository 实现`IBookRepository`接口的例子: ```csharp -public class BookRepository : +public class BookRepository : MongoDbRepository, IBookRepository { @@ -200,9 +200,9 @@ context.Services.AddMongoDbContext(options => 当你想**重写基础仓储方法**时,这一点尤为重要.例如,你想要重写`DeleteAsync`方法,以便更有效的删除实体: ```csharp -public override async Task DeleteAsync( - Guid id, - bool autoSave = false, +public async override Task DeleteAsync( + Guid id, + bool autoSave = false, CancellationToken cancellationToken = default) { //TODO: 自定义实现删除方法 @@ -338,4 +338,4 @@ context.Services.AddMongoDbContext(options => }); ``` -这个例子中,`OtherMongoDbContext`实现了`IBookStoreMongoDbContext`.这个特性允许你在发开的时候使用多个MongoDbContext(每个模块一个),但是运行的时候只能使有一个MongoDbContext(实现所有MongoDbContexts的所有接口) \ No newline at end of file +这个例子中,`OtherMongoDbContext`实现了`IBookStoreMongoDbContext`.这个特性允许你在发开的时候使用多个MongoDbContext(每个模块一个),但是运行的时候只能使有一个MongoDbContext(实现所有MongoDbContexts的所有接口) diff --git a/docs/zh-Hans/UI/AspNetCore/Customization-User-Interface.md b/docs/zh-Hans/UI/AspNetCore/Customization-User-Interface.md index c94c29d27f..44eb9b6e26 100644 --- a/docs/zh-Hans/UI/AspNetCore/Customization-User-Interface.md +++ b/docs/zh-Hans/UI/AspNetCore/Customization-User-Interface.md @@ -36,7 +36,7 @@ namespace Acme.BookStore.Web.Pages.Identity.Users { } - public override async Task OnPostAsync() + public async override Task OnPostAsync() { //TODO: Additional logic await base.OnPostAsync(); @@ -83,10 +83,10 @@ namespace Acme.BookStore.Web.Pages.Identity.Users public class MyLoginModel : LoginModel { public MyLoginModel( - IAuthenticationSchemeProvider schemeProvider, + IAuthenticationSchemeProvider schemeProvider, IOptions accountOptions ) : base( - schemeProvider, + schemeProvider, accountOptions) {