Browse Source

Merge pull request #8413 from abpframework/auto-merge/rel-4-3/224

Merge branch dev with rel-4.3
pull/8419/head
maliming 5 years ago
committed by GitHub
parent
commit
a5cf536435
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 10
      docs/en/Emailing.md
  2. 16
      docs/en/Features.md
  3. 28
      docs/en/Tutorials/Part-10.md
  4. BIN
      docs/en/images/email-settings.png

10
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.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"). * **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 ````json
"Settings": { "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 ### Encrypt the SMTP Password

16
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. 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** **Blazor** applications can use the same `IFeatureChecker` service as explained above.
````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.
## Feature Management ## Feature Management

28
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;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Linq.Dynamic.Core;
using System.Threading.Tasks; using System.Threading.Tasks;
using Acme.BookStore.Authors; using Acme.BookStore.Authors;
using Acme.BookStore.Permissions; using Acme.BookStore.Permissions;
@ -387,23 +388,17 @@ namespace Acme.BookStore.Books
public override async Task<PagedResultDto<BookDto>> GetListAsync(PagedAndSortedResultRequestDto input) public override async Task<PagedResultDto<BookDto>> GetListAsync(PagedAndSortedResultRequestDto input)
{ {
//Set a default sorting, if not provided
if (input.Sorting.IsNullOrWhiteSpace())
{
input.Sorting = nameof(Book.Name);
}
//Get the IQueryable<Book> from the repository //Get the IQueryable<Book> from the repository
var queryable = await Repository.GetQueryableAsync(); var queryable = await Repository.GetQueryableAsync();
//Prepare a query to join books and authors //Prepare a query to join books and authors
var query = from book in queryable var query = from book in queryable
join author in _authorRepository on book.AuthorId equals author.Id join author in _authorRepository on book.AuthorId equals author.Id
orderby input.Sorting //TODO: Can not sort like that!
select new {book, author}; select new {book, author};
//Paging //Paging
query = query query = query
.OrderBy(NormalizeSorting(input.Sorting))
.Skip(input.SkipCount) .Skip(input.SkipCount)
.Take(input.MaxResultCount); .Take(input.MaxResultCount);
@ -435,6 +430,25 @@ namespace Acme.BookStore.Books
ObjectMapper.Map<List<Author>, List<AuthorLookupDto>>(authors) ObjectMapper.Map<List<Author>, List<AuthorLookupDto>>(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}";
}
} }
} }
``` ```

BIN
docs/en/images/email-settings.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Loading…
Cancel
Save