public void GetDataByIDWarkahTest() { GetDataWarkahByIdRequest request = new GetDataWarkahByIdRequest(); request.nwBarcode = _warkahGetDataById.NW_Barcode; GetDataWarkahByIdResponse response = _warkahService.GetDataWarkahById(request); Assert.IsTrue(response.Messages.Count == 0, "Failed get data by Id"); }
public GetDataWarkahByIdResponse GetDataWarkahById(GetDataWarkahByIdRequest request) { GetDataWarkahByIdResponse response = new GetDataWarkahByIdResponse(); try { using (TransactionScope transScope = new TransactionScope(TransactionScopeOption.Required, new TransactionOptions { IsolationLevel = IsolationLevel.ReadCommitted })) { response.Warkah = _warkahRepo.GetDataById(request.nwBarcode); transScope.Complete(); } } catch (Exception ex) { throw new Exception(ex.ToString()); } return(response); }