Example #1
0
        public async Task <IDataResult <Brand> > GetByIdAsync(int id)
        {
            var findedBrand = await _brandDal.GetAsync(p => p.Id == id);

            if (findedBrand == null)
            {
                return(new ErrorDataResult <Brand>(null, Messages.BrandNotFound));
            }

            return(new SuccessDataResult <Brand>(findedBrand, Messages.BrandGet));
        }
Example #2
0
 public async Task <IDataResult <Brand> > GetByIdAsync(int id)
 {
     return(new SuccessDataResult <Brand>(await _brandDal.GetAsync(x => x.Id == id)));
 }
Example #3
0
 public async Task <IDataResult <Brand> > Get(string id)
 {
     return(new SuccessDataResult <Brand>(await _brandDal.GetAsync(b => b.Id == id)));
 }