Add houses page
This commit is contained in:
14
Hcs.WebApp/Services/HouseService.cs
Normal file
14
Hcs.WebApp/Services/HouseService.cs
Normal file
@ -0,0 +1,14 @@
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user