Skip to content

Commit 72d02fb

Browse files
committed
Set language to all code blocks to highlight them
1 parent 75022ef commit 72d02fb

9 files changed

+5295
-4641
lines changed

docs/en/Developing-Step-By-Step-Angular.md

Lines changed: 1086 additions & 964 deletions
Large diffs are not rendered by default.

docs/en/Developing-Step-By-Step-Core.md

Lines changed: 1171 additions & 1017 deletions
Large diffs are not rendered by default.

docs/en/Developing-Step-By-Step-MPA.md

Lines changed: 1001 additions & 867 deletions
Large diffs are not rendered by default.

docs/en/Developing-Step-By-Step-Mvc-Angularjs.md

Lines changed: 863 additions & 739 deletions
Large diffs are not rendered by default.

docs/en/Developing-Step-By-Step-Xamarin.md

Lines changed: 811 additions & 749 deletions
Large diffs are not rendered by default.

docs/en/Development-Guide-Mvc-Angularjs.md

Lines changed: 71 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -388,13 +388,15 @@ to get a deep understanding on creating menus.
388388
dynamically defined based on the current user's permissions (see
389389
authorization section). Example:
390390

391-
if (abp.auth.hasPermission('Pages.Administration.Tenant.Settings')) {
392-
$stateProvider.state('tenant.settings', {
393-
url: '/settings',
394-
templateUrl: '~/App/tenant/views/settings/index.cshtml',
395-
menu: 'Administration.Settings.Tenant'
396-
});
397-
}
391+
```javascript
392+
if (abp.auth.hasPermission('Pages.Administration.Tenant.Settings')) {
393+
$stateProvider.state('tenant.settings', {
394+
url: '/settings',
395+
templateUrl: '~/App/tenant/views/settings/index.cshtml',
396+
menu: 'Administration.Settings.Tenant'
397+
});
398+
}
399+
```
398400

399401
Conditional routing definition prevents users from accessing an
400402
unauthorized page by simply entering a URL into the browser's address
@@ -850,13 +852,15 @@ You can also define your custom notifications in the
850852
**AppNotificationProvider** class. For example, a new user registration
851853
notification is defined in the **AppNotificationProvider** as below.
852854

853-
context.Manager.Add(
854-
new NotificationDefinition(
855-
AppNotificationNames.NewUserRegistered,
856-
displayName: L("NewUserRegisteredNotificationDefinition"),
857-
permissionDependency: new SimplePermissionDependency(AppPermissions.Pages_Administration_Users)
858-
)
859-
);
855+
```csharp
856+
context.Manager.Add(
857+
new NotificationDefinition(
858+
AppNotificationNames.NewUserRegistered,
859+
displayName: L("NewUserRegisteredNotificationDefinition"),
860+
permissionDependency: new SimplePermissionDependency(AppPermissions.Pages_Administration_Users)
861+
)
862+
);
863+
```
860864

861865
See [notification
862866
definitions](https://aspnetboilerplate.com/Pages/Documents/Notification-System#notification-definitions)
@@ -1182,7 +1186,9 @@ as a cache server. If you want to enable it, just uncomment the
11821186
following line in your **WebModule** (in App\_Start folder in your .Web
11831187
project):
11841188

1185-
Configuration.Caching.UseRedis();
1189+
```csharp
1190+
Configuration.Caching.UseRedis();
1191+
```
11861192

11871193
Redis server should be running to be able to use it. See [caching
11881194
documentation](https://aspnetboilerplate.com/Pages/Documents/Caching)
@@ -1198,16 +1204,20 @@ easily enable it.
11981204
First, uncomment these lines in **WebModule** (in App\_Start folder in
11991205
your .Web project):
12001206

1201-
Configuration.BackgroundJobs.UseHangfire(configuration =>
1202-
{
1203-
configuration.GlobalConfiguration.UseSqlServerStorage("Default");
1204-
});
1207+
```csharp
1208+
Configuration.BackgroundJobs.UseHangfire(configuration =>
1209+
{
1210+
configuration.GlobalConfiguration.UseSqlServerStorage("Default");
1211+
});
1212+
```
12051213

12061214
If you want to enable the Hangfire dashboard, you can uncomment the
12071215
following line in **Startup.cs** (in App\_Start folder in your .Web
12081216
project):
12091217

1210-
app.UseHangfireDashboard();
1218+
```csharp
1219+
app.UseHangfireDashboard();
1220+
```
12111221

12121222
**Note**: Hangfire creates its **own tables** in the database. See
12131223
[background
@@ -1246,30 +1256,34 @@ that uses AutoMapper, which is simple and declarative.
12461256
See the DTO class that is used to transfer a tenant's editing
12471257
information:
12481258

1249-
[AutoMap(typeof (Tenant))]
1250-
public class TenantEditDto : EntityDto
1251-
{
1252-
[Required]
1253-
[StringLength(Tenant.MaxTenancyNameLength)]
1254-
public string TenancyName { get; set; }
1255-
1256-
[Required]
1257-
[StringLength(Tenant.MaxNameLength)]
1258-
public string Name { get; set; }
1259-
1260-
public bool IsActive { get; set; }
1261-
}
1259+
```csharp
1260+
[AutoMap(typeof (Tenant))]
1261+
public class TenantEditDto : EntityDto
1262+
{
1263+
[Required]
1264+
[StringLength(Tenant.MaxTenancyNameLength)]
1265+
public string TenancyName { get; set; }
1266+
1267+
[Required]
1268+
[StringLength(Tenant.MaxNameLength)]
1269+
public string Name { get; set; }
1270+
1271+
public bool IsActive { get; set; }
1272+
}
1273+
```
12621274

12631275
Here, the **AutoMap** attribute automatically creates mapping between
12641276
**TenantEditDto** and the **Tenant** classes. Then you can automatically
12651277
convert a Tenant object to a TenantEditDto (and vice verse) object as
12661278
shown below:
12671279

1268-
[AbpAuthorize(AppPermissions.Pages_Tenants_Edit)]
1269-
public async Task<TenantEditDto> GetTenantForEdit(EntityRequestInput input)
1270-
{
1271-
return (await TenantManager.GetByIdAsync(input.Id)).MapTo<TenantEditDto>();
1272-
}
1280+
```csharp
1281+
[AbpAuthorize(AppPermissions.Pages_Tenants_Edit)]
1282+
public async Task<TenantEditDto> GetTenantForEdit(EntityRequestInput input)
1283+
{
1284+
return (await TenantManager.GetByIdAsync(input.Id)).MapTo<TenantEditDto>();
1285+
}
1286+
```
12731287

12741288
**MapTo** method does mapping.
12751289

@@ -1478,25 +1492,27 @@ It also provides some useful common methods for all tests.
14781492

14791493
Here is a sample unit test from the application:
14801494

1481-
public class UserAppService_Delete_Tests : UserAppServiceTestBase
1495+
```csharp
1496+
public class UserAppService_Delete_Tests : UserAppServiceTestBase
1497+
{
1498+
[Fact]
1499+
public async Task Should_Delete_User()
14821500
{
1483-
[Fact]
1484-
public async Task Should_Delete_User()
1485-
{
1486-
//Arrange
1487-
CreateTestUsers();
1488-
1489-
var user = await GetUserByUserNameOrNullAsync("artdent");
1490-
user.ShouldNotBe(null);
1491-
1492-
//Act
1493-
await UserAppService.DeleteUser(new IdInput<long>(user.Id));
1494-
1495-
//Assert
1496-
user = await GetUserByUserNameOrNullAsync("artdent");
1497-
user.IsDeleted.ShouldBe(true);
1498-
}
1501+
//Arrange
1502+
CreateTestUsers();
1503+
1504+
var user = await GetUserByUserNameOrNullAsync("artdent");
1505+
user.ShouldNotBe(null);
1506+
1507+
//Act
1508+
await UserAppService.DeleteUser(new IdInput<long>(user.Id));
1509+
1510+
//Assert
1511+
user = await GetUserByUserNameOrNullAsync("artdent");
1512+
user.IsDeleted.ShouldBe(true);
14991513
}
1514+
}
1515+
```
15001516

15011517
It creates some users to test and then verifies there is a user named
15021518
"artdent". Then it calls the **DeleteUser** method of the **user

docs/en/Development-Guide-Rad-Tool-Mac-Linux.md

Lines changed: 87 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -10,91 +10,93 @@
1010

1111
Input file includes a JSON string and it's name is the same as your entity's name. Here is a sample Product.json:
1212

13-
{
14-
"MenuPosition": "main",
15-
"RelativeNamespace": "Products",
16-
"EntityName": "Product",
17-
"EntityNamePlural": "Products",
18-
"TableName": "Products",
19-
"PrimaryKeyType": "int",
20-
"BaseClass": "Entity",
21-
"AutoMigration": true,
22-
"UpdateDatabase": true,
23-
"CreateUserInterface": true,
24-
"CreateViewOnly": true,
25-
"PagePermission": {
26-
"Host": true,
27-
"Tenant": true
28-
},
29-
"Properties": [
30-
{
31-
"Name": "Name",
32-
"Type": "string",
33-
"MaxLength": 25,
34-
"MinLength": 2,
35-
"Range": {
36-
"IsRangeSet": false,
37-
"MinimumValue": 0,
38-
"MaximumValue": 0
39-
},
40-
"Required": true,
41-
"Nullable": false,
42-
"Regex": "",
43-
"UserInterface": {
44-
"List": true,
45-
"AdvancedFilter": true,
46-
"CreateOrUpdate": true
47-
}
48-
},
49-
{
50-
"Name": "Type",
51-
"Type": "ProductType",
52-
"MaxLength": 0,
53-
"MinLength": 0,
54-
"Range": {
55-
"IsRangeSet": false,
56-
"MinimumValue": 0,
57-
"MaximumValue": 0
58-
},
59-
"Required": false,
60-
"Nullable": false,
61-
"Regex": "",
62-
"UserInterface": {
63-
"List": true,
64-
"AdvancedFilter": true,
65-
"CreateOrUpdate": true
66-
}
67-
}
68-
],
69-
"NavigationProperties": [
70-
{
71-
"Namespace": "Volosoft.RadToolExplainer.Authorization.Users",
72-
"ForeignEntityName": "User",
73-
"IdType": "long",
74-
"IsNullable": true,
75-
"PropertyName": "UserId",
76-
"DisplayPropertyName": "Name",
77-
"DuplicationNumber": 0,
78-
"RelationType": "single"
79-
}
80-
],
81-
"EnumDefinitions": [
82-
{
83-
"Name": "ProductType",
84-
"Namespace": "Volosoft.RadToolExplainer",
85-
"EnumProperties": [
86-
{
87-
"Name": "Liquid",
88-
"Value": 1
89-
},
90-
{
91-
"Name": "Solid",
92-
"Value": 2
93-
}
94-
]
95-
}
96-
]
97-
}
13+
```json
14+
{
15+
"MenuPosition": "main",
16+
"RelativeNamespace": "Products",
17+
"EntityName": "Product",
18+
"EntityNamePlural": "Products",
19+
"TableName": "Products",
20+
"PrimaryKeyType": "int",
21+
"BaseClass": "Entity",
22+
"AutoMigration": true,
23+
"UpdateDatabase": true,
24+
"CreateUserInterface": true,
25+
"CreateViewOnly": true,
26+
"PagePermission": {
27+
"Host": true,
28+
"Tenant": true
29+
},
30+
"Properties": [
31+
{
32+
"Name": "Name",
33+
"Type": "string",
34+
"MaxLength": 25,
35+
"MinLength": 2,
36+
"Range": {
37+
"IsRangeSet": false,
38+
"MinimumValue": 0,
39+
"MaximumValue": 0
40+
},
41+
"Required": true,
42+
"Nullable": false,
43+
"Regex": "",
44+
"UserInterface": {
45+
"List": true,
46+
"AdvancedFilter": true,
47+
"CreateOrUpdate": true
48+
}
49+
},
50+
{
51+
"Name": "Type",
52+
"Type": "ProductType",
53+
"MaxLength": 0,
54+
"MinLength": 0,
55+
"Range": {
56+
"IsRangeSet": false,
57+
"MinimumValue": 0,
58+
"MaximumValue": 0
59+
},
60+
"Required": false,
61+
"Nullable": false,
62+
"Regex": "",
63+
"UserInterface": {
64+
"List": true,
65+
"AdvancedFilter": true,
66+
"CreateOrUpdate": true
67+
}
68+
}
69+
],
70+
"NavigationProperties": [
71+
{
72+
"Namespace": "Volosoft.RadToolExplainer.Authorization.Users",
73+
"ForeignEntityName": "User",
74+
"IdType": "long",
75+
"IsNullable": true,
76+
"PropertyName": "UserId",
77+
"DisplayPropertyName": "Name",
78+
"DuplicationNumber": 0,
79+
"RelationType": "single"
80+
}
81+
],
82+
"EnumDefinitions": [
83+
{
84+
"Name": "ProductType",
85+
"Namespace": "Volosoft.RadToolExplainer",
86+
"EnumProperties": [
87+
{
88+
"Name": "Liquid",
89+
"Value": 1
90+
},
91+
{
92+
"Name": "Solid",
93+
"Value": 2
94+
}
95+
]
96+
}
97+
]
98+
}
99+
```
98100

99101
## Guide To Create A New Input File
100102

0 commit comments

Comments
 (0)