refactor: Projektdateien migriert. Cloud-NuGet-Pakete durch lokale NuGet-Projekte ersetzt.
This commit is contained in:
34
DAL/Repositories/DepartmentRepository.cs
Normal file
34
DAL/Repositories/DepartmentRepository.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
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 DepartmentRepository : BaseRepository<Department>
|
||||
{
|
||||
public DepartmentRepository() : base(new WebApiContext())
|
||||
{
|
||||
}
|
||||
|
||||
public async Task<List<Department>> GetDepartmentListAsync(DepartmentFullFilter filter, bool asNoTracking = true)
|
||||
{
|
||||
var items = this.RepositoryContext.Set<Department>().AsQueryable();
|
||||
|
||||
if (!string.IsNullOrEmpty(filter.DepartmentName))
|
||||
{
|
||||
items = items.Where(x => EF.Functions.Like(x.DepartmentName, $"%{filter.DepartmentName}%"));
|
||||
}
|
||||
|
||||
return asNoTracking ? await items.AsNoTracking().ToListAsync() : await items.ToListAsync();
|
||||
}
|
||||
|
||||
public async Task<bool> ReplaceWindreamTiles(int srcDepartmentId, string trgDepartmentIds)
|
||||
{
|
||||
return await ExecStoredProcedureAsync("webapi.sp_TransferWindreamSettings", $"{srcDepartmentId}, null, \"{trgDepartmentIds}\"");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user