Skip to content

Commit

Permalink
Resolved multiple issues (#307)
Browse files Browse the repository at this point in the history
* Update README.md

Updated the comment to make it clear that the command executes the script otherwise it takes some time to figure out the step.

* Resolved the below issues:

1. Updated the System.Data.SqlClient to 4..8.6
2, Kept a placholder for connection string in appsettinngs,json
3. Provided a correc way to get the connection string.
4. Added a property GenerateDocumentationFile, to get the swagger working.
  • Loading branch information
vikramvee committed Apr 14, 2024
1 parent b2b65e9 commit 5018ca9
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 21 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2081,7 +2081,7 @@ List of technologies, frameworks and libraries used for implementation:

- Download and install MS SQL Server Express or other
- Create an empty database using [CreateDatabase_Windows.sql](src/Database/CompanyName.MyMeetings.Database/Scripts/CreateDatabase_Windows.sql) or [CreateDatabase_Linux.sql](src/Database/CompanyName.MyMeetings.Database/Scripts/CreateDatabase_Linux.sql). Script adds **app** schema which is needed for migrations journal table. Change database file path if needed.
- Run database migrations using **MigrateDatabase** NUKE target:
- Run database migrations using **MigrateDatabase** NUKE target by executing the build.sh script present in the root folder:

```shell
.\build MigrateDatabase --DatabaseConnectionString "connection_string"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel>
<UserSecretsId>2b9855d3-f073-44d2-aa45-b15e896794b9</UserSecretsId>
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
Expand Down
10 changes: 5 additions & 5 deletions src/API/CompanyName.MyMeetings.API/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public Startup(IWebHostEnvironment env)
.AddEnvironmentVariables("Meetings_")
.Build();

_loggerForApi.Information("Connection string:" + _configuration[MeetingsConnectionString]);
_loggerForApi.Information("Connection string:" + _configuration.GetConnectionString("MeetingsConnectionString"));

AuthorizationChecker.CheckAllEndpoints();
}
Expand Down Expand Up @@ -146,20 +146,20 @@ private void InitializeModules(ILifetimeScope container)
var emailsConfiguration = new EmailsConfiguration(_configuration["EmailsConfiguration:FromEmail"]);

MeetingsStartup.Initialize(
_configuration[MeetingsConnectionString],
_configuration.GetConnectionString("MeetingsConnectionString"),
executionContextAccessor,
_logger,
emailsConfiguration,
null);

AdministrationStartup.Initialize(
_configuration[MeetingsConnectionString],
_configuration.GetConnectionString("MeetingsConnectionString"),
executionContextAccessor,
_logger,
null);

UserAccessStartup.Initialize(
_configuration[MeetingsConnectionString],
_configuration.GetConnectionString("MeetingsConnectionString"),
executionContextAccessor,
_logger,
emailsConfiguration,
Expand All @@ -168,7 +168,7 @@ private void InitializeModules(ILifetimeScope container)
null);

PaymentsStartup.Initialize(
_configuration[MeetingsConnectionString],
_configuration.GetConnectionString("MeetingsConnectionString"),
executionContextAccessor,
_logger,
emailsConfiguration,
Expand Down
33 changes: 18 additions & 15 deletions src/API/CompanyName.MyMeetings.API/appsettings.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
{
"Logging": {
"LogLevel": {
"Default": "Trace",
"System": "Information",
"Microsoft": "None"
}
"Logging": {
"LogLevel": {
"Default": "Trace",
"System": "Information",
"Microsoft": "None"
}

},
"AllowedHosts": "*",
},
"AllowedHosts": "*",

"EmailsConfiguration": {
"FromEmail": "[email protected]"
},
"Security": {
/* NOTE! This is sensitive data and should be stored in secure way (not here). Added only for demo purpose. */
"TextEncryptionKey": "E546C8DF278CK5990069B522"
}
"EmailsConfiguration": {
"FromEmail": "[email protected]"
},
"Security": {
/* NOTE! This is sensitive data and should be stored in secure way (not here). Added only for demo purpose. */
"TextEncryptionKey": "E546C8DF278CK5990069B522"
},
"ConnectionStrings": {
"MeetingsConnectionString": "YourConnectioString"
}
}

0 comments on commit 5018ca9

Please sign in to comment.