- App Logger entfernt und durch die Implementierung des `ILogger`-Interfaces ersetzt, um eine konsistente Logging-Architektur zu gewährleisten. - API für die Nutzung von NLog konfiguriert, um eine leistungsstarke und flexible Logging-Lösung bereitzustellen. - Konfigurationsdateien und Setup-Anpassungen für die Integration von NLog in die API vorgenommen.
35 lines
1.3 KiB
C#
35 lines
1.3 KiB
C#
using DAL.Models.Entities;
|
|
using DAL.Models.Filters;
|
|
using HRD.WebApi.Repositories;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.Extensions.Logging;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace DAL.Repositories
|
|
{
|
|
public class WindreamInputFolderRepository : BaseRepository<WindreamInputFolder>
|
|
{
|
|
public WindreamInputFolderRepository(WebApiContext context, ILogger<WindreamInputFolderRepository> logger) : base(context, logger)
|
|
{
|
|
}
|
|
|
|
public async Task<List<WindreamInputFolder>> GetListByFilterAsync(WindreamInputFolderFilter filter, bool asNoTracking = true)
|
|
{
|
|
var items = this.RepositoryContext.Set<WindreamInputFolder>().AsQueryable();
|
|
|
|
if (filter.WindreamInputFolderId != null && filter.WindreamInputFolderId != 0)
|
|
{
|
|
items = items.Where(x => x.WindreamInputFolderId == filter.WindreamInputFolderId);
|
|
return asNoTracking ? await items.ToListAsync() : await items.ToListAsync();
|
|
}
|
|
|
|
if (filter.ClientId != null)
|
|
{
|
|
items = items.Where(x => x.ClientId == filter.ClientId);
|
|
}
|
|
return asNoTracking ? await items.AsNoTracking().ToListAsync() : await items.ToListAsync();
|
|
}
|
|
}
|
|
} |