protected virtual async Task <GACustPointEditDto> CreateGACustPointAsync(GACustPointEditDto input) { //TODO:新增前的逻辑判断,是否允许新增 var entity = ObjectMapper.Map <GACustPoint>(input); entity = await _gacustpointRepository.InsertAsync(entity); return(entity.MapTo <GACustPointEditDto>()); }
protected virtual async Task UpdateGACustPointAsync(GACustPointEditDto input) { //TODO:更新前的逻辑判断,是否允许更新 var entity = await _gacustpointRepository.GetAsync(input.Id.Value); input.MapTo(entity); // ObjectMapper.Map(input, entity); await _gacustpointRepository.UpdateAsync(entity); }
/// <summary> /// 导出GACustPoint为excel表 /// </summary> /// <returns></returns> //public async Task<FileDto> GetGACustPointsToExcel(){ //var users = await UserManager.Users.ToListAsync(); //var userListDtos = ObjectMapper.Map<List<UserListDto>>(users); //await FillRoleNames(userListDtos); //return _userListExcelExporter.ExportToFile(userListDtos); //} /// <summary> /// MPA版本才会用到的方法 /// </summary> /// <param name="input"></param> /// <returns></returns> public async Task <GetGACustPointForEditOutput> GetGACustPointForEdit(NullableIdDto <Guid> input) { var output = new GetGACustPointForEditOutput(); GACustPointEditDto gacustpointEditDto; if (input.Id.HasValue) { var entity = await _gacustpointRepository.GetAsync(input.Id.Value); gacustpointEditDto = entity.MapTo <GACustPointEditDto>(); //gacustpointEditDto = ObjectMapper.Map<List <gacustpointEditDto>>(entity); } else { gacustpointEditDto = new GACustPointEditDto(); } output.GACustPoint = gacustpointEditDto; return(output); }