using System.Reflection; using Core.Interfaces; using Domain.Entities; using Models.Helpers; using Models.Interfaces; using Models.Models; namespace Core.Services { public class CustomerService: ICustomerDom { #region Declaraciones y Constructor private readonly IPhSCustomerRepository _repository; public CustomerService(IPhSCustomerRepository customerRepository) { _repository = customerRepository ?? throw new ArgumentNullException(nameof(customerRepository)); } #endregion public Task AddAsync(ECustomer entity) { throw new NotImplementedException(); } public Task DeleteAsync(int id) { throw new NotImplementedException(); } public async Task> GetAllAsync() { try { return await _repository.GetAllAsync(); } catch (Exception ex) { var methodName = MethodBase.GetCurrentMethod()?.Name ?? "UnknownMethod"; throw new Exception($"{methodName} Message: {ex.Message}", ex); } } public Task GetByIdAsync(int id) { throw new NotImplementedException(); } public async Task> SearchAsync(string? name, string? email, string? document) { try { return await _repository.SearchAsync(name, email, document); } catch (Exception ex) { var methodName = MethodBase.GetCurrentMethod()?.Name ?? "UnknownMethod"; throw new Exception($"{methodName} Message: {ex.Message}", ex); } } public Task UpdateAsync(ECustomer entity) { throw new NotImplementedException(); } } }