public async Task DeleteValidation(DeleteIn pRequest) { if (!await _repository.GetAll().AnyAsync(a => a.Id == pRequest.Id)) { throw new AbpValidationException("Unexisting entity"); } }
public async Task PreTreatment_Delete(DeleteIn pRequest)//async { List <TestPreTreatment> list = await this._repository.GetAll().Where(w => w.TestId == pRequest.Id).ToListAsync(); foreach (TestPreTreatment testPreTreatment in list) { await this._repository.DeleteAsync(testPreTreatment); } }
public virtual async Task Delete(DeleteIn pRequest) { await this._repository.DeleteAsync(w => w.Id == pRequest.Id); }