public async Task <CustomerPoolDefine> CreateAsync(CustomerPoolDefine customerPoolDefine, CancellationToken cancellationToken = default(CancellationToken)) { if (customerPoolDefine == null) { throw new ArgumentNullException(nameof(customerPoolDefine)); } Context.Add(customerPoolDefine); await Context.SaveChangesAsync(cancellationToken); return(customerPoolDefine); }
public async Task DeleteAsync(CustomerPoolDefine customerPoolDefine, CancellationToken cancellationToken = default(CancellationToken)) { if (customerPoolDefine == null) { throw new ArgumentNullException(nameof(customerPoolDefine)); } Context.Remove(customerPoolDefine); try { await Context.SaveChangesAsync(cancellationToken); } catch (DbUpdateConcurrencyException) { throw; } }