40 lines
1.2 KiB
C#
40 lines
1.2 KiB
C#
namespace LaaProduction.Cordonel
|
|
{
|
|
using LaaProduction.Cordonel.Data.Interfaces;
|
|
using LaaProduction.Cordonel.Interfaces;
|
|
using LaaProduction.Cordonel.Models;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
public class CSRService : ICSRService
|
|
{
|
|
private readonly ICSRRepository csrRepository;
|
|
|
|
public CSRService(ICSRRepository csr)
|
|
=> this.csrRepository = csr;
|
|
|
|
public CSRModel Add(CSRModel model)
|
|
=> this.csrRepository.Insert(model);
|
|
|
|
public CSRModel Delete(int id)
|
|
=> this.csrRepository.Delete(id);
|
|
|
|
public IEnumerable<CSRModel> Find(CSRSearchModel filter)
|
|
=> this.csrRepository.Find(filter?.WhereQuery());
|
|
|
|
public CSRModel Find(int id)
|
|
=> this.csrRepository.Find(id);
|
|
|
|
public IEnumerable<CordonelRequirementsModel> FindAll()
|
|
=> this.csrRepository.FindAll()
|
|
?? new List<CordonelRequirementsModel>();
|
|
|
|
public CordonelRequirementsModel FindFirstOrDefault(string nr)
|
|
=> this.csrRepository.FindFirstOrDefault(nr)
|
|
?? new CordonelRequirementsModel();
|
|
|
|
public CSRModel Update(CSRModel model)
|
|
=> this.csrRepository.Update(model);
|
|
}
|
|
}
|