aspnet / WebHooks

[Archived] Libraries to create and consume web hooks on ASP.NET Core. Project moved to https://github.com/aspnet/AspLabs
Apache License 2.0
627 stars 439 forks source link

Custom configuration for SqlStorage #191

Closed Marusyk closed 6 years ago

Marusyk commented 6 years ago

To better integration with existing project it would be great to have a more custom configurations.

For now to store WebHook Registrations in SQL I need connection string in Web.config with name MS_SqlStoreConnectionString

 <add name="MS_SqlStoreConnectionString" connectionString="Data Source=localhost\SQLEXPRESS;Initial Catalog=Platform.Data;Integrated Security=True" providerName="System.Data.SqlClient" />

But I want to store WebHook Registrations in the same database that my application uses, so I already have connection string like:

 <add name="Platfom" connectionString="Data Source=localhost\SQLEXPRESS;Initial Catalog=Platform.Data;Integrated Security=True" providerName="System.Data.SqlClient" />

In this case I need to add two almost the same connection strings (only the name will be different)

Also, according to our sql conventions we shouldn't create a new Schema. I think, it would be nice to have custom configuration for that parameters (maybe the name of table too). And using it like:

config.InitializeCustomWebHooksSqlStorage(encryptData: true, connectionStringName: "Platform", schema: "plt", tableName:"CustomWebHooks");

What do you think about that? If ok, I could prepare a PR.

dougbu commented 6 years ago

The value of adding a new configuration value that only names another configuration value is not clear to me. Do you have any other use cases beyond not copying-and-pasting reused connection strings?

Marusyk commented 6 years ago

Schema name. We need a custom schema name. For some reason, we can not use the name WebHooks (trying to follow our SQL conventions)

Connection string There are a many separate projects and I have to add many almost the same connection strings and manage it (encrypt, etc). It is simpler to manage one string (that I've already done) than add for each project the new one.

Table name It isn't necessary at the moment but I think it will be useful in the future. Let's say I've already have the table with name WebHooks

Why not make it more configurable? I do not see any problems leaving the existing functionality and extend it providing more flexible configuration options

ASP.NET WebHooks is very cool framework that I'm going to use, but we need this configurations.

Thank you in advance

Marusyk commented 6 years ago

@dougbu I'm sorry but I need to know what do you think about it. We need this feature and we with customers still waiting for your response. Can it be added to the next version (maybe with different implementation) or you can advise some other solution how to achieve our requirements? Thanks you in advance

dougbu commented 6 years ago

We've discussed and I will work with you on #192.

dougbu commented 6 years ago

6c173a343f

dougbu commented 6 years ago

Thanks very much @Marusyk ❕

Marusyk commented 6 years ago

Thank you for your time

Marusyk commented 6 years ago

Hello, are there any news about date of the future release?