public async Task <ApiRequestResult> AddAsync(SubjectCommentDto dto) { var command = dto.EntityMap <SubjectCommentDto, SubjectComment>(); await _subjectCommentRepository.AddAsync(command); return(ApiRequestResult.Success("添加成功")); }
public async Task <ApiRequestResult> UpdateAsync(SubjectCommentDto dto) { var entity = await _subjectCommentRepository.GetAsync(dto.Id.Value); var newEntity = dto.EntityMap(entity); await _subjectCommentRepository.UpdateAsync(newEntity); return(ApiRequestResult.Success("修改成功")); }