public void UpdateDataKecamatanTest() { UpdateDataKecamatanRequest request = new UpdateDataKecamatanRequest(); request.Kecamatan = _kecamatanUpdateData; UpdateDataKecamatanResponse response = _kecamatanService.UpdateDataKecamatan(request); Assert.IsTrue(response.Messages.Count == 0, "Failed update data"); }
public UpdateDataKecamatanResponse UpdateDataKecamatan(UpdateDataKecamatanRequest request) { UpdateDataKecamatanResponse response = new UpdateDataKecamatanResponse(); try { using (TransactionScope transScope = new TransactionScope(TransactionScopeOption.Required, new TransactionOptions { IsolationLevel = IsolationLevel.ReadCommitted })) { _kecamatanRepo.Update(request.Kecamatan); transScope.Complete(); } } catch (Exception ex) { throw new Exception(ex.ToString()); } return(response); }