Update signature handling and database connection management
- Changed `Signature` properties from `int` to `double` for precise positioning. - Added necessary using directives in `EnvelopeReceiverController.cs` for database operations. - Introduced a private `_cnnStr` field in `EnvelopeReceiverController` to store the connection string. - Updated the constructor to accept `IOptions<ConnectionString>` for dependency injection of the connection string. - Added a SQL command block to handle document element additions using a stored procedure. - Configured the `ConnectionString` class in `Program.cs` to bind the connection string from app settings. - Created a new `ConnectionString` class to manage the connection string value.
This commit is contained in:
@@ -90,6 +90,9 @@ builder.Services.AddSwaggerGen(options =>
|
||||
builder.Services.AddOpenApi();
|
||||
// DbContext
|
||||
var connStr = config.GetConnectionString("Default") ?? throw new InvalidOperationException("There is no default connection string in appsettings.json.");
|
||||
|
||||
builder.Services.Configure<ConnectionString>(cs => cs.Value = connStr);
|
||||
|
||||
builder.Services.AddDbContext<EGDbContext>(options => options.UseSqlServer(connStr));
|
||||
|
||||
builder.Services.AddAuthHubClient(config.GetSection("AuthClientParams"));
|
||||
|
||||
Reference in New Issue
Block a user