refactor: Projektdateien migriert. Cloud-NuGet-Pakete durch lokale NuGet-Projekte ersetzt.
This commit is contained in:
29
DAL/Repositories/EmployeeToAttributeRepository.cs
Normal file
29
DAL/Repositories/EmployeeToAttributeRepository.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
using DAL.Models.Entities;
|
||||
using DAL.Models.Filters;
|
||||
using HRD.WebApi.Repositories;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace DAL.Repositories
|
||||
{
|
||||
public class EmployeeToAttributeRepository : BaseRepository<EmployeeToAttribute>
|
||||
{
|
||||
public EmployeeToAttributeRepository() : base(new WebApiContext())
|
||||
{
|
||||
}
|
||||
|
||||
public async Task<List<EmployeeToAttribute>> GetListByFilterAsync(EmployeeFilter filter, bool asNoTracking = true)
|
||||
{
|
||||
var items = this.RepositoryContext.Set<EmployeeToAttribute>().AsQueryable();
|
||||
|
||||
if (filter.EmployeeId != null && filter.EmployeeId != 0)
|
||||
{
|
||||
items = items.Where(x => x.EmployeeId == filter.EmployeeId);
|
||||
}
|
||||
|
||||
return asNoTracking ? await items.AsNoTracking().ToListAsync() : await items.ToListAsync();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user