public async Task <PopularResult <string> > UpdateAsync(DictDto dto) { var result = new PopularResult <string>(); var dict = ObjectMapper.Map <DictDto, DictEntity>(dto); await _dictRepository.UpdateAsync(dict); result.Success("更新成功"); return(result); }
public void Update(DictDto config) { var entity = _dictRepository.GetById(config.DictID); entity.DictName = config.DictName; entity.DictCode = config.DictCode; entity.DictType = config.DictType; entity.OrderID = config.OrderID; _dictRepository.Update(entity); }
public JsonResult List(DictDto dto) { IList <Dict> list = new List <Dict>(); PageResponse reponse = new PageResponse(); if (!string.IsNullOrEmpty(dto.Tid)) { reponse = _DictService.GetList(dto); } return(Json(reponse)); }
public async Task <PopularResult <string> > InsertAsync(DictDto dto) { var result = new PopularResult <string>(); var entity = ObjectMapper.Map <DictDto, DictEntity>(dto); var dict = await _dictRepository.InsertAsync(entity); if (dict == null) { result.Failed("添加失败"); return(result); } result.Success("添加成功"); return(result); }
public async Task <PopularResult <string> > UpdateAsync([FromBody] DictDto dto) { return(await _dictService.UpdateAsync(dto)); }
public static DictEntity ToEntity(this DictDto model, DictEntity destination) { return(model.MapTo(destination)); }
public static DictEntity ToEntity(this DictDto model) { return(model.MapTo <DictDto, DictEntity>()); }
public void Create(DictDto config) { var entity = config.MapTo <DictEntity>(); _dictRepository.Insert(entity); }
public ResponseModel UpdateBatch([FromBody] DictDto model, int dictId) { dictService.Update(model); return(new ResponseModel()); }
public ResponseModel Create([FromBody] DictDto model) { dictService.Create(model); return(new ResponseModel()); }