public virtual async Task UpdateCommunityCategoryAsync(CommunityCategoryEditDto input) { //TODO:更新前的逻辑判断,是否允许更新 var entity = await _communityCategoryRepository.GetAsync(input.Id.Value); input.MapTo(entity); await _communityCategoryRepository.UpdateAsync(entity); }
public virtual async Task <CommunityCategoryEditDto> CreateCommunityCategoryAsync(CommunityCategoryEditDto input) { //TODO:新增前的逻辑判断,是否允许新增 var entity = input.MapTo <CommunityCategory>(); entity = await _communityCategoryRepository.InsertAsync(entity); return(entity.MapTo <CommunityCategoryEditDto>()); }