/// <summary> /// 修改实体 /// </summary> /// <param name="input"></param> /// <returns></returns> protected virtual async Task UpdateDataDictionaryDetailAsync(CreateOrUpdateDataDictionaryDetailInput input) { Debug.Assert(input.DataDictionaryDetail.Id != null, "input.DataDictionaryDetail.Id should be set."); var dataDictionaryDetail = await _dataDictionaryDetailRepository.GetAsync(input.DataDictionaryDetail.Id); dataDictionaryDetail = input.DataDictionaryDetail.MapTo<BaseDataDictionaryDetailInfo>(); dataDictionaryDetail.LastModifierUserId = YLSession.UserId; dataDictionaryDetail.LastModifierUserName = ""; dataDictionaryDetail.LastModificationTime = Clock.Now; await _dataDictionaryDetailRepository.UpdateAsync(dataDictionaryDetail); cacheHandler.Remove(CacheCategoryDataDictionaryDetail, "GetDataDictionaryDetailList"); }
/// <summary> /// 添加修改实体 /// </summary> /// <param name="input"></param> /// <returns></returns> public async Task CreateOrUpdateDataDictionaryDetail(CreateOrUpdateDataDictionaryDetailInput input) { if (input.DataDictionaryDetail.Id != null && input.DataDictionaryDetail.Id != Guid.Empty) { await UpdateDataDictionaryDetailAsync(input); } else { await CreateDataDictionaryDetailAsync(input); } }
/// <summary> /// 创建实体 /// </summary> /// <param name="input"></param> /// <returns></returns> protected virtual async Task CreateDataDictionaryDetailAsync(CreateOrUpdateDataDictionaryDetailInput input) { var dataDictionaryDetail = input.DataDictionaryDetail.MapTo<BaseDataDictionaryDetailInfo>(); dataDictionaryDetail.CreatorUserId = YLSession.UserId; dataDictionaryDetail.CreatorUserName = ""; dataDictionaryDetail.CreationTime = Clock.Now; await _dataDictionaryDetailRepository.InsertAsync(dataDictionaryDetail); cacheHandler.Remove(CacheCategoryDataDictionaryDetail, "GetDataDictionaryDetailList"); }
/// <summary> /// 创建实体 /// </summary> /// <param name="input"></param> /// <returns></returns> protected async virtual Task CreateDataDictionaryDetailAsync(CreateOrUpdateDataDictionaryDetailInput input) { var dataDictionaryDetail = input.DataDictionaryDetail.MapTo<BaseDataDictionaryDetailInfo>(); dataDictionaryDetail.Id = GuidHelper.NewGuid(); dataDictionaryDetail.CreatorUserId = AbpSession.UserId; dataDictionaryDetail.CreatorUserName = GetCurrentUser().RealName; dataDictionaryDetail.CreationTime = Clock.Now; await _dataDictionaryDetailRepository.InsertAsync(dataDictionaryDetail); cacheHandler.Remove(CacheCategoryDataDictionaryDetail, "GetDataDictionaryDetailList"); }