27 lines
946 B
C#
27 lines
946 B
C#
using System.Linq;
|
|
using System.Threading.Tasks;
|
|
using _0_Framework.Application;
|
|
using _0_Framework.InfraStructure;
|
|
using Company.Domain.AndroidApkVersionAgg;
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
namespace CompanyManagment.EFCore.Repository;
|
|
|
|
public class AndroidApkVersionRepository:RepositoryBase<long, AndroidApkVersion>,IAndroidApkVersionRepository
|
|
{
|
|
private readonly CompanyContext _companyContext;
|
|
public AndroidApkVersionRepository( CompanyContext companyContext) : base(companyContext)
|
|
{
|
|
_companyContext = companyContext;
|
|
}
|
|
|
|
public IQueryable<AndroidApkVersion> GetActives()
|
|
{
|
|
return _companyContext.AndroidApkVersions.Where(x => x.IsActive == IsActive.True);
|
|
}
|
|
|
|
public async Task<string> GetLatestActiveVersionPath()
|
|
{
|
|
return (await _companyContext.AndroidApkVersions.OrderByDescending(x=>x.CreationDate).FirstOrDefaultAsync(x => x.IsActive == IsActive.True)).Path;
|
|
}
|
|
} |