public IResult Add(Model model) { var result = _modelDal.GetAll(m => m.ModelName == model.ModelName); if (result.Count != 0) { return(new ErrorResult(Messages.ModelAlreadyExist)); } _modelDal.Add(model); return(new SuccessResult(Messages.AddedModel)); }
public IDataResult <List <Model> > GetAll() { if (DateTime.Now.Hour == 22) { return(new ErrorDataResult <List <Model> >(Messages.MaintenanceTime)); } return(new SuccessDataResult <List <Model> >(_modelDal.GetAll())); }
public IDataResult <List <Model> > GetAll() { var result = _modelDal.GetAll(); if (result.Count > 0) { return(new SuccessDataResult <List <Model> >(result, Messages.ModelsListed)); } return(new ErrorDataResult <List <Model> >(Messages.NoModelToList)); }
public IDataResult <List <Model> > GetAll() { var result = _modelDal.GetAll(); if (result.Count() > 0) { return(new SuccessDataResult <List <Model> >(result)); } return(new ErrorDataResult <List <Model> >(result, ModelMessages.FailedModelListed)); }
private IDataResult <List <Model> > CheckIfModelCountEqualsZero() { var result = _modelDal.GetAll(); if (result.Count == 0) { return(new ErrorDataResult <List <Model> >(Messages.CountEqualsZero)); } return(new SuccessDataResult <List <Model> >(result)); }
public IDataResult <List <Model> > GetAll() { return(new SuccessDataResult <List <Model> >(_modelDal.GetAll(), Messages.Listed)); }
public IDataResult <List <Model> > GetByBrandId(int brandId) { return(new SuccessDataResult <List <Model> >(_modelDal.GetAll(model => model.BrandId == brandId))); }
public IDataResult <IList <Model> > GetAll(Expression <Func <Model, bool> > filter = null) { return(new SuccessDataResult <IList <Model> >(_modelDal.GetAll(filter))); }