public IResult Add(IndividualCustomer customer) { var result = _individualCustomerDal.Any(c => c.IdentityNo == customer.IdentityNo); if (result) { return(new ErrorResult(Messages.IndividualCustomer.Exists(customer.FirstName, customer.LastName))); } _individualCustomerDal.Add(customer); return(new SuccessResult(Messages.IndividualCustomer.Add(customer.FirstName, customer.LastName))); }
public IResult Add(IndividualCustomer customer) { //_customerDal.Add(customer); // Aynı individualCustomerDal'ın çalıştığı gibi ÇALIŞIYOR. var result = _individualCustomerDal.Any(c => c.IdentityNo == customer.IdentityNo); if (!result) { _individualCustomerDal.Add(customer); return(new SuccessResult(Messages.IndividualCustomer.Add(customer.FirstName, customer.LastName))); } return(new ErrorResult(Messages.IndividualCustomer.Exists(customer.FirstName, customer.LastName))); }