public IResult DeleteById(int modelId) { var result = _modelDal.Get(model => model.Id == modelId); _modelDal.Delete(result); return(new SuccessResult()); }
public IResult Delete(Model model) { Model result = _modelDal.Get(m => m.ModelId == model.ModelId); _modelDal.Delete(result); return(new SuccessResult(Messages.ModelDeleted)); }
public int DeleteModel(int Id) { _modelDal.Delete(new Model { Id = Id }); return(Id); }
public IResult Delete(Model model) { if (DateTime.Now.Hour == 22) { return(new ErrorResult(Messages.MaintenanceTime)); } _modelDal.Delete(model); return(new SuccessResult()); }
//[SecuredOperation("model.delete, admin")] public IResult Delete(Model model) { if (model != null) { _modelDal.Delete(model); return(new SuccessResult(ModelMessages.ModelDeleted)); } return(new ErrorResult(ModelMessages.FailedModelDeleted)); }
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 IResult Delete(Model model) { _modelDal.Delete(_modelDal.Get(c => c.Id == model.Id)); return(new SuccessResult(Messages.Deleted)); }
public IResult Delete(Model model) { _modelDal.Delete(model); return(new SuccessResult(Messages.Model + Messages.Deleted)); }
public IResult Delete(Model model) { _modelDal.Delete(model); return(new SuccessResult()); }
public IResult Delete(Model model) { _modelDal.Delete(model); return(new SuccessDataResult <Model>(Messages.DataDeleted)); }