Exemplo n.º 1
0
        public async Task <IResultModel> Update(DictionaryUpdateModel model)
        {
            var entity = await _dictionaryRepository.FirstAsync(model.Id);

            if (entity == null)
            {
                return(ResultModel.NotExists);
            }

            if (await _dictionaryRepository.ExistsAsync(m => m.GroupCode == model.GroupCode && m.Code == model.Code && m.Id != entity.Id && m.IsDel == false))
            {
                return(ResultModel.HasExists);
            }

            _mapper.Map(model, entity);

            var result = await _dictionaryRepository.UpdateAsync(entity);

            return(ResultModel.Result(result));
        }
Exemplo n.º 2
0
 public Task <IResultModel> Update(DictionaryUpdateModel model)
 {
     return(_service.Update(model));
 }