You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Ombi/src/Ombi.Store/Repository/ApplicationConfigRepository.cs

27 lines
786 B

using System.Linq;
using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore;
using Ombi.Store.Context;
using Ombi.Store.Entities;
namespace Ombi.Store.Repository
{
public class ApplicationConfigRepository : IApplicationConfigRepository
{
public ApplicationConfigRepository(SettingsContext ctx)
{
Ctx = ctx;
}
private SettingsContext Ctx { get; }
public Task<ApplicationConfiguration> GetAsync(ConfigurationTypes type)
{
return Ctx.ApplicationConfigurations.FirstOrDefaultAsync(x => x.Type == type);
}
public ApplicationConfiguration Get(ConfigurationTypes type)
{
return Ctx.ApplicationConfigurations.FirstOrDefault(x => x.Type == type);
}
}
}