public virtual async Task UpdateBiz_CardInfoAsync(Biz_CardInfoEditDto input) { //TODO:更新前的逻辑判断,是否允许更新 var entity = await _biz_CardInfoRepository.GetAsync(input.Id.Value); input.MapTo(entity); await _biz_CardInfoRepository.UpdateAsync(entity); }
public virtual async Task <Biz_CardInfoEditDto> CreateBiz_CardInfoAsync(Biz_CardInfoEditDto input) { //TODO:新增前的逻辑判断,是否允许新增 var entity = input.MapTo <Biz_CardInfo>(); var id = await _biz_CardInfoRepository.InsertAndGetIdAsync(entity); if (id > 0) { _backgroundJobManager.Enqueue <GetCardInfoJob, GetCardInfos>(new GetCardInfos { Info = new List <GetCardInfoDto> { new GetCardInfoDto { ID = id, IdCard = entity.IdCard, Name = entity.RealName } } }); } return(entity.MapTo <Biz_CardInfoEditDto>()); }