Skip to content

Commit 6912f30

Browse files
committed
chore: Update image source in introduction/exploring-docs/index.md
1 parent 485aeb0 commit 6912f30

File tree

8 files changed

+215
-15
lines changed

8 files changed

+215
-15
lines changed

content/en/dotnet-templates/general/development-environment.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "Development Environment"
33
description: "Setting up the Development Environment for the Genocs .NET Templates"
4-
lead: "Let's get started with setting up the Development Environment for Genocs .NET Templates!"
4+
lead: "Let's get started with setting up the Development Environment"
55
date: 2023-05-13T15:51:03+02:00
66
lastmod: 2024-08-21 14:50:50+02:00
77
draft: false
@@ -16,7 +16,7 @@ toc: true
1616
---
1717
Genocs Library's **.NET Templates** needs you to have the following *applications/tools* available on your machine.
1818

19-
Please Note that this project is being built on a Windows 11 Machine using Visual Studio Code IDE.
19+
Please Note that this project is being built on a Windows11 Machine using Visual Studio Code IDE.
2020

2121
## .NET SDK
2222

@@ -51,10 +51,7 @@ Genocs Library's .NET Microservice Template gives you the freedom to choose betw
5151

5252
{{< alert text="Make sure that you have at least one of these servers installed, along with a Database Management tool like Azure Data Studio / PostgreSQL pgAdmin / MySQL Workbench " />}}
5353

54-
### PostgreSQL
5554

56-
Probably the best Open Source Database Server with lots of Enterprise level features.
57-
- Download postgresql Installer - [Get from postgresql.org](https://www.postgresql.org/download/)
5855

5956
### MSSQL
6057

@@ -73,6 +70,11 @@ There are high chances that you already have this installed on your machine. Thi
7370

7471
- [Download](https://www.oracle.com/in/database/technologies/oracle19c-windows-downloads.html)
7572

73+
### PostgreSQL
74+
75+
Probably the best Open Source Database Server with lots of Enterprise level features.
76+
- Download postgresql Installer - [Get from postgresql.org](https://www.postgresql.org/download/)
77+
7678
## API Testing Tools
7779

7880
### POSTMAN
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
---
2+
title: "How to use NSwag with Genocs Microservice Template"
3+
description: "Using NSwag with Genocs Microservice Template"
4+
lead: "Let's get started with using NSwag with Genocs Microservice Template"
5+
date: 2024-10-07T16:14:00+02:00
6+
lastmod: 2024-10-07T16:14:00+02:00
7+
draft: false
8+
images: []
9+
menu:
10+
dotnet-templates:
11+
identifier: "nswag"
12+
name: "NSwag"
13+
parent: "tutorials"
14+
weight: 12
15+
toc: true
16+
---
17+
18+
Genocs Library's Blazor Template leverege the NSwag capabilities. This means that you can easily generate API Clients ease. This tutorial will guide you through the process of using NSwag with Genocs Library's Web API.
19+
20+
21+
## Prerequisites
22+
23+
The template contains a script that will automatically generate the necessary files for you. However, you need to have the following components installed on your machine:
24+
25+
```ps
26+
# Install the NSwag Build *Mandatory*
27+
dotnet tool install -g NSwag.MSBuild
28+
29+
# Install the NSwag CLI *Optional*
30+
dotnet tool install -g NSwag.Console
31+
32+
# Install the NSwag Code Generation *Optional*
33+
dotnet tool install -g NSwag.CodeGeneration
34+
```
35+
36+
37+
Into the `scripts` folder you will find `nswag-regen.ps1`. This script will generate the necessary files for you. You can run the script by executing the following command:
38+
39+
Before run be shure the API is running, you can run the API by executing the following command:
40+
41+
```ps
42+
# Run your API locally
43+
dotnet run --project .\src\Genocs.MicroserviceTemplate.Api\Genocs.MicroserviceTemplate.Api.csproj
44+
```
45+
46+
then run the script:
47+
```ps
48+
.\scripts\nswag-regen.ps1
49+
```
50+
51+
The script will generate the necessary `src\Infrastructure\ApiClient\GNXApi.cs` file for you..

content/en/dotnet-templates/tutorials/database-migrations/index.md

Lines changed: 99 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "Genocs Microservice Template along with Entity Framework Core"
3-
description: "Adding Database Migrations for Entity Framework Core with Genocs Library's Web API"
4-
lead: "Adding Database Migrations for Entity Framework Core with Genocs Library's Web API"
3+
description: "Adding Database Migrations for Entity Framework Core"
4+
lead: "Adding Database Migrations for Entity Framework Core"
55
date: 2022-01-15T21:31:40+05:30
66
lastmod: 2024-08-21 14:50:50+02:00
77
draft: false
@@ -23,7 +23,13 @@ Before you begin, make sure you have the following installed on your machine:
2323

2424
1. [.NET 8.0 SDK](https://dotnet.microsoft.com/download/dotnet/8.0)
2525
2. [Visual Studio Code](https://code.visualstudio.com/) or [Visual Studio 2019](https://visualstudio.microsoft.com/downloads/)
26-
3. [MySQL Server](https://dev.mysql.com/downloads/mysql/) or [MSSQL Server](https://www.microsoft.com/en-us/sql-server/sql-server-downloads) or [PostgreSQL Server](https://www.postgresql.org/download/) or [Oracle Server](https://www.oracle.com/database/technologies/)
26+
3. Database Server:
27+
28+
1. [MSSQL Server](https://www.microsoft.com/en-us/sql-server/sql-server-downloads)
29+
2. [MySQL Server](https://dev.mysql.com/downloads/mysql/)
30+
3. [Oracle Server](https://www.oracle.com/database/technologies/)
31+
4. [PostgreSQL Server](https://www.postgresql.org/download/)
32+
5. [SQLite Server](https://www.sqlite.org/download.html)
2733

2834

2935
## Create Database Migrations
@@ -62,7 +68,7 @@ Note that currently, Genocs Microservice Template supports the following major D
6268
4. PostgreSQL
6369
5. SQLite
6470

65-
Download links to setup the supported Database providers are mentioned here - https://genocs-blog.netlify.app/dotnet-templates/general/development-environment/
71+
Here you can find everything to setup the supported Database providers - [Setup Databases](https://genocs-blog.netlify.app/dotnet-templates/general/development-environment/)
6672

6773
To maintain scalability, the database migrations of each of these DB Providers are kept in separate class library projects namely
6874
1. Migrators/Migrators.MSSQL
@@ -74,6 +80,7 @@ To maintain scalability, the database migrations of each of these DB Providers a
7480
Out of the box, the default migrations are already generated and is made available for you. This means you wouldn't even have to run a `update-database` to get started. The Application startup already handles it for you.
7581
7682
As of now, Genocs Library's Microservice Template consists of the following EF Core DB Context classes:
83+
7784
1. **ApplicationDbContext** - This is where you would ideally reference your new entities. By default, Catalog entities are referenced here.
7885
2. **TenantDbContext** - Related to Finbuckle's Multitenancy setup of Stores.
7986
@@ -91,16 +98,69 @@ Below are some sample configurations for MySQL Provider. The above is applicable
9198
9299
#### database.json
93100
101+
**mssql**
102+
``` json
103+
{
104+
"DatabaseSettings": {
105+
"DBProvider": "mssql",
106+
"ConnectionString": "Data Source=(localdb)\\mssqllocaldb;Initial Catalog=Genocs.Microservice.Template;Integrated Security=True;MultipleActiveResultSets=True"
107+
}
108+
}
109+
```
110+
111+
**mysql**
94112
``` json
95113
{
96-
"DatabaseSettings": {
114+
"DatabaseSettings": {
97115
"DBProvider": "mysql",
98116
"ConnectionString": "server=localhost;uid=root;pwd=root;database=defaultRootDb;Allow User Variables=True"
99117
}
100118
}
101119
```
120+
121+
**oracle**
122+
``` json
123+
{
124+
"DatabaseSettings": {
125+
"DBProvider": "oracle",
126+
"ConnectionString": "Data Source=localhost;User Id=system;Password=oracle;"
127+
}
128+
}
129+
```
130+
131+
**postgresql**
132+
``` json
133+
{
134+
"DatabaseSettings": {
135+
"DBProvider": "postgresql",
136+
"ConnectionString": "Host=localhost;Port=5432;Database=Genocs.Microservice.Template;Username=postgres;Password=postgres"
137+
}
138+
}
139+
```
140+
141+
**sqlite**
142+
``` json
143+
{
144+
"DatabaseSettings": {
145+
"DBProvider": "sqlite",
146+
"ConnectionString": "Data Source=app.db;"
147+
}
148+
}
149+
```
150+
102151
#### hangfire.json
103152
153+
**mssql**
154+
``` json
155+
{
156+
"Storage": {
157+
"StorageProvider": "mssql",
158+
"ConnectionString": "Data Source=(localdb)\\mssqllocaldb;Initial Catalog=Genocs.Microservice.Template;Integrated Security=True;MultipleActiveResultSets=True"
159+
}
160+
}
161+
```
162+
163+
**mysql**
104164
``` json
105165
{
106166
"Storage": {
@@ -110,6 +170,37 @@ Below are some sample configurations for MySQL Provider. The above is applicable
110170
}
111171
```
112172
173+
**oracle**
174+
``` json
175+
{
176+
"Storage": {
177+
"StorageProvider": "oracle",
178+
"ConnectionString": "Data Source=localhost;User Id=system;Password=oracle;"
179+
}
180+
}
181+
182+
```
183+
184+
**postgresql**
185+
``` json
186+
{
187+
"Storage": {
188+
"StorageProvider": "postgresql",
189+
"ConnectionString": "Host=localhost;Port=5432;Database=Genocs.Microservice.Template;Username=postgres;Password=postgres"
190+
}
191+
}
192+
```
193+
194+
**sqlite**
195+
``` json
196+
{
197+
"Storage": {
198+
"StorageProvider": "sqlite",
199+
"ConnectionString": "Data Source=app.db;"
200+
}
201+
}
202+
```
203+
113204
The Provider values for other supported DBs are as follows.
114205
- MSSQL - **mssql**
115206
- MYSQL - **mssql**
@@ -153,6 +244,8 @@ dotnet ef migrations add AddedMenuEntity --project ../Migrators/Migrators.MySQL/
153244
dotnet ef migrations add ModifiedTenantTable --project ../Migrators/Migrators.MySQL/ --context TenantDbContext -o Migrations/Tenant
154245
```
155246
156-
That's almost it. Once the process is completed you would be able see new Migration cs files that represent your new additions / modifications at the table level added to the respective Migrator project.
247+
That's almost it.
248+
249+
Once the process is completed you would be able see new Migration cs files that represent your new `additions/modifications` at the table level added to the respective Migrator project.
157250

158251
You do not have to do anything extra to apply the migrations to your database. The application does it for you during the startup.

content/en/introduction/contributing/index.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: "Contributing"
33
description: "Contributing to Genocs Library"
44
lead: "Contributing to Genocs Library"
55
date: 2023-05-13T15:40:19+02:00
6-
lastmod: 2023-06-25T15:40:19+02:00
6+
lastmod: 2024-10-07T16:40:19+02:00
77
draft: false
88
images: []
99
menu:
@@ -25,8 +25,8 @@ Currently, you can contribute to:
2525
- [Deployments](https://github.com/Genocs/enterprise-containers)
2626
- [Example](https://github.com/Genocs/genocs-basket)
2727

28-
- [.NET Web API Template](https://github.com/Genocs/dotnet-webapi-template) (soon)
29-
- [Blazor WebAssembly Template](https://github.com/Genocs/blazor-template) (soon)
28+
- [.NET Web API Template](https://github.com/Genocs/microservice-template)
29+
- [Blazor WebAssembly Template](https://github.com/Genocs/blazor-template)
3030
- [Angular Front-End](https://github.com/Genocs/angular-frontend-template) (soon)
3131
- [React Front-End](https://github.com/Genocs/react-frontend-template) (soon)
3232

149 KB
Loading
-138 KB
Binary file not shown.

content/en/introduction/exploring-docs/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ toc: true
1717

1818
<b>Genocs Library</b> sports a pretty much straight forward documentation website that is frequently updated and also accepts new documentations/corrections from the community!
1919

20-
{{< img src="docs.png" >}}
20+
{{< img src="2024-10-07.png" >}}

content/en/library/messaging/index.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,57 @@ menu:
1414
weight: 7
1515
toc: true
1616
---
17+
18+
19+
This code snippet is used to send an email using SendGrid. The code snippet is written in C# and uses the SendGrid NuGet package. The code snippet is used to send an email to multiple recipients. The code snippet is written in C# and uses the SendGrid NuGet package. The code snippet is used to send an email to multiple recipients.
20+
21+
```csharp
22+
23+
private async Task InternalSend(string subject, string content)
24+
{
25+
try
26+
{
27+
var client = new SendGridClient(_settings.ApiKey);
28+
var from = new EmailAddress(_settings.Email);
29+
var plainTextContent = "This email is generated by the system. Please do not respond on this account";
30+
31+
var recipients = _settings.Recipients.Split(",");
32+
if (recipients.Length == 1)
33+
{
34+
var to = new EmailAddress(_settings.Recipients);
35+
var msg = MailHelper.CreateSingleEmail(from,
36+
to,
37+
subject,
38+
plainTextContent,
39+
content);
40+
var response = await client.SendEmailAsync(msg);
41+
var res = response.IsSuccessStatusCode;
42+
}
43+
else
44+
{
45+
var recipientsAddress = new List<EmailAddress>();
46+
foreach (string recipient in recipients)
47+
{
48+
if (!string.IsNullOrWhiteSpace(recipient))
49+
{
50+
recipientsAddress.Add(new EmailAddress(recipient.Trim()));
51+
}
52+
}
53+
54+
var to = new EmailAddress(_settings.Recipients);
55+
var msg = MailHelper.CreateSingleEmailToMultipleRecipients(from,
56+
recipientsAddress,
57+
subject,
58+
plainTextContent,
59+
content);
60+
61+
var response = await client.SendEmailAsync(msg);
62+
var res = response.IsSuccessStatusCode;
63+
}
64+
}
65+
catch (System.Exception ex)
66+
{
67+
_logger.LogError("Error on Send Email", ex);
68+
}
69+
}
70+
```

0 commit comments

Comments
 (0)