Beispiel #1
0
        public IResult Delete(Model model)
        {
            Model result = _modelDal.Get(m => m.ModelId == model.ModelId);

            _modelDal.Delete(result);
            return(new SuccessResult(Messages.ModelDeleted));
        }
Beispiel #2
0
        public IResult Delete(Model model)
        {
            var modelToDelete = _modelDal.Get(m => m.ModelId == model.ModelId);

            if (modelToDelete.ModelId > 0)
            {
                return(new SuccessResult(Messages.ModelDeleted));
            }
            return(new ErrorResult(Messages.ModelNotFound));
        }
Beispiel #3
0
        public IResult Delete(int modelId)
        {
            var result = BusinessRules.Run(CheckModelIdExist(modelId));

            if (result != null)
            {
                return(result);
            }

            var deletedColor = _modelDal.Get(c => c.Id == modelId);

            _modelDal.Delete(deletedColor);

            return(new SuccessResult(Messages.Deleted));
        }
        public IDataResult <Model> GetById(int modelId)
        {
            var result = _modelDal.Get(b => b.ModelId == modelId);

            if (result != null)
            {
                return(new SuccessDataResult <Model>(result));
            }
            return(new ErrorDataResult <Model>(result, ModelMessages.FailedModelById));
        }
Beispiel #5
0
 public IDataResult <Model> GetById(int modelId)
 {
     return(new SuccessDataResult <Model>(_modelDal.Get(c => c.Id == modelId), Messages.Listed));
 }
Beispiel #6
0
 public IDataResult <Model> Get(int modelId)
 {
     return(new SuccessDataResult <Model>(_modelDal.Get(m => m.ModelId == modelId)));
 }
 public IDataResult <Model> GetByModelId(int modelId)
 {
     return(new SuccessDataResult <Model>(_modelDal.Get(fil => fil.Id == modelId)));
 }
Beispiel #8
0
 public IDataResult <Model> Get(Expression <Func <Model, bool> > filter)
 {
     return(new SuccessDataResult <Model>(_modelDal.Get(filter)));
 }
        public Model GetModelById(int Id)
        {
            var result = _modelDal.Get(x => x.Id == Id);

            return(result);
        }
Beispiel #10
0
 public IDataResult <Model> GetById(int id)
 {
     return(new SuccessDataResult <Model>(_modelDal.Get(m => m.Id == id), Messages.DataListed));
 }