public virtual async Task UpdateCommunityAsync(CommunityEditDto input) { //TODO:更新前的逻辑判断,是否允许更新 var entity = await _communityRepository.GetAsync(input.Id.Value); entity.RefreshDate = DateTime.Now; input.MapTo(entity); await _communityRepository.UpdateAsync(entity); }
public virtual async Task <CommunityEditDto> CreateCommunityAsync(CommunityEditDto input) { //TODO:新增前的逻辑判断,是否允许新增 var entity = input.MapTo <Community>(); entity.VerifyStatus = VerifyStatus.Pass; entity.ReleaseStatus = ReleaseStatus.Publish; entity.RefreshDate = DateTime.Now; entity = await _communityRepository.InsertAsync(entity); return(entity.MapTo <CommunityEditDto>()); }