public IDataResult <Customer> GetByEmail(string email) { var result = _customerDal.Any(c => c.Email == email); if (result) { return(new SuccessDataResult <Customer>(_customerDal.Get(c => c.Email == email))); } return(new ErrorDataResult <Customer>(Messages.NotFound())); }
public IDataResult <Customer> GetById(int userId) { var result = _customerDal.Any(c => c.Id == userId); if (result) { return(new SuccessDataResult <Customer>(_customerDal.Get(c => c.Id == userId))); } return(new ErrorDataResult <Customer>(Messages.NotFound())); }
private IResult CheckIfCustomerExits(int customerId) { var result = _customerDal.Any(x => x.CustomerId == customerId); if (!result) { return(new ErrorResult()); } return(new SuccessResult()); }