public IResult Delete(Model model) { Model result = _modelDal.Get(m => m.ModelId == model.ModelId); _modelDal.Delete(result); return(new SuccessResult(Messages.ModelDeleted)); }
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)); }
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)); }
public IDataResult <Model> GetById(int modelId) { return(new SuccessDataResult <Model>(_modelDal.Get(c => c.Id == modelId), Messages.Listed)); }
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))); }
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); }
public IDataResult <Model> GetById(int id) { return(new SuccessDataResult <Model>(_modelDal.Get(m => m.Id == id), Messages.DataListed)); }