@ -1,19 +1,18 @@
using System.Collections.Immutable ;
using System.Collections.Immutable ;
using Microsoft.Extensions.Configuration ;
namespace Connected.Configuration
namespace Connected.Configuration
{
{
internal class DatabaseConfiguration : IDatabaseConfiguration
internal class DatabaseConfiguration : IDatabaseConfiguration
{
{
private List < string > _shards ;
private readonly List < string > _shards ;
public DatabaseConfiguration ( )
public DatabaseConfiguration ( IConfiguration configuration )
{
{
/ *
DefaultConnectionString = "" ;
* TODO : read from config
* /
DefaultConnectionString = "server=PIT-ZBOOK\\sqlexpress; database=connected; trusted_connection=true;TrustServerCertificate=True;multiple active result sets=true" ;
_shards = new ( ) ;
_shards = new ( ) ;
configuration . Bind ( this ) ;
configuration . Bind ( "shards" , _shards ) ;
}
}
public string? DefaultConnectionString { get ; init ; }
public string? DefaultConnectionString { get ; init ; }