19 lines
612 B
C#
19 lines
612 B
C#
using Hcs.WebApp.Data.Hcs;
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
namespace Hcs.WebApp.Services
|
|
{
|
|
public class RegistryService(IDbContextFactory<HcsDbContext> factory)
|
|
{
|
|
private readonly IDbContextFactory<HcsDbContext> factory = factory;
|
|
|
|
public async Task<IEnumerable<Registry>> GetAllRegistriesAsync(bool isCommon)
|
|
{
|
|
using var context = factory.CreateDbContext();
|
|
return await (from registry in context.Registries
|
|
where registry.IsCommon == isCommon
|
|
select registry).ToListAsync();
|
|
}
|
|
}
|
|
}
|