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_IApplicationService { private readonly DataContext dataContext; private readonly ILogger logger; public V1_ApplicationService(DataContext dataContext, ILogger logger) : base(logger) { this.dataContext = dataContext; this.logger = logger; } protected override DbSet EntitySet => dataContext.V1_Applications; protected override DataContext EntitiContext => dataContext; public async Task GetByNameAsync(string appName) { return await EntitySet.FirstOrDefaultAsync(t => t.Name.ToLower() == appName.Trim().ToLower()); } } }