public async Task UpdateAsync(long id, CreateUpdateDocDto updateDoc) { Doc doc = await Repository.Select.Where(r => r.Id == id).ToOneAsync(); if (doc == null) { throw new LinCmsException("该数据不存在"); } _mapper.Map(updateDoc, doc); await Repository.UpdateAsync(doc); }
public async Task CreateAsync(CreateUpdateDocDto createDoc) { Doc doc = _mapper.Map <Doc>(createDoc); await Repository.InsertAsync(doc); }