public IResult Update(Model model) { Model result = _modelDal.Get(m => m.ModelId == model.ModelId); _modelDal.Update(result); return(new SuccessResult(Messages.ModelUpdated)); }
public IResult Update(Model model) { var modelToUpdate = _modelDal.Get(m => m.ModelId == model.ModelId); modelToUpdate.BrandId = model.BrandId; modelToUpdate.ModelName = model.ModelName; _modelDal.Update(modelToUpdate); return(new SuccessResult(Messages.ModelUpdated)); }
public IResult Update(Model model) { if (DateTime.Now.Hour == 22) { return(new ErrorResult(Messages.MaintenanceTime)); } else if (model.Name.Length < 2) { return(new ErrorResult(Messages.ModelNameInvalid)); } _modelDal.Update(model); return(new SuccessResult(Messages.ModelUpdated)); }
public IResult Update(Model model) { var normalizedName = model.Name.ToUpper(); var result = BusinessRules.Run(CheckModelNameExist(normalizedName), CheckModelIdExist(model.Id)); if (result != null) { return(result); } var modelUptaded = _modelDal.Get(m => m.Id == model.Id); modelUptaded.Name = model.Name; modelUptaded.NormalizedName = model.Name.ToUpper(); _modelDal.Update(modelUptaded); return(new SuccessResult(Messages.Uptaded)); }
public IResult Update(Model model) { _modelDal.Update(_modelDal.Get(c => c.Id == model.Id)); return(new SuccessResult(Messages.Updated)); }
public IResult Update(Model model) { _modelDal.Update(model); return(new SuccessResult(Messages.Model + Messages.Updated)); }
public Model UpdateModel(Model model) { _modelDal.Update(model); return(model); }
public IResult Update(Model model) { _modelDal.Update(model); return(new SuccessResult()); }
public IResult Update(Model model) { _modelDal.Update(model); return(new SuccessDataResult <Model>(Messages.DataUpdated)); }