public async Task <bool> RemoveWhereAsync(int changeId, int rowId) { var rowChange = await RepoDbSet .FirstOrDefaultAsync(change => change.ChangeId == changeId && change.ReceiptRowId == rowId); if (rowChange == null) { return(false); } RepoDbSet.Remove(rowChange); return(true); }
/// <summary> /// Removes row if 1)Row is found, 2)UserId matches ManagerId, 3)Receipt is not finalized /// </summary> /// <param name="rowId"></param> /// <param name="userId"></param> /// <returns></returns> /// <exception cref="NotImplementedException"></exception> public async Task <bool> RemoveRowAsync(int rowId, int userId) { var receiptRow = await RepoDbSet .Include(row => row.Receipt) .FirstOrDefaultAsync(row => row.Id == rowId); if (receiptRow == null) { return(false); } if (receiptRow.Receipt.ReceiptManagerId != userId || receiptRow.Receipt.IsFinalized) { return(false); } RepoDbSet.Remove(receiptRow); return(true); }
public void RemoveNoReturnAsync(TestTypeMinimal dalTestTypeMinimal) { RepoDbSet.Remove(_mapper.MapToDomain(dalTestTypeMinimal)); }
public void RemoveNoReturnAsync(ComponentMinimal dalComponentMinimal) { RepoDbSet.Remove(_mapper.MapToDomain(dalComponentMinimal)); }
public void RemoveNoReturnAsync(UnitOfMeasureMinimal dalUnitOfMeasureMinimal) { RepoDbSet.Remove(_mapper.MapToDomain(dalUnitOfMeasureMinimal)); }
public void RemoveNoReturnAsync(SpecificationMinimal dalSpecificationMinimal) { RepoDbSet.Remove(_mapper.MapToDomain(dalSpecificationMinimal)); }
public void RemoveNoReturnAsync(ManufacturerMinimal dalManufacturerMinimal) { RepoDbSet.Remove(_mapper.MapToDomain(dalManufacturerMinimal)); }