Yc.Box.Types.Participant 1.2.0

dotnet add package Yc.Box.Types.Participant --version 1.2.0
                    
NuGet\Install-Package Yc.Box.Types.Participant -Version 1.2.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Yc.Box.Types.Participant" Version="1.2.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Yc.Box.Types.Participant" Version="1.2.0" />
                    
Directory.Packages.props
<PackageReference Include="Yc.Box.Types.Participant" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Yc.Box.Types.Participant --version 1.2.0
                    
#r "nuget: Yc.Box.Types.Participant, 1.2.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Yc.Box.Types.Participant@1.2.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Yc.Box.Types.Participant&version=1.2.0
                    
Install as a Cake Addin
#tool nuget:?package=Yc.Box.Types.Participant&version=1.2.0
                    
Install as a Cake Tool

Yc.Box.Types.Participant

Библиотека типов для работы с участниками и контактами в проектах YC. Предоставляет перечисления и вспомогательные методы для классификации участников системы, типов контактов и методов связи.

🚀 Возможности

  • Типы участников - Классификация различных типов участников системы
  • Типы контактов - Стандартизированные типы контактной информации
  • Методы связи - Перечисление способов связи с участниками
  • Вспомогательные методы - Удобные методы для работы с типами контактов
  • Типобезопасность - Полная поддержка типизированных перечислений

📦 Установка

dotnet add package Yc.Box.Types.Participant

🔧 Использование

Типы участников

using Yc.Box.Types.Participant.Enums.Participant;

public class ParticipantService
{
    public void ProcessParticipant(YcParticipantType participantType)
    {
        switch (participantType)
        {
            case YcParticipantType.Individual:
                // Обработка физического лица
                break;
            case YcParticipantType.LegalEntity:
                // Обработка юридического лица
                break;
            case YcParticipantType.Organization:
                // Обработка организации
                break;
            case YcParticipantType.Group:
                // Обработка группы
                break;
            case YcParticipantType.System:
                // Обработка системного участника
                break;
        }
    }

    public bool IsIndividual(YcParticipantType participantType)
    {
        return participantType == YcParticipantType.Individual;
    }

    public bool IsLegalEntity(YcParticipantType participantType)
    {
        return participantType == YcParticipantType.LegalEntity;
    }
}

Типы контактов

using Yc.Box.Types.Participant.Enums.Contact;

public class ContactService
{
    public void AddContact(YcContactType contactType, string value)
    {
        switch (contactType)
        {
            case YcContactType.Primary:
                // Добавление основного контакта
                break;
            case YcContactType.Secondary:
                // Добавление дополнительного контакта
                break;
            case YcContactType.Emergency:
                // Добавление контакта для экстренной связи
                break;
            case YcContactType.Work:
                // Добавление рабочего контакта
                break;
            case YcContactType.Personal:
                // Добавление личного контакта
                break;
            case YcContactType.Notification:
                // Добавление контакта для уведомлений
                break;
        }
    }

    public string GetContactDisplayName(YcContactType contactType)
    {
        return contactType.GetDisplayName();
    }

    public bool IsPrimaryContact(YcContactType contactType)
    {
        return contactType.IsPrimary();
    }

    public bool IsWorkContact(YcContactType contactType)
    {
        return contactType.IsWork();
    }

    public bool IsPersonalContact(YcContactType contactType)
    {
        return contactType.IsPersonal();
    }
}

Методы связи

using Yc.Box.Types.Participant.Enums.Contact;

public class CommunicationService
{
    public void SendMessage(YcContactMethod method, string contact, string message)
    {
        switch (method)
        {
            case YcContactMethod.Email:
                SendEmail(contact, message);
                break;
            case YcContactMethod.Phone:
            case YcContactMethod.Mobile:
                SendSms(contact, message);
                break;
            case YcContactMethod.Messenger:
                SendMessengerMessage(contact, message);
                break;
            case YcContactMethod.SocialMedia:
                SendSocialMediaMessage(contact, message);
                break;
            case YcContactMethod.Website:
                // Обработка веб-сайта
                break;
            case YcContactMethod.Fax:
                SendFax(contact, message);
                break;
        }
    }

    public bool IsDigitalMethod(YcContactMethod method)
    {
        return method switch
        {
            YcContactMethod.Email or YcContactMethod.Messenger or 
            YcContactMethod.SocialMedia or YcContactMethod.Website => true,
            _ => false
        };
    }

    public bool IsVoiceMethod(YcContactMethod method)
    {
        return method switch
        {
            YcContactMethod.Phone or YcContactMethod.Mobile => true,
            _ => false
        };
    }
}

Интеграция с моделями

using Yc.Box.Types.Participant.Enums.Contact;
using Yc.Box.Types.Participant.Enums.Participant;

public class Participant
{
    public Guid Id { get; set; }
    public string Name { get; set; }
    public YcParticipantType Type { get; set; }
    public List<Contact> Contacts { get; set; } = new();
}

public class Contact
{
    public Guid Id { get; set; }
    public YcContactType Type { get; set; }
    public YcContactMethod Method { get; set; }
    public string Value { get; set; }
    public bool IsActive { get; set; } = true;
}

public class ParticipantManager
{
    public Contact GetPrimaryContact(Participant participant)
    {
        return participant.Contacts.FirstOrDefault(c => c.Type.IsPrimary());
    }

    public Contact GetEmergencyContact(Participant participant)
    {
        return participant.Contacts.FirstOrDefault(c => c.Type == YcContactType.Emergency);
    }

    public List<Contact> GetWorkContacts(Participant participant)
    {
        return participant.Contacts.Where(c => c.Type.IsWork()).ToList();
    }

    public List<Contact> GetPersonalContacts(Participant participant)
    {
        return participant.Contacts.Where(c => c.Type.IsPersonal()).ToList();
    }
}

📋 Доступные перечисления

YcParticipantType

  • Individual - Физическое лицо
  • LegalEntity - Юридическое лицо
  • Organization - Организация
  • Group - Группа
  • System - Система
  • Other - Другой тип

YcContactType

  • Primary - Основной контакт
  • Secondary - Дополнительный контакт
  • Emergency - Контакт для экстренной связи
  • Work - Рабочий контакт
  • Personal - Личный контакт
  • Notification - Контакт для уведомлений
  • Other - Другой тип контакта

YcContactMethod

  • Email - Электронная почта
  • Phone - Телефон
  • Mobile - Мобильный телефон
  • Fax - Факс
  • Website - Веб-сайт
  • SocialMedia - Социальная сеть
  • Messenger - Мессенджер
  • Other - Другой метод

🔧 Вспомогательные методы

YcContactTypeHelper

  • GetDisplayName() - Получить отображаемое название типа контакта
  • IsPrimary() - Проверить, является ли тип основным
  • IsWork() - Проверить, является ли тип рабочим
  • IsPersonal() - Проверить, является ли тип личным

🏗️ Структура пакета

Yc.Box.Types.Participant/
└── Enums/
    ├── Contact/
    │   ├── YcContactMethod.cs         # Методы связи
    │   ├── YcContactType.cs           # Типы контактов
    │   └── YcContactTypeHelper.cs     # Вспомогательные методы
    └── Participant/
        └── YcParticipantType.cs       # Типы участников

🔒 Совместимость

  • .NET 9.0+
  • Все классы имеют префикс Yc для избежания конфликтов имен

📄 Лицензия

Проект YC Team

🤝 Поддержка

Для вопросов и предложений обращайтесь к команде разработки YC.

📈 Версии

  • 1.0.0 - Первоначальный релиз с типами участников и контактов
  • 1.1.0 - Добавлены вспомогательные методы для типов контактов
  • 1.2.0 - Переименование классов с префиксом Yc
Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net9.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.2.0 222 7/26/2025
1.1.0 238 7/26/2025
1.0.0 231 7/26/2025