Exemplo n.º 1
0
        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()));
        }
Exemplo n.º 2
0
        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()));
        }
Exemplo n.º 3
0
        private IResult CheckIfCustomerExits(int customerId)
        {
            var result = _customerDal.Any(x => x.CustomerId == customerId);

            if (!result)
            {
                return(new ErrorResult());
            }
            return(new SuccessResult());
        }