From b4e113592751a49ad385bd6c1d06c5440dcb3f7c Mon Sep 17 00:00:00 2001 From: Yunus Emre Kalkan Date: Thu, 14 Apr 2022 11:31:37 +0300 Subject: [PATCH 1/7] Put ABP Book to home pages of application template --- .../angular/src/app/home/home.component.html | 47 ++++++++++++++++--- .../Pages/Index.razor | 34 +++++++++++++- .../Pages/Index.razor | 32 ++++++++++++- .../Pages/Index.razor | 30 ++++++++++++ .../Pages/Index.cshtml | 35 ++++++++++++-- .../Pages/Index.cshtml | 35 ++++++++++++-- 6 files changed, 198 insertions(+), 15 deletions(-) diff --git a/templates/app/angular/src/app/home/home.component.html b/templates/app/angular/src/app/home/home.component.html index 39c197e4ca..2ab92b287c 100644 --- a/templates/app/angular/src/app/home/home.component.html +++ b/templates/app/angular/src/app/home/home.component.html @@ -11,9 +11,44 @@

{{ '::LongWelcomeMessage' | abpLocalization }}

{{ 'AbpAccount::Login' | abpLocalization }} {{ 'AbpAccount::Login' | abpLocalization }} +
+
+
+
+ +
+
+
+ The Official Guide +

Mastering ABP Framework

+

Written by the creator of the ABP Framework, this book will help you gain a complete + understanding of the framework and modern web application development techniques.

+ + +
+
+
+
+

Let's improve your application!

Here are some links to help you get started:

@@ -268,13 +303,13 @@

Abp Framework Abp Framework Abp Commercial Abp Commercial abpframework abpframework

@@ -296,7 +331,7 @@ [href]="link.href" target="_blank" class="btn btn-link px-1" - >{{ link.label }} {{ link.label }}
@@ -309,7 +344,7 @@ Details Details diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.Tiered/Pages/Index.razor b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.Tiered/Pages/Index.razor index 93745851b5..3fe35f24f2 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.Tiered/Pages/Index.razor +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.Tiered/Pages/Index.razor @@ -12,13 +12,43 @@

Welcome to the Application

@L["LongWelcomeMessage"]

- + @if (!CurrentUser.IsAuthenticated) { - @L["Login"] + @L["Login"] } +
+
+
+
+ +
+
+
+ The Official Guide +

Mastering ABP Framework

+

Written by the creator of the ABP Framework, this book will help you gain a complete understanding of the framework and modern web application development techniques.

+ + +
+
+
+
+
+

Let's improve your application!

Here are some links to help you get started:

diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server/Pages/Index.razor b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server/Pages/Index.razor index 4bb044a987..084bfea848 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server/Pages/Index.razor +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server/Pages/Index.razor @@ -15,10 +15,40 @@ @if (!CurrentUser.IsAuthenticated) { - @L["Login"] + @L["Login"] }
+
+
+
+
+ +
+
+
+ The Official Guide +

Mastering ABP Framework

+

Written by the creator of the ABP Framework, this book will help you gain a complete understanding of the framework and modern web application development techniques.

+ + +
+
+
+
+
+

Let's improve your application!

Here are some links to help you get started:

diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/Pages/Index.razor b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/Pages/Index.razor index f5bbdd4b89..83fd7a031c 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/Pages/Index.razor +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/Pages/Index.razor @@ -21,6 +21,36 @@ }
+
+
+
+
+ +
+
+
+ The Official Guide +

Mastering ABP Framework

+

Written by the creator of the ABP Framework, this book will help you gain a complete understanding of the framework and modern web application development techniques.

+ + +
+
+
+
+
+

Let's improve your application!

Here are some links to help you get started:

diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web.Host/Pages/Index.cshtml b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web.Host/Pages/Index.cshtml index 24277f225e..c96b33c6e9 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web.Host/Pages/Index.cshtml +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web.Host/Pages/Index.cshtml @@ -6,10 +6,10 @@ @inject IHtmlLocalizer L @inject ICurrentUser CurrentUser @section styles { - + } @section scripts { - + }
@@ -22,10 +22,39 @@ @if (!CurrentUser.IsAuthenticated) { - @L["Login"] + @L["Login"] }
+
+
+
+
+ +
+
+
+ The Official Guide +

Mastering ABP Framework

+

Written by the creator of the ABP Framework, this book will help you gain a complete understanding of the framework and modern web application development techniques.

+ + +
+
+
+
+

Let's improve your application!

Here are some links to help you get started:

diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web/Pages/Index.cshtml b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web/Pages/Index.cshtml index 2035994cf0..d9bc10a4c7 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web/Pages/Index.cshtml +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web/Pages/Index.cshtml @@ -6,10 +6,10 @@ @inject IHtmlLocalizer L @inject ICurrentUser CurrentUser @section styles { - + } @section scripts { - + }
@@ -22,10 +22,39 @@ @if (!CurrentUser.IsAuthenticated) { - @L["Login"] + @L["Login"] }
+
+
+
+
+ +
+
+
+ The Official Guide +

Mastering ABP Framework

+

Written by the creator of the ABP Framework, this book will help you gain a complete understanding of the framework and modern web application development techniques.

+ + +
+
+
+
+

Let's improve your application!

Here are some links to help you get started:

From 963c47f03f6eff3f648d2e4554b0eb97bbffaa7a Mon Sep 17 00:00:00 2001 From: Yunus Emre Kalkan Date: Thu, 14 Apr 2022 11:46:16 +0300 Subject: [PATCH 2/7] Put ABP Book to home pages of application nolayers template --- .../angular/src/app/home/home.component.html | 39 ++++++++++++++++++- .../Pages/Index.razor | 30 ++++++++++++++ .../Pages/Index.razor | 30 ++++++++++++++ .../Pages/Index.cshtml | 30 ++++++++++++++ .../Pages/Index.cshtml | 30 ++++++++++++++ 5 files changed, 157 insertions(+), 2 deletions(-) diff --git a/templates/app-nolayers/angular/src/app/home/home.component.html b/templates/app-nolayers/angular/src/app/home/home.component.html index ae58ba4051..273b0039ba 100644 --- a/templates/app-nolayers/angular/src/app/home/home.component.html +++ b/templates/app-nolayers/angular/src/app/home/home.component.html @@ -1,4 +1,4 @@ -
+
@@ -9,4 +9,39 @@ {{ '::Welcome_Text' | abpLocalization }}
-
\ No newline at end of file +
+
+
+
+ +
+
+
+ The Official Guide +

Mastering ABP Framework

+

Written by the creator of the ABP Framework, this book will help you gain a complete + understanding of the framework and modern web application development techniques.

+ + +
+
+
+
+
+
diff --git a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server.Mongo/Pages/Index.razor b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server.Mongo/Pages/Index.razor index 64cfd00d9e..93b6f25715 100644 --- a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server.Mongo/Pages/Index.razor +++ b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server.Mongo/Pages/Index.razor @@ -11,4 +11,34 @@ @L["Welcome_Text"]
+ +
+
+
+
+ +
+
+
+ The Official Guide +

Mastering ABP Framework

+

Written by the creator of the ABP Framework, this book will help you gain a complete understanding of the framework and modern web application development techniques.

+ + +
+
+
+
+
diff --git a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server/Pages/Index.razor b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server/Pages/Index.razor index 64cfd00d9e..93b6f25715 100644 --- a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server/Pages/Index.razor +++ b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server/Pages/Index.razor @@ -11,4 +11,34 @@ @L["Welcome_Text"]
+ +
+
+
+
+ +
+
+
+ The Official Guide +

Mastering ABP Framework

+

Written by the creator of the ABP Framework, this book will help you gain a complete understanding of the framework and modern web application development techniques.

+ + +
+
+
+
+
diff --git a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Mvc.Mongo/Pages/Index.cshtml b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Mvc.Mongo/Pages/Index.cshtml index e8d29eac9d..0ce88725f4 100644 --- a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Mvc.Mongo/Pages/Index.cshtml +++ b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Mvc.Mongo/Pages/Index.cshtml @@ -21,4 +21,34 @@ @L["Welcome_Text"] + +
+
+
+
+ +
+
+
+ The Official Guide +

Mastering ABP Framework

+

Written by the creator of the ABP Framework, this book will help you gain a complete understanding of the framework and modern web application development techniques.

+ + +
+
+
+
+
\ No newline at end of file diff --git a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Mvc/Pages/Index.cshtml b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Mvc/Pages/Index.cshtml index e8d29eac9d..0ce88725f4 100644 --- a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Mvc/Pages/Index.cshtml +++ b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Mvc/Pages/Index.cshtml @@ -21,4 +21,34 @@ @L["Welcome_Text"] + +
+
+
+
+ +
+
+
+ The Official Guide +

Mastering ABP Framework

+

Written by the creator of the ABP Framework, this book will help you gain a complete understanding of the framework and modern web application development techniques.

+ + +
+
+
+
+
\ No newline at end of file From f1a2a4ba61d8dd8a909a24f3313de350ed8a1291 Mon Sep 17 00:00:00 2001 From: Yunus Emre Kalkan Date: Thu, 14 Apr 2022 12:21:48 +0300 Subject: [PATCH 3/7] Remove `Click here to learn more` link --- .../app-nolayers/angular/src/app/home/home.component.html | 6 ------ .../Pages/Index.razor | 5 ----- .../Pages/Index.razor | 5 ----- .../Pages/Index.cshtml | 5 ----- .../MyCompanyName.MyProjectName.Mvc/Pages/Index.cshtml | 5 ----- templates/app/angular/src/app/home/home.component.html | 6 ------ .../Pages/Index.razor | 5 ----- .../Pages/Index.razor | 5 ----- .../MyCompanyName.MyProjectName.Blazor/Pages/Index.razor | 5 ----- .../MyCompanyName.MyProjectName.Web.Host/Pages/Index.cshtml | 5 ----- .../src/MyCompanyName.MyProjectName.Web/Pages/Index.cshtml | 5 ----- 11 files changed, 57 deletions(-) diff --git a/templates/app-nolayers/angular/src/app/home/home.component.html b/templates/app-nolayers/angular/src/app/home/home.component.html index 273b0039ba..c469a244de 100644 --- a/templates/app-nolayers/angular/src/app/home/home.component.html +++ b/templates/app-nolayers/angular/src/app/home/home.component.html @@ -33,12 +33,6 @@ Buy on PACKT -
- - Click here to learn more > - -
diff --git a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server.Mongo/Pages/Index.razor b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server.Mongo/Pages/Index.razor index 93b6f25715..73b18b975e 100644 --- a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server.Mongo/Pages/Index.razor +++ b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server.Mongo/Pages/Index.razor @@ -31,11 +31,6 @@ Buy on PACKT -
- - Click here to learn more > - -
diff --git a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server/Pages/Index.razor b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server/Pages/Index.razor index 93b6f25715..73b18b975e 100644 --- a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server/Pages/Index.razor +++ b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server/Pages/Index.razor @@ -31,11 +31,6 @@ Buy on PACKT -
- - Click here to learn more > - -
diff --git a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Mvc.Mongo/Pages/Index.cshtml b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Mvc.Mongo/Pages/Index.cshtml index 0ce88725f4..0054967c73 100644 --- a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Mvc.Mongo/Pages/Index.cshtml +++ b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Mvc.Mongo/Pages/Index.cshtml @@ -41,11 +41,6 @@ Buy on PACKT -
- - Click here to learn more > - -
diff --git a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Mvc/Pages/Index.cshtml b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Mvc/Pages/Index.cshtml index 0ce88725f4..0054967c73 100644 --- a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Mvc/Pages/Index.cshtml +++ b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Mvc/Pages/Index.cshtml @@ -41,11 +41,6 @@ Buy on PACKT -
- - Click here to learn more > - -
diff --git a/templates/app/angular/src/app/home/home.component.html b/templates/app/angular/src/app/home/home.component.html index 2ab92b287c..0bcef1c166 100644 --- a/templates/app/angular/src/app/home/home.component.html +++ b/templates/app/angular/src/app/home/home.component.html @@ -38,12 +38,6 @@ Buy on PACKT -
- - Click here to learn more > - -
diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.Tiered/Pages/Index.razor b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.Tiered/Pages/Index.razor index 3fe35f24f2..cfdfb806f4 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.Tiered/Pages/Index.razor +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.Tiered/Pages/Index.razor @@ -38,11 +38,6 @@ Buy on PACKT -
- - Click here to learn more > - -
diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server/Pages/Index.razor b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server/Pages/Index.razor index 084bfea848..e3153e68a7 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server/Pages/Index.razor +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server/Pages/Index.razor @@ -38,11 +38,6 @@ Buy on PACKT -
- - Click here to learn more > - -
diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/Pages/Index.razor b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/Pages/Index.razor index 83fd7a031c..b27b97109c 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/Pages/Index.razor +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/Pages/Index.razor @@ -40,11 +40,6 @@ Buy on PACKT -
- - Click here to learn more > - -
diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web.Host/Pages/Index.cshtml b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web.Host/Pages/Index.cshtml index c96b33c6e9..9f888e8e4e 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web.Host/Pages/Index.cshtml +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web.Host/Pages/Index.cshtml @@ -45,11 +45,6 @@ Buy on PACKT -
- - Click here to learn more > - -
diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web/Pages/Index.cshtml b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web/Pages/Index.cshtml index d9bc10a4c7..af2cf31519 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web/Pages/Index.cshtml +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web/Pages/Index.cshtml @@ -45,11 +45,6 @@ Buy on PACKT -
- - Click here to learn more > - -
From 0d1e0f51a0fec1c856dd7500f5829d143aa0ad4e Mon Sep 17 00:00:00 2001 From: Yunus Emre Kalkan Date: Thu, 14 Apr 2022 12:27:50 +0300 Subject: [PATCH 4/7] The Official Guide to THE OFFICIAL GUIDE --- templates/app-nolayers/angular/src/app/home/home.component.html | 2 +- .../Pages/Index.razor | 2 +- .../MyCompanyName.MyProjectName.Blazor.Server/Pages/Index.razor | 2 +- .../MyCompanyName.MyProjectName.Mvc.Mongo/Pages/Index.cshtml | 2 +- .../MyCompanyName.MyProjectName.Mvc/Pages/Index.cshtml | 2 +- templates/app/angular/src/app/home/home.component.html | 2 +- .../Pages/Index.razor | 2 +- .../MyCompanyName.MyProjectName.Blazor.Server/Pages/Index.razor | 2 +- .../src/MyCompanyName.MyProjectName.Blazor/Pages/Index.razor | 2 +- .../src/MyCompanyName.MyProjectName.Web.Host/Pages/Index.cshtml | 2 +- .../src/MyCompanyName.MyProjectName.Web/Pages/Index.cshtml | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/templates/app-nolayers/angular/src/app/home/home.component.html b/templates/app-nolayers/angular/src/app/home/home.component.html index c469a244de..14accbdf36 100644 --- a/templates/app-nolayers/angular/src/app/home/home.component.html +++ b/templates/app-nolayers/angular/src/app/home/home.component.html @@ -18,7 +18,7 @@
- The Official Guide + THE OFFICIAL GUIDE

Mastering ABP Framework

Written by the creator of the ABP Framework, this book will help you gain a complete understanding of the framework and modern web application development techniques.

diff --git a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server.Mongo/Pages/Index.razor b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server.Mongo/Pages/Index.razor index 73b18b975e..dd80683f4c 100644 --- a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server.Mongo/Pages/Index.razor +++ b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server.Mongo/Pages/Index.razor @@ -20,7 +20,7 @@
- The Official Guide + THE OFFICIAL GUIDE

Mastering ABP Framework

Written by the creator of the ABP Framework, this book will help you gain a complete understanding of the framework and modern web application development techniques.

diff --git a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server/Pages/Index.razor b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server/Pages/Index.razor index 73b18b975e..dd80683f4c 100644 --- a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server/Pages/Index.razor +++ b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server/Pages/Index.razor @@ -20,7 +20,7 @@
- The Official Guide + THE OFFICIAL GUIDE

Mastering ABP Framework

Written by the creator of the ABP Framework, this book will help you gain a complete understanding of the framework and modern web application development techniques.

diff --git a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Mvc.Mongo/Pages/Index.cshtml b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Mvc.Mongo/Pages/Index.cshtml index 0054967c73..3ee32d2ac5 100644 --- a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Mvc.Mongo/Pages/Index.cshtml +++ b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Mvc.Mongo/Pages/Index.cshtml @@ -30,7 +30,7 @@
- The Official Guide + THE OFFICIAL GUIDE

Mastering ABP Framework

Written by the creator of the ABP Framework, this book will help you gain a complete understanding of the framework and modern web application development techniques.

diff --git a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Mvc/Pages/Index.cshtml b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Mvc/Pages/Index.cshtml index 0054967c73..3ee32d2ac5 100644 --- a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Mvc/Pages/Index.cshtml +++ b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Mvc/Pages/Index.cshtml @@ -30,7 +30,7 @@
- The Official Guide + THE OFFICIAL GUIDE

Mastering ABP Framework

Written by the creator of the ABP Framework, this book will help you gain a complete understanding of the framework and modern web application development techniques.

diff --git a/templates/app/angular/src/app/home/home.component.html b/templates/app/angular/src/app/home/home.component.html index 0bcef1c166..3d8c3db65d 100644 --- a/templates/app/angular/src/app/home/home.component.html +++ b/templates/app/angular/src/app/home/home.component.html @@ -23,7 +23,7 @@
- The Official Guide + THE OFFICIAL GUIDE

Mastering ABP Framework

Written by the creator of the ABP Framework, this book will help you gain a complete understanding of the framework and modern web application development techniques.

diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.Tiered/Pages/Index.razor b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.Tiered/Pages/Index.razor index cfdfb806f4..063434c52c 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.Tiered/Pages/Index.razor +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.Tiered/Pages/Index.razor @@ -27,7 +27,7 @@
- The Official Guide + THE OFFICIAL GUIDE

Mastering ABP Framework

Written by the creator of the ABP Framework, this book will help you gain a complete understanding of the framework and modern web application development techniques.

diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server/Pages/Index.razor b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server/Pages/Index.razor index e3153e68a7..874098dd6b 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server/Pages/Index.razor +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server/Pages/Index.razor @@ -27,7 +27,7 @@
- The Official Guide + THE OFFICIAL GUIDE

Mastering ABP Framework

Written by the creator of the ABP Framework, this book will help you gain a complete understanding of the framework and modern web application development techniques.

diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/Pages/Index.razor b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/Pages/Index.razor index b27b97109c..bf959ba3d0 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/Pages/Index.razor +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/Pages/Index.razor @@ -29,7 +29,7 @@
- The Official Guide + THE OFFICIAL GUIDE

Mastering ABP Framework

Written by the creator of the ABP Framework, this book will help you gain a complete understanding of the framework and modern web application development techniques.

diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web.Host/Pages/Index.cshtml b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web.Host/Pages/Index.cshtml index 9f888e8e4e..4038fb8df2 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web.Host/Pages/Index.cshtml +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web.Host/Pages/Index.cshtml @@ -34,7 +34,7 @@
- The Official Guide + THE OFFICIAL GUIDE

Mastering ABP Framework

Written by the creator of the ABP Framework, this book will help you gain a complete understanding of the framework and modern web application development techniques.

diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web/Pages/Index.cshtml b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web/Pages/Index.cshtml index af2cf31519..e9fe3eaf88 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web/Pages/Index.cshtml +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web/Pages/Index.cshtml @@ -34,7 +34,7 @@
- The Official Guide + THE OFFICIAL GUIDE

Mastering ABP Framework

Written by the creator of the ABP Framework, this book will help you gain a complete understanding of the framework and modern web application development techniques.

From 02a531fb0bdfd3b2da773e2c77cfcd2f07873e94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Kalkan?= Date: Thu, 14 Apr 2022 12:44:13 +0300 Subject: [PATCH 5/7] Add DBMS option information --- docs/en/Entity-Framework-Core-MySQL.md | 2 ++ docs/en/Entity-Framework-Core-Oracle.md | 2 ++ docs/en/Entity-Framework-Core-Other-DBMS.md | 23 ++++++++++++++++++--- docs/en/Entity-Framework-Core-PostgreSQL.md | 2 ++ docs/en/Entity-Framework-Core-SQLite.md | 2 ++ 5 files changed, 28 insertions(+), 3 deletions(-) diff --git a/docs/en/Entity-Framework-Core-MySQL.md b/docs/en/Entity-Framework-Core-MySQL.md index 37b7cc9d2f..ccfdd89da3 100644 --- a/docs/en/Entity-Framework-Core-MySQL.md +++ b/docs/en/Entity-Framework-Core-MySQL.md @@ -1,5 +1,7 @@ # Switch to EF Core MySQL Provider +> [ABP CLI](CLI.md) and the [Get Started](https://abp.io/get-started) page already provides an option to create a new solution with MySQL. See [that document](Entity-Framework-Core-Other-DBMS.md) to learn how to use. This document provides guidance for who wants to manually switch to MySQL after creating the solution. + This document explains how to switch to the **MySQL** database provider for **[the application startup template](Startup-Templates/Application.md)** which comes with SQL Server provider pre-configured. ## Replace the Volo.Abp.EntityFrameworkCore.SqlServer Package diff --git a/docs/en/Entity-Framework-Core-Oracle.md b/docs/en/Entity-Framework-Core-Oracle.md index 1e340302dc..6e7686c6b0 100644 --- a/docs/en/Entity-Framework-Core-Oracle.md +++ b/docs/en/Entity-Framework-Core-Oracle.md @@ -1,5 +1,7 @@ # Switch to EF Core Oracle Provider +> [ABP CLI](CLI.md) and the [Get Started](https://abp.io/get-started) page already provides an option to create a new solution with Oracle. See [that document](Entity-Framework-Core-Other-DBMS.md) to learn how to use. This document provides guidance for who wants to manually switch to Oracle after creating the solution. + This document explains how to switch to the **Oracle** database provider for **[the application startup template](Startup-Templates/Application.md)** which comes with SQL Server provider pre-configured. ABP Framework provides integrations for two different Oracle packages. See one of the following documents based on your provider decision: diff --git a/docs/en/Entity-Framework-Core-Other-DBMS.md b/docs/en/Entity-Framework-Core-Other-DBMS.md index 9739dbdd02..bb14f2b906 100644 --- a/docs/en/Entity-Framework-Core-Other-DBMS.md +++ b/docs/en/Entity-Framework-Core-Other-DBMS.md @@ -1,15 +1,32 @@ # Switch to Another DBMS for Entity Framework Core -**[The application startup template](Startup-Templates/Application.md)** comes with **SQL Server provider pre-configured** for the Entity Framework Core. However, EF Core supports [many other DBMSs](https://docs.microsoft.com/en-us/ef/core/providers/) and you can use any of them within your ABP based applications. +[ABP CLI](CLI.md) provides a `-dbms` option to allow you to choose your Database Management System (DBMS) while creating a new solution. It accepts the following values: -ABP framework provides **integration packages** for some common DBMSs to make the configuration a bit easier. You can use the following documents to learn how to **switch to your favorite DBMS**: +- `SqlServer` (default) +- `MySQL` +- `SQLite` +- `Oracle` +- `Oracle-Devart` +- `PostgreSQL` + +So, if you want to use MySQL for your solution, you can use the `-dbms MySQL` option while using the `abp new` command. Example: + +````bash +abp new BookStore -dbms MySQL +```` + +Also, the [Get Started page](https://abp.io/get-started) on the ABP website allows you to select one of the providers. + +> **This document provides guidance for who wants to manually change their DBMS after creating the solution.** + +You can use the following documents to learn how to **switch to your favorite DBMS**: * [MySQL](Entity-Framework-Core-MySQL.md) * [PostgreSQL](Entity-Framework-Core-PostgreSQL.md) * [Oracle](Entity-Framework-Core-Oracle.md) * [SQLite](Entity-Framework-Core-SQLite.md) -However, you can configure your DBMS provider **without** these integration packages. While using the integration package is always recommended (it also makes standard for the depended version across different modules), you can do it manually if there is no integration package for your DBMS provider. +You can also configure your DBMS provider **without** these integration packages. While using the integration package is always recommended (it also makes standard for the depended version across different modules), you can do it yourself if there is no integration package for your DBMS provider. For an example, this document explains how to switch to MySQL without using [the MySQL integration package](Entity-Framework-Core-MySQL.md). diff --git a/docs/en/Entity-Framework-Core-PostgreSQL.md b/docs/en/Entity-Framework-Core-PostgreSQL.md index 4ddd3dd22a..9cdaeae34c 100644 --- a/docs/en/Entity-Framework-Core-PostgreSQL.md +++ b/docs/en/Entity-Framework-Core-PostgreSQL.md @@ -1,5 +1,7 @@ # Switch to EF Core PostgreSQL Provider +> [ABP CLI](CLI.md) and the [Get Started](https://abp.io/get-started) page already provides an option to create a new solution with PostgreSQL. See [that document](Entity-Framework-Core-Other-DBMS.md) to learn how to use. This document provides guidance for who wants to manually switch to PostgreSQL after creating the solution. + This document explains how to switch to the **PostgreSQL** database provider for **[the application startup template](Startup-Templates/Application.md)** which comes with SQL Server provider pre-configured. ## Replace the Volo.Abp.EntityFrameworkCore.SqlServer Package diff --git a/docs/en/Entity-Framework-Core-SQLite.md b/docs/en/Entity-Framework-Core-SQLite.md index cbacf3baa5..5015320af1 100644 --- a/docs/en/Entity-Framework-Core-SQLite.md +++ b/docs/en/Entity-Framework-Core-SQLite.md @@ -1,5 +1,7 @@ # Switch to EF Core SQLite Provider +> [ABP CLI](CLI.md) and the [Get Started](https://abp.io/get-started) page already provides an option to create a new solution with SQLite. See [that document](Entity-Framework-Core-Other-DBMS.md) to learn how to use. This document provides guidance for who wants to manually switch to SQLite after creating the solution. + This document explains how to switch to the **SQLite** database provider for **[the application startup template](Startup-Templates/Application.md)** which comes with SQL Server provider pre-configured. ## Replace the Volo.Abp.EntityFrameworkCore.SqlServer Package From 801e0e2685c2ffe1b352b8e7ee0ff8bf895f29b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Kalkan?= Date: Thu, 14 Apr 2022 16:16:06 +0300 Subject: [PATCH 6/7] Added section: Dealing with Unit of Work in Integration Tests --- docs/en/Testing.md | 99 +++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 97 insertions(+), 2 deletions(-) diff --git a/docs/en/Testing.md b/docs/en/Testing.md index 29302f2e35..619aaa2160 100644 --- a/docs/en/Testing.md +++ b/docs/en/Testing.md @@ -423,7 +423,7 @@ namespace MyProject.Issues ## Integration Tests -> You can follow the [web application development tutorial](Tutorials/Part-1.md) to learn developing a full stack application, including the integration tests. +> You can also follow the [web application development tutorial](Tutorials/Part-1.md) to learn developing a full stack application, including the integration tests. ### The Integration Test Infrastructure @@ -442,7 +442,7 @@ Using in-memory SQLite database has two main advantages; ### The Seed Data -Writing tests against an empty database is not practical. In most cases, you need to some initial data in the database. For example, if you write a test class that query, update and delete the Products, it would be helpful to have a few products in the database before executing the test case. +Writing tests against an empty database is not practical. In most cases, you need to some initial data in the database. For example, if you write a test class that query, update and delete the products, it would be helpful to have a few products in the database before executing the test case. ABP's [Data Seeding](Data-Seeding.md) system is a powerful way to seed the initial data. The application startup template has a *YourProject*TestDataSeedContributor class in the `.TestBase` project. You can fill it to have an initial data that you can use for each test method. @@ -649,6 +649,101 @@ namespace MyProject.Issues It's that simple. This test method tests everything, including the application service, EF Core mapping, object to object mapping and the repository implementation. In this way, you can fully test the Application Layer and the Domain Layer of your solution. +### Dealing with Unit of Work in Integration Tests + +ABP's [unit of work](Unit-Of-Work.md) system controls the database connection and transaction management in your application. It seamlessly works while you writing your application code, so you may not aware of it. + +In the ABP Framework, all the database operations must be performed inside a unit of work scope. When you test an [application service](Application-Services.md) method, the unit of work scope will be the scope of your application service method. If you are testing a [repository](Repositories.md) method, the unit of work scope will be the scope of your repository method. + +In some cases, you may need to manually control the unit of work scope. Consider the following test method: + +````csharp +public class IssueRepository_Tests : MyProjectDomainTestBase +{ + private readonly IRepository _issueRepository; + + public IssueRepository_Tests() + { + _issueRepository = GetRequiredService>(); + } + + public async Task Should_Query_By_Title() + { + IQueryable queryable = await _issueRepository.GetQueryableAsync(); + var issue = queryable.FirstOrDefaultAsync(i => i.Title == "My issue title"); + issue.ShouldNotBeNull(); + } +} +```` + +We are using `_issueRepository.GetQueryableAsync` to obtain an `IQueryable` object. Then, we are using the `FirstOrDefaultAsync` method to query an issue by its title. The database query is executed at this point, and you get an exception indicating that there is no active unit of work. + +To make that test properly working, you should manually start a unit of work scope as shown in the following example: + +````csharp +public class IssueRepository_Tests : MyProjectDomainTestBase +{ + private readonly IRepository _issueRepository; + private readonly IUnitOfWorkManager _unitOfWorkManager; + + public IssueRepository_Tests() + { + _issueRepository = GetRequiredService>(); + _unitOfWorkManager = GetRequiredService(); + } + + public async Task Should_Query_By_Title() + { + using (var uow = _unitOfWorkManager.Begin()) + { + IQueryable queryable = await _issueRepository.GetQueryableAsync(); + var issue = queryable.FirstOrDefaultAsync(i => i.Title == "My issue title"); + issue.ShouldNotBeNull(); + await uow.CompleteAsync(); + } + } +} +```` + +We've used the `IUnitOfWorkManager` service to create a unit of work scope, then called the `FirstOrDefaultAsync` method inside that scope, so we don't have the problem anymore. + +> Note that we've tested the `FirstOrDefaultAsync` to demonstrate the unit of work problem. Normally, as a good principle, you should write tests only your own code. + +### Working with DbContext + +In some cases, you may want to directory work with the Entity Framework's `DbContext` object to perform database operations in your test methods. In this case, you can use `IDbContextProvider`service to obtain a `DbContext` instance inside a unit of work. + +The following example shows how you can create a `DbContext` object in a test method: + +````csharp +public class MyDbContext_Tests : MyProjectDomainTestBase +{ + private readonly IDbContextProvider _dbContextProvider; + private readonly IUnitOfWorkManager _unitOfWorkManager; + + public IssueRepository_Tests() + { + _dbContextProvider = GetRequiredService>(); + _unitOfWorkManager = GetRequiredService(); + } + + public async Task Should_Query_By_Title() + { + using (var uow = _unitOfWorkManager.Begin()) + { + var dbContext = await _dbContextProvider.GetDbContextAsync(); + var issue = await dbContext.Issues.FirstOrDefaultAsync(i => i.Title == "My issue title"); + issue.ShouldNotBeNull(); + await uow.CompleteAsync(); + } + } +} +```` + +Just like we've done in the *Dealing with Unit of Work in Integration Tests* section, we should perform `DbContext` operations inside an active unit of work. + +For [MongoDB](MongoDB.md), you can use the `IMongoDbContextProvider` service to obtain a `DbContext` object and directly use MongoDB APIs in your test methods. + ## UI Tests In general, there are two types of UI Tests; From 69b41a2db5ffb194e5976ba49c4b52deec2a7119 Mon Sep 17 00:00:00 2001 From: maliming Date: Thu, 14 Apr 2022 21:20:02 +0800 Subject: [PATCH 7/7] Add `UnitOfWorkExtensions_Tests` Resolve #12260 --- .../Volo/Abp/Uow/UnitOfWorkExtensions.cs | 2 +- .../Abp/Uow/UnitOfWorkExtensions_Tests.cs | 58 +++++++++++++++++++ 2 files changed, 59 insertions(+), 1 deletion(-) create mode 100644 framework/test/Volo.Abp.Uow.Tests/Volo/Abp/Uow/UnitOfWorkExtensions_Tests.cs diff --git a/framework/src/Volo.Abp.Uow/Volo/Abp/Uow/UnitOfWorkExtensions.cs b/framework/src/Volo.Abp.Uow/Volo/Abp/Uow/UnitOfWorkExtensions.cs index 44dc92d9cf..1396cd6ee5 100644 --- a/framework/src/Volo.Abp.Uow/Volo/Abp/Uow/UnitOfWorkExtensions.cs +++ b/framework/src/Volo.Abp.Uow/Volo/Abp/Uow/UnitOfWorkExtensions.cs @@ -34,7 +34,7 @@ public static class UnitOfWorkExtensions { Check.NotNull(unitOfWork, nameof(unitOfWork)); - return unitOfWork.Items.FirstOrDefault(x => x.Key == key).As(); + return unitOfWork.Items.FirstOrDefault(x => x.Key == key).Value.As(); } public static TValue GetOrAddItem([NotNull] this IUnitOfWork unitOfWork, string key, Func factory) diff --git a/framework/test/Volo.Abp.Uow.Tests/Volo/Abp/Uow/UnitOfWorkExtensions_Tests.cs b/framework/test/Volo.Abp.Uow.Tests/Volo/Abp/Uow/UnitOfWorkExtensions_Tests.cs new file mode 100644 index 0000000000..6c88f70d9d --- /dev/null +++ b/framework/test/Volo.Abp.Uow.Tests/Volo/Abp/Uow/UnitOfWorkExtensions_Tests.cs @@ -0,0 +1,58 @@ +using Shouldly; +using Volo.Abp.Testing; +using Xunit; + +namespace Volo.Abp.Uow; + +public class UnitOfWorkExtensions_Tests : AbpIntegratedTest +{ + private readonly IUnitOfWorkManager _unitOfWorkManager; + + public UnitOfWorkExtensions_Tests() + { + _unitOfWorkManager = GetRequiredService(); + } + + [Fact] + public void AddItem() + { + var uow = _unitOfWorkManager.Begin(); + uow.AddItem("testKey", "testValue"); + + uow.Items.ShouldContainKey("testKey"); + uow.Items.ContainsValue("testValue"); + } + + [Fact] + public void GetItemOrDefault() + { + var uow = _unitOfWorkManager.Begin(); + uow.Items.Add("testKey", new NameValue("TestKey","TestValue")); + + uow.GetItemOrDefault("testKey").ShouldBeOfType(); + uow.GetItemOrDefault("testKey").Value.ShouldBe("TestValue"); + } + + [Fact] + public void GetOrAddItem() + { + var uow = _unitOfWorkManager.Begin(); + + var item = uow.GetOrAddItem("testKey", _ => new NameValue("TestKey", "TestValue")); + + item.Name.ShouldBe("TestKey"); + item.ShouldBeOfType(); + item.Value.ShouldBe("TestValue"); + } + + [Fact] + public void RemoveItem() + { + var uow = _unitOfWorkManager.Begin(); + uow.Items.Add("testKey", "testValue"); + + uow.RemoveItem("testKey"); + + uow.Items.ShouldNotContainKey("testKey"); + } +}