using Library.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Supabase;

namespace Library
{
    public interface IGenderService
    {
        Task<List<Gender>> GetAllGendersAsync();
    }
    public class GenderService : IGenderService
    {
        private readonly Client _client;

        public GenderService(Client client)
        {
            _client = client;
        }

        public async Task<List<Gender>> GetAllGendersAsync()
        {
            var response = await _client.From<Gender>().Get();
            if (response != null && response.Models != null)
            {
                return response.Models; // Возвращаем модели
            }

            return new List<Gender>();
        }
    }
}
