using Hcs.WebApp.Data.Hcs;
using Microsoft.EntityFrameworkCore;

namespace Hcs.WebApp.Services
{
    public class HouseService(IDbContextFactory<HcsDbContext> factory) : HcsServiceBase(factory)
    {
        public async Task<IEnumerable<House>> GetAllHousesAsync()
        {
            using var context = GetNewContext();
            return await context.Houses.ToListAsync();
        }
    }
}
