Initial commit carried over from private repo. This is V2.
All checks were successful
Build and Push Docker Image / build (push) Successful in 1m3s
Build and Push Docker Image / docker (push) Successful in 43s

This commit is contained in:
2025-07-04 21:24:12 +02:00
parent 7715816029
commit 4393977389
96 changed files with 3223 additions and 0 deletions

View File

@ -0,0 +1,25 @@
using MessengerApi.Configuration.Model.Persistence;
using MessengerApi.Configuration.Model.Persistence.Base;
using MessengerApi.Configuration.Sources.Environment;
namespace MessengerApi.Configuration.Parsers
{
public static class EnvironmentPersistenceConfigurationParser
{
public static PersistenceConfiguration Parse(IEnvironmentConfigurationSource config)
{
var type = PersistenceTypeParser.Parse(config.GetValue<string>(Constants.EnvironmentVariables.PERSISTENCE_TYPE));
if(type == Enums.PersistenceTypes.Sql)
{
return new SqlPersistenceConfiguration(config);
}
else if(type == Enums.PersistenceTypes.PostgreSql)
{
return new NpgPersistenceConfiguration(config);
}
throw new InvalidOperationException("Unrecognized persistence type.");
}
}
}