public async Task <IResultModel> Update(EnumItemUpdateModel model) { var entity = await _repository.GetAsync(model.Id); if (entity == null) { return(ResultModel.NotExists); } _mapper.Map(model, entity); if (await _repository.Exists(entity)) { return(ResultModel.Failed($"名称({entity.Name})或者值{entity.Value}已存在")); } var result = await _repository.UpdateAsync(entity); return(ResultModel.Result(result)); }
public Task <IResultModel> Update(EnumItemUpdateModel model) { return(_service.Update(model)); }