diff --git a/docs/en/Emailing.md b/docs/en/Emailing.md index a98874165d..50e7afc213 100644 --- a/docs/en/Emailing.md +++ b/docs/en/Emailing.md @@ -94,7 +94,13 @@ Email sending uses the [setting system](Settings.md) to define settings and get * **Abp.Mailing.Smtp.EnableSsl**: A value that indicates if the SMTP server uses SSL or not ("true" or "false". Default: "false"). * **Abp.Mailing.Smtp.UseDefaultCredentials**: If true, uses default credentials instead of the provided username and password ("true" or "false". Default: "true"). -The easiest way to define these settings it to add them to the `appsettings.json` file. The [application startup template](Startup-Templates/Application.md) already has these settings in the `appsettings.json`: +Email settings can be managed from the *Settings Page* of the [Setting Management](Modules/Setting-Management.md) module: + +![email-settings](images/email-settings.png) + +> Setting Management module is already installed if you've created your solution from the ABP Startup template. + +If you don't use the Setting Management module, you can simply define the settings inside your `appsettings.json` file: ````json "Settings": { @@ -110,7 +116,7 @@ The easiest way to define these settings it to add them to the `appsettings.json } ```` -You can set/change these settings using the `ISettingManager` and store values in a database. See the [setting system document](Settings.md) to understand the setting system better. +You can set/change these settings programmatically using the `ISettingManager` and store values in a database. See the [setting system document](Settings.md) to understand the setting system better. ### Encrypt the SMTP Password diff --git a/docs/en/Features.md b/docs/en/Features.md index 1ec35f730a..b185eb2d74 100644 --- a/docs/en/Features.md +++ b/docs/en/Features.md @@ -326,20 +326,12 @@ if (feature != null) A feature value is available at the client side too, unless you set `IsVisibleToClients` to `false` on the feature definition. The feature values are exposed from the [Application Configuration API](API/Application-Configuration.md) and usable via some services on the UI. -### ASP.NET Core MVC / Razor Pages UI +See the following documents to learn how to check features in different UI types: -Use `abp.features` API to get the feature values. +* [ASP.NET Core MVC / Razor Pages / JavaScript API](UI/AspNetCore/JavaScript-API/Features.md) +* [Angular](UI/Angular/Features.md) -**Example: Get feature values in the JavaScript code** - -````js -var isEnabled = abp.features.values["MyApp.ExcelReporting"] === "true"; -var count = abp.features.values["MyApp.MaxProductCount"]; -```` - -### Angular UI - -See the [features](Features.md) document for the Angular UI. +**Blazor** applications can use the same `IFeatureChecker` service as explained above. ## Feature Management diff --git a/docs/en/Tutorials/Part-10.md b/docs/en/Tutorials/Part-10.md index b578952cc7..f0e24c4853 100644 --- a/docs/en/Tutorials/Part-10.md +++ b/docs/en/Tutorials/Part-10.md @@ -326,6 +326,7 @@ Open the `BookAppService` interface in the `Books` folder of the `Acme.BookStore using System; using System.Collections.Generic; using System.Linq; +using System.Linq.Dynamic.Core; using System.Threading.Tasks; using Acme.BookStore.Authors; using Acme.BookStore.Permissions; @@ -387,23 +388,17 @@ namespace Acme.BookStore.Books public override async Task> GetListAsync(PagedAndSortedResultRequestDto input) { - //Set a default sorting, if not provided - if (input.Sorting.IsNullOrWhiteSpace()) - { - input.Sorting = nameof(Book.Name); - } - //Get the IQueryable from the repository var queryable = await Repository.GetQueryableAsync(); //Prepare a query to join books and authors var query = from book in queryable join author in _authorRepository on book.AuthorId equals author.Id - orderby input.Sorting //TODO: Can not sort like that! select new {book, author}; //Paging query = query + .OrderBy(NormalizeSorting(input.Sorting)) .Skip(input.SkipCount) .Take(input.MaxResultCount); @@ -435,6 +430,25 @@ namespace Acme.BookStore.Books ObjectMapper.Map, List>(authors) ); } + + private static string NormalizeSorting(string sorting) + { + if (sorting.IsNullOrEmpty()) + { + return $"book.{nameof(Book.Name)}"; + } + + if (sorting.Contains("authorName", StringComparison.OrdinalIgnoreCase)) + { + return sorting.Replace( + "authorName", + "author.Name", + StringComparison.OrdinalIgnoreCase + ); + } + + return $"book.{sorting}"; + } } } ``` diff --git a/docs/en/images/email-settings.png b/docs/en/images/email-settings.png new file mode 100644 index 0000000000..6aa77da312 Binary files /dev/null and b/docs/en/images/email-settings.png differ