Files
parr_api/PARR.DAL/Services/Implementations/V1/V1_ApplicationService.cs
2023-08-23 15:47:20 +10:00

31 lines
1.0 KiB
C#

using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Logging;
using PARR.DAL.Context;
using PARR.DAL.Models.V1;
using PARR.DAL.Services.Abstracts;
using PARR.DAL.Services.Interfaces.V1;
namespace PARR.DAL.Services.Implementations.V1
{
internal class V1_ApplicationService : BaseService<V1_Application>, V1_IApplicationService
{
private readonly DataContext dataContext;
private readonly ILogger<V1_ApplicationService> logger;
public V1_ApplicationService(DataContext dataContext, ILogger<V1_ApplicationService> logger) : base(logger)
{
this.dataContext = dataContext;
this.logger = logger;
}
protected override DbSet<V1_Application> EntitySet => dataContext.V1_Applications;
protected override DataContext EntitiContext => dataContext;
public async Task<V1_Application?> GetByNameAsync(string appName)
{
return await EntitySet.FirstOrDefaultAsync(t => t.Name.ToLower() == appName.Trim().ToLower());
}
}
}