using System; using System.Threading.Tasks; using System.Transactions; using Datory; using GxPress.Entity.Topic; namespace GxPress.Service.Implement.Topic { public partial class TopicService { /// /// 删除话题 /// /// /// public async Task DeleteAsync(int id) { try { using (TransactionScope transactionScope = new TransactionScope()) { //删除话题 await _topicRepository.DeleteAsync(id); //删除话题用户 //await _topicAddresseeRepository.DeleteAsync(Q.Where(nameof(TopicAddressee.TopicId), id)); transactionScope.Complete(); } } catch (Exception e) { Console.WriteLine(e); throw; } return true; } } }