mirror of
https://github.com/ckaczor/FeedCenter.git
synced 2026-02-16 18:47:28 -05:00
Start cleaning up account types
This commit is contained in:
16
Application/Accounts/AccountReaderFactory.cs
Normal file
16
Application/Accounts/AccountReaderFactory.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using System;
|
||||
|
||||
namespace FeedCenter.Accounts;
|
||||
|
||||
internal static class AccountReaderFactory
|
||||
{
|
||||
internal static IAccountReader CreateAccountReader(Account account) =>
|
||||
account.Type switch
|
||||
{
|
||||
AccountType.Miniflux => new MinifluxReader(account),
|
||||
AccountType.Local => new LocalReader(account),
|
||||
AccountType.Fever => new FeverReader(account),
|
||||
AccountType.GoogleReader => new GoogleReaderReader(account),
|
||||
_ => throw new NotSupportedException($"Account type '{account.Type}' is not supported."),
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user