public void GetDataByIDKecamatanTest() { GetDataKecamatanByIdRequest request = new GetDataKecamatanByIdRequest(); request.idKecamatan = _kecamatanGetDataById.IDKecamatan; GetDataKecamatanByIdResponse response = _kecamatanService.GetDataKecamatanById(request); Assert.IsTrue(response.Messages.Count == 0, "Failed get data by Id"); }
public GetDataKecamatanByIdResponse GetDataKecamatanById(GetDataKecamatanByIdRequest request) { GetDataKecamatanByIdResponse response = new GetDataKecamatanByIdResponse(); try { using (TransactionScope transScope = new TransactionScope(TransactionScopeOption.Required, new TransactionOptions { IsolationLevel = IsolationLevel.ReadCommitted })) { response.Kecamatan = _kecamatanRepo.GetDataById(request.idKecamatan); transScope.Complete(); } } catch (Exception ex) { throw new Exception(ex.ToString()); } return(response); }