We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7e7e4eb commit b1eeaecCopy full SHA for b1eeaec
1 file changed
MailerQ/MessageStore/MessageStorage.cs
@@ -38,15 +38,12 @@ public MessageStorage(IOptions<MailerQConfiguration> options)
38
39
private IMessageStorage CreateConcretStorage(StorageEngines storageEngine, string uri)
40
{
41
- switch (storageEngine)
+ return storageEngine switch
42
43
- case StorageEngines.MongoDB:
44
- return new MongoDBMessageStorage(uri);
45
- case StorageEngines.S3:
46
- return new S3MessageStorage(uri);
47
- default:
48
- throw new NotImplementedException($"{storageEngine} message storage engine is not implement yet.");
49
- }
+ StorageEngines.MongoDB => new MongoDBMessageStorage(uri),
+ StorageEngines.S3 => new S3MessageStorage(uri),
+ _ => throw new NotImplementedException($"{storageEngine} message storage engine is not implement yet."),
+ };
50
}
51
52
/// <inheritdoc/>
0 commit comments