Files
Wino-Mail/Wino.Mail/Services/ProviderService.cs

35 lines
1.1 KiB
C#
Raw Permalink Normal View History

2024-04-18 01:44:37 +02:00
using System.Collections.Generic;
using System.Linq;
using Wino.Core.Domain.Enums;
using Wino.Core.Domain.Interfaces;
using Wino.Core.Domain.Models.Accounts;
2025-02-16 11:54:23 +01:00
namespace Wino.Mail.Services;
/// <summary>
/// Service that is returning available provider details.
/// </summary>
public class ProviderService : IProviderService
2024-04-18 01:44:37 +02:00
{
2025-02-16 11:54:23 +01:00
public IProviderDetail GetProviderDetail(MailProviderType type)
2024-04-18 01:44:37 +02:00
{
2025-02-16 11:54:23 +01:00
var details = GetAvailableProviders();
2024-04-18 01:44:37 +02:00
2025-02-16 11:54:23 +01:00
return details.FirstOrDefault(a => a.Type == type);
}
2024-04-18 01:44:37 +02:00
2025-02-16 11:54:23 +01:00
public List<IProviderDetail> GetAvailableProviders()
{
var providerList = new List<IProviderDetail>
2024-04-18 01:44:37 +02:00
{
2025-02-16 11:54:23 +01:00
new ProviderDetail(MailProviderType.Outlook, SpecialImapProvider.None),
new ProviderDetail(MailProviderType.Gmail, SpecialImapProvider.None),
new ProviderDetail(MailProviderType.IMAP4, SpecialImapProvider.iCloud),
new ProviderDetail(MailProviderType.IMAP4, SpecialImapProvider.Yahoo),
new ProviderDetail(MailProviderType.IMAP4, SpecialImapProvider.None)
};
2024-04-18 01:44:37 +02:00
2025-02-16 11:54:23 +01:00
return providerList;
2024-04-18 01:44:37 +02:00
}
}